Questions tagged with Amazon EC2

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Debian-11 build process has lost its ethernet interfaces

We are using Yocto build-system (kirkstone) to compile images for i.MX8 based development board and we are trying to move the build process to AWS EC2 based environment for CI integration. We are currently using Debian (AMI: debian-11-amd64-20220503-998, type: t3.2xlarge) EC2 image from AWS marketplace. We have configured the EC2 machine with one external interface that binds to public IP and the machine is able to communicate with the outside world. This is the output of the `ip addr` from the login shell ``` admin@ip-XXX-XXX-XXX-XXX:~$ ip a show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP group default qlen 1000 link/ether XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff altname enp0s5 inet XXX-XXX-XXX-XXX/20 brd XXX.XXX.XXX.XXX scope global dynamic ens5 valid_lft 2992sec preferred_lft 2992sec inet6 XXXX::XXXX:XXXX:XXXX:XXXX/64 scope link valid_lft forever preferred_lft forever ``` But, after we try to compile our Yocto project we get several build errors due to fetch failing as some of our recipes fail to fetch sources from outside world. If I launch a development shell with `bitbake -c devshell my-app` it will no longer see the ethernet devices but only the local interface which is in down state and has no IP attached to it ``` admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$ ip a show 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:200:00:00:00 ``` and I can also see that resolving outside connections no longer work ``` admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$ traceroute6 www.google.com www.google.com: Temporary failure in name resolution Cannot handle "host" cmdline arg `www.google.com' on position 1 (argc 1) ``` This is the output from process tree ``` admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$ ps f PID TTY STAT TIME COMMAND 943 pts/1 Ss 0:00 /bin/bash 994 pts/1 R+ 0:00 \_ ps f 758 pts/0 Ss 0:00 -bash 830 pts/0 Sl+ 0:01 \_ python3 /home/admin/yocto/sources/poky/bitbake/bin/bitbake my-app -c devshell 941 pts/0 S+ 0:00 \_ sh -c screen -r devshell_939 942 pts/0 S+ 0:00 \_ screen -r devshell_939 ``` Another thing that seems off is that the build process has somehow lost all its groups and there is a group `nogroup` added ``` admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$ groups admin nogroup ``` When running the `groups` from the login shell the user has `admin adm dialout cdrom floppy sudo audio dip video plugdev netdev` that seem to be lost when launching the development shell. We are using the build system in multiple local development environments (based on Debian-11) and the build system is able to connect to outside world just fine so this relates to the AWS EC2 Debian image that we are using. Why are the interfaces not displayed and how can we work-around this issue so that the build process can access the source repositories from the build environment?
0
answers
0
votes
8
views
asked 7 days ago

resize windows drive with aws ssm

trying to use this script to resize a volume ``` Param ( [string][Parameter(Mandatory = $True)] $VolumeId, [string][Parameter(Mandatory = $True)] $driveletter, [int][Parameter(Mandatory = $True)] $NewSize ) $CurrentSize = Get-EC2Volume -Volume $VolumeId If ($NewSize -lt $CurrentSize.Size) { Write-Host "New volume must be larger than current" -ForegroundColor Red; break} Edit-EC2Volume -VolumeId $VolumeId -Size $NewSize | Out-Null $ModifiedSize = (Get-EC2Volume -Volume $VolumeId).Size While ($ModifiedSize -ne $NewSize) { Start-Sleep 5 $ModifiedSize = (Get-EC2Volume -Volume $VolumeId).Size } Write-Host "" Write-Host "Volume:$VolumeId is resized to size:$NewSize" -ForegroundColor Green $InstanceId = (Get-EC2Volume -Volume $VolumeId | Select-Object -ExpandProperty Attachments)[0].InstanceId write-output $driveletter $Commands = @( '$DiskNumber = (Get-Partition -DriveLetter $driveletter).DiskNumber', 'Update-Disk -Number "$DiskNumber"', '$Size = Get-PartitionSupportedSize -DriveLetter $driveletter', 'Resize-Partition -DriveLetter $driveletter -Size $Size.SizeMax' ) $Parameter = @{ commands = $Commands } $Document = 'AWS-RunPowerShellScript' Write-Host "" Write-Host "Extending $driveletter : drive..." -ForegroundColor Green Try { $Cmd = Send-SSMCommand -DocumentName $Document -Parameter $Parameter -InstanceId $InstanceId While ($Cmd.Status -ne 'Success') { $Cmd = Get-SSMCommand -CommandId $Cmd.CommandId Start-Sleep 5 } Write-Host "" Write-Host $driveletter ": drive is extended" -ForegroundColor Green } Catch { Write-Host "" Write-Host "Failed to extend drive" -ForegroundColor Red } ``` but keep getting Failed to extend drive when extending the windows part
1
answers
0
votes
14
views
drago
asked 8 days ago