EC2UPLOADIMG-3.13(1)
β¨ NAME β¨
okay bestie, welcome to the ec2uploadimg.1() manual page π
. This is all about ec2uploadimg β upload a compressed raw image file to Amazon EC2 and create a snapshot or an AMI. periodt. π
πΈ SYNOPSIS πΈ
ec2uploadimg [option] PATH_TO_FILE
π DESCRIPTION π
okay so here's the vibe: ec2uploadimg uploads a compressed raw image to Amazon EC2 using an existing EC2 AMI, then creates a snapshot or registers a new AMI from the image. β¨ The apparent size of the raw image is recommended to be 10 GB or less. It is expected that the raw image has 1 partition, i.e. the root partition is /dev/sda1. π«Ά
The process of creating the image is literally this:
- start an instance
- create a storage volume and attach it to the running instance
- create volume that will be the new root and attach it to the running instance
- upload the image
- unpack the image and dump it to the new root volume
- detach the new root volume and create a snapshot
- register a new AMI
- clean up
π OPTIONS π
-a,--account ACCOUNT_NAMEβ specifies the account to use to connect to EC2. The account is specified in the config file~/.ec2utils.conf. The account is specified as a section with[account-ACCOUNT_NAME]delimiter. The options of the sections areaccess_key_idsecret_access_keyssh_key_namessh_private_keyβ this allows the program to connect to EC2. If theaccess_key_idand/orsecret_access_keyare not found in~/.ec2utils.conf, the search will use theACCOUNT_NAMEto look for a matching section[profile ACCOUNT_NAME]in~/.aws/configor[ACCOUNT_NAME]in~/.aws/credentials. π--access-id AWS_ACCESS_KEYβ specifies the AWS access key and overrides the value given for the account with theaccess_key_idin the configuration file. π-B,--backing-store EC2_BACKING_STOREβ specifies the backing store type for the AMI to be created. The uploaded image is an EBS (Elastic Block Store) backed image and may be registered as using SSD or Magnetic media as the backing store when being launched. Possible values aressd,mag, or one of the known storage classes. The generic identifierssdis mapped to thegp2storage class, and themagidentifier is mapped to thestandardstorage class. π--billing-codes BILLING_CODESβ specifies the billing product codes to apply to the image during registration. This functionality is restricted to specific accounts within EC2. πΈ--boot-kernel AWS_AKI_IDβ specifies theaki_idof the boot kernel that should be used when registering a Para-virtual image. This option overrides theaki_i386,aki_x86_64, org2_aki_x86_64value in the configuration file. π§--boot-modeβ optionally specify the boot mode for the image. Accepted values arelegacy-bios,uefi, oruefi-preferred. If no boot mode is specified the default behavior for the instance type applies,uefiforaarch64instances andbiosforx86_64based instances. An image with theuefi-preferredsetting will boot usinguefiif the instance type supportsuefi, otherwise it will usebios. π-d,--description IMAGE_DESCRIPTIONβ specifies a description for the image. The description will also be used for the snapshot. π-e,--ec2-ami AWS_AMI_IDβ specify the AMI ID of the image to launch that will be used to perform the upload operation. This value overrides the value given with theamioption for a given region in the configuration file. π¦-f,--file CONFIG_FILEβ specifies the configuration file to use. The default is~/.ec2utils.conf. π--grub2β specifies if the image being uploaded and registered as AMI uses the GRUB2 bootloader. In some cases GRUB2 is referred to as GRUB and the first incarnation of GRUB is referred to as GRUB-Legacy. Setting this switch will select theg2_aki_x86_64value from the configuration file or will use the value given with--boot-kernelas theakiID when a para virtual image is being registered. π₯Ύ--imds-supportβ optionally specify the version for accessing the Instance MetaData Service (IMDS). The default is to access the IMDS using the version1.0implementation. Accepted values are2.0alternatively prefixed with av. π°οΈ-m,--machine ARCHβ specifies the architecture for the VM to be created. Supported values arearm64,i386orx86_64. π₯οΈ-n,--name IMAGE_NAMEβ specifies the name of the AMI to be registered. π·οΈ-p,--private-key-file PRIVATE_KEYβ specifies the path to the private ssh key file to use to connect with the instance that is being used to upload the raw image. This option overrides the value of thessh_private_keyin the configuration file. π-r,--regions EC2_REGIONSβ a comma separated list of Amazon EC2 regions, or a single region. π--root-volume-sizeβ specify the size in GB of the new root volume for the AMI being created. It is recommended to keep the root volume size to10GBor less. πΎ--ssh-key-pair AWS_KEY_PAIR_NAMEβ specifies the key-pair name to use when launching the instance that is used to upload the raw image. The specified private key file must correlate to the key pair name given with this argument. This value overrides the value given for the account with thessh_key_namein the configuration file. ποΈ-s,--secret-key AWS_SECRET_KEYβ specifies the AWS secret access key and overrides the value given for the account with thesecret_access_keyin the configuration file. π€«--security-group-ids AWS_SECURITY_GROUP_IDSβ specifies a list of security group ids to apply to the helper instance. At least one of the groups must have port22open to support ssh connections. πͺ--session-token AWS_SESSION_TOKENβ specifies the AWS session token. Only necessary when using temporary credentials. ποΈ--snaponlyβ when this argument is set only a snapshot of the uploaded image will be created. The snapshot may then be used in a separate operation to register an AMI. πΈ--use-snapshotβ when this argument is set the image will be created from an existing snapshot. ThesnapshotIDis specified as thesourcevariable. π§©--sriov-supportβ enable SRIOV support for HVM images. This implies that the appropriate driver has to be included in the image. β‘--ssh-timeout SSH_TIME_OUTβ specifies the amount of time to wait in seconds to establish an SSH connection with the helper instance. β³--tpm-supportβ optionally specify the version of the TPM implementation the OS in the image supports. This option can only be used if boot-mode is set to a value other thanbios. Accepted values are2.0alternatively prefixed with av. π-t,--type AWS_UPLOAD_INST_TYPEβ specifies the instance type to launch for the instance being used to upload the image. This value overrides the value given with theinstance_typeoption for a given region in the configuration file. π§±-u,--user AWS_INSTANCE_USERβ specifies the user to use to connect to the instance being used to upload the image. This value overrides the value given with theuseroption for a given region in the configuration file. πββοΈ--use-private-ipβ use the private IP of the helper instance to upload the new image. This is helpful when an image is to be created and only a private VPC is available. π‘οΈ--use-root-swapβ create the new image using the root swap method. The helper instance used to upload the image will be stopped and the created image volume will be attached to the helper instance. A new image is registered from the helper instance. This method of image creation is useful when meta data associated with the image used to launch the helper instance needs to be transferred to the new image. The new image creation may time out as a copy of the complete image disk needs to be made. The code will then skip the clean up and a storage volume, a target root volume and a stopped instance will remain in the users account. π-V,--virt-type AWS_VIRT_TYPEβ specifies the virtualization type to use for the image to be registered. Possible values arepara(default) orhvm. π--vpc-subnet-id VPC_SUBNET_IDβ specify the VPC subnet ID into which the helper instance should be launched. This option is useful if no default VPC is configured or it is desired to launch the helper instance into a private subnet of the VPC. For the use of a private subnet it may also be necessary to use the--use-private-ipcommand line option. The ID should start withsubnet-. Instance type and subnets are to a certain degree linked in that it may not be possible to launch the configured helper instance type outside a VPC subnet. Therefore, if the--vpc-subnet-idis not specified on the command line and neither--ec2-amior--instance-idare specified on the command line an attempt will be made to retrieve the subnet-id from the configuration. The configuration issubnet_id_REGIONwhere region is one of the known region identifiers such asus-east-1. The region given with the--regionscommand line argument is used. Specifying multiple regions with the--regionsargument and using the--vpc-subnet-idargument is incompatible. When targeting multiple regions the subnet-id must be set in the configuration file. πΈοΈ--wait-count AWS_WAIT_COUNTβ specifies the number of times to wait for the AWS operation timeout. The default value is1which is equivalent to600seconds. β
π¦ EXAMPLE π¦
ec2uploadimg --account example -d "My first image" -m x86_64 -n my_linux_image -r us-east-1 PATH_TO_COMPRESSED_FILE
Will upload the raw disk image contained in the PATH_TO_COMPRESSED_FILE and will register a new AMI from the image. π
π AUTHOR π
Robert Schweikert (rjschwei@suse.com) π
and that's the whole ec2uploadimg.1() footer vibe, bestie β catch you in the group chat. π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: python313-ec2imgutils 10.0.3-bp160.1.11 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms