By using AWS re:Post, you agree to the Terms of Use
/EC2 Image Builder/

Questions tagged with EC2 Image Builder

Sort by most recent
  • 1
  • 90 / page

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

Initializing 2 NICs Automatically in Ubuntu AMI (Cloud-init issue)

I'm trying to standup a Ubuntu 20.04 based AMI with 2 NICs connected to 2 different subnets and have those NICs configured automatically. I've read the guidance about creating file in /etc/netplan to define the NIC interface but have been reading through cloud-init python scripts, since EC2 is using it to init the NICs, to figure out why this isn't done automatically and I think I found the root cause ... it seems cloud-init starts out properly configuring both NICs but then deletes the config for the primary NIC meaning that in order to SSH I would need to go over the secondary NIC. I managed to get cloud-init to initialize both NICs correctly by editing the following file and commenting out the following lines of code ``` /usr/lib/python3/dist-packages/cloudinit/net/__init__.py ``` ``` def _bringup_device(self): .... #self.cleanup_cmds.append( # ['ip', '-family', 'inet', 'link', 'set', 'dev', self.interface, # 'down']) #self.cleanup_cmds.append( # ['ip', '-family', 'inet', 'addr', 'del', cidr, 'dev', # self.interface]) def _bringup_router(self): ... #self.cleanup_cmds.insert( # 0, # ['ip', '-4', 'route', 'del', self.router, 'dev', self.interface, # 'src', self.ip]) .... #self.cleanup_cmds.insert( # 0, ['ip', '-4', 'route', 'del', 'default', 'dev', self.interface]) ``` To confirm that the solution works I delete all the cloud-init collateral and reboot to force it to restart. I also created a new custom AMI from the EC2 instance after deleting the files and confirmed that a new EC2 comes up with both NICs properly configured too ``` rm -rf /var/lib/cloud/* ``` Having to modify + maintain a custom copy of cloud-init is probably not a sustainable long term solution ... would this be a cloud-init issue or an EC2 cloud-init config issue? What's the best course of action to have this as an available long term solution? I think having cloud-init handle the NIC initialization vs. having to hand craft a file in /etc/netplan/ is probably a more sustainable long term solution. Thanks
0
answers
0
votes
6
views
asked 4 months ago

Launched EC2 instance UNREACHABLE for Ubuntu 20.04 AMI with python 3.9 upgrade

I am using **EC2 Ubuntu 20.04 VM**. Due to **[CVE-2021-3177][1]**, Python needs to be upgraded to the latest version of Python3.9 which would be 3.9.5 currently. I did that using the `apt install` option as per the steps mentioned below: sudo apt update sudo apt upgrade -y sudo apt install python3.9 The above ensures that Python3.9.5 is now available. But now python3.8 & python3.9 is available. So next we will use the update-alternatives command to make python3.9 as the default version. sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2 Now that alternatives are defined, we will switch to Option 2 as the default option i.e. Python3.9 sudo update-alternatives --config python3 Once done, the following command would point to the latest version. sudo python3 -V However, if you use the `sudo apt update` command, you will see an error stating that Traceback (most recent call last): File "/usr/lib/cnf-update-db", line 8, in <module> from CommandNotFound.db.creator import DbCreator File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module> import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' Reading package lists... Done E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi' E: Sub-process returned an error code To fix this we will have to add a link using the following command cd /usr/lib/python3/dist-packages/ sudo ln -s apt-pkg.cpython-{38m,39m}-x86_64-linux-gnu.so Next, I tried used the following commands apt purge python3-apt apt install python3-apt sudo apt install python3.9-distutils python3.9-dev Once done following command will now not result in any errors sudo apt update This means that the issue is fixed. **I can use this machine & use it after reboot too. ** **But for some reason, If I create an AMI and launch an instance then that instance is unreachable.** Appreciate your help. [1]: https://nvd.nist.gov/vuln/detail/CVE-2021-3177
1
answers
0
votes
6
views
asked 5 months ago

AWS EC2 F1 ERROR: [v++ 60-773] caught Tcl error: ERROR: '2201011829' is an invalid argument.

Hi, I have been trying to run hardware system image in AWS f1.2x large instance. I am successfully able to run sw_emu. However, when I try to create the hardware image, I keep getting the following error. This is strange because the same code was able to be synthesized 2 days ago. ``` ERROR: [v++ 60-773] In '/home/centos/<cwd>/_x/runOnfpga/runOnfpga/vitis_hls.log', caught Tcl error: ERROR: '2201012237' is an invalid argument. Please specify an integer value. ``` Note: The ERROR number is observed to change as I run the hw synthesis each time. And in the vitis_hls.log, the following info is being displayed ``` INFO: [IP_Flow 19-1686] Generating 'Simulation' target for IP 'runOnfpga_sitodp_32ns_64_4_no_dsp_1_ip'... ERROR: '2201012237' is an invalid argument. Please specify an integer value. while executing "rdi::set_property core_revision 2201012237 {component component_1}" invoked from within "set_property core_revision $Revision $core" (file "run_ippack.tcl" line 1515) INFO: [Common 17-206] Exiting Vivado at Sat Jan 1 22:37:40 2022... ERROR: [IMPL 213-28] Failed to generate IP. INFO: [HLS 200-111] Finished Command export_design CPU user time: 55.92 seconds. CPU system time: 2.62 seconds. Elapsed time: 55.3 seconds; current allocated memory: 1.956 GB. command 'ap_source' returned error code while executing "source runOnfpga.tcl" ("uplevel" body line 1) invoked from within "uplevel \#0 [list source $arg] " ``` Update: It seems like even the Xilinx examples are giving out the same problem when we run on F1 instance. I tried to clone the [Vitis Accel Examples](https://github.com/Xilinx/Vitis_Accel_Examples.git) and it gave the same problem as above. ``` INFO: [v++ 200-789] **** Estimated Fmax: 339.33 MHz ERROR: [v++ 213-28] Failed to generate IP. ERROR: [v++ 60-300] Failed to build kernel(ip) vadd, see log for details: /home/centos/Vitis_Accel_Examples/sys_opt/multiple_devices/_x.hw.xilinx_aws-vu9p-f1_shell-v04261818_201920_2/vadd/vadd/vitis_hls.log ERROR: [v++ 60-773] In '/home/centos/Vitis_Accel_Examples/sys_opt/multiple_devices/_x.hw.xilinx_aws-vu9p-f1_shell-v04261818_201920_2/vadd/vadd/vitis_hls.log', caught Tcl error: ERROR: '2201020036' is an invalid argument. Please specify an integer value. ERROR: [v++ 60-773] In '/home/centos/Vitis_Accel_Examples/sys_opt/multiple_devices/_x.hw.xilinx_aws-vu9p-f1_shell-v04261818_201920_2/vadd/vadd/vitis_hls.log', caught Tcl error: ERROR: [IMPL 213-28] Failed to generate IP. ERROR: [v++ 60-599] Kernel compilation failed to complete ERROR: [v++ 60-592] Failed to finish compilation INFO: [v++ 60-1653] Closing dispatch client. make: *** [_x.hw.xilinx_aws-vu9p-f1_shell-v04261818_201920_2/vadd.xo] Error 1 ``` Please suggest ways to debug this problem.
3
answers
1
votes
20
views
asked 5 months ago

EC2 Image Builder updating Launch Templates and wiping Snapshot configuration

I have a pretty simple Launch Template that launches an instance with a root volume defined by the AMI, and a data volume that comes from a snapshot. Lets say this snapshot includes data that cannot be recreated within the context of the EC2 Image Builder, but also doesn't have to be mounted during the Image Builder run. I'd like for the end result of the EC2 Image Builder to update the Launch Template to - Update the Root volume with the new AMI snapshot - Preserve the secondary volume to have the extant snapshot If I don't specify the mounting of any secondary volume during the Image Builder run - the Snapshot specification in the Launch Template is wiped when the new Launch Template version is automatically created. If I manually update the Launch Template with the new AMI - the Snapshot specification is preserved. From playing around with mounting the snapshot during Image Creation - I can see new snapshots being made from the Build process. However - part of the builder process involves a modification to that secondary volume - I'd like for that to not persist and for the new image to use a "clean" slate in the launch template. The changes made are not trivial to undo, so a straight up `rm -rf` on the secondary volume is not really an option. Is there a way for me to preserve the original snapshot usage on the secondary volume when updating the Launch Template?
1
answers
0
votes
16
views
asked 6 months ago
  • 1
  • 90 / page