AWS Linux on Premises
在ESXi上安装AWS Linux要注意
-
AWS Linux通过
seed.iso进行初始化,要附加这个镜像到虚拟机 -
AWS Linux内置没有启用SSH的密码登陆,需要更改
/etc/ssh/sshd_config
在不用vCenter的时候如果要克隆VM
-
首先复制对应的vmdk文件到目标文件夹
-
精简制备的磁盘此时会占用全部空间
-
执行
dd if=/dev/zero bs=1048576 of=/zero ; sync ; rm -rf /zero给空余空间置0 -
到ESXi主机上执行
vmkfstools -K *disk_name*.vmdk释放置0的空间
To create the seed.iso boot disc
-
Create a new folder named
seedconfigand navigate into it. -
Create the
meta-dataconfiguration file. -
Create a new file named
meta-data. -
Open the
meta-datafile using your preferred editor and add the following.local-hostname: `vm_hostname` # eth0 is the default network interface enabled in the image. You can configure static network settings with an entry like the following. network-interfaces: | auto eth0 iface eth0 inet static address 192.168.1.10 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 gateway 192.168.1.254Replace
vm_hostnamewith a VM host name of your choice, and configure the network settings as required. -
Save and close the
meta-dataconfiguration file.
For an example meta-data configuration file that specifies a VM hostname (amazonlinux.onprem), configures the default network interface (eth0), and specifies static IP addresses for the necessary network devices, see the sample Seed.iso file.
-
Create the
user-dataconfiguration file. -
Create a new file named
user-data. -
Open the
user-datafile using your preferred editor and add the following.#cloud-config #vim:syntax=yaml users: # A user by the name `ec2-user` is created in the image by default. - default chpasswd: list: | ec2-user:`plain_text_password` # In the above line, do not add any spaces after 'ec2-user:'.Replace
plain_text_passwordwith a password of your choice for the defaultec2-useruser account. -
(Optional) By default, cloud-init applies network settings each time the VM boots. Add the following to prevent cloud-init from applying network settings at each boot, and to retain the network settings applied during the first boot.
# NOTE: Cloud-init applies network settings on every boot by default. To retain network settings # from first boot, add the following ‘write_files’ section: write_files: - path: /etc/cloud/cloud.cfg.d/80_disable_network_after_firstboot.cfg content: | # Disable network configuration after first boot network: config: disabled -
Save and close the
user-dataconfiguration file.
You can also create additional user accounts and specify their access mechanisms, passwords, and key pairs. For more information about the supported directives, see Module reference. For an example user-data file that creates three additional users and specifies a custom password for the default ec2-user user account, see the sample Seed.iso file.
- Create the
seed.isoboot image using themeta-dataanduser-dataconfiguration files.
For Linux, use a tool such as genisoimage. Navigate into the seedconfig folder, and run the following command.
`$` genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
For macOS, use a tool such as hdiutil. Navigate one level up from the seedconfig folder, and run the following command.
`$` hdiutil makehybrid -o seed.iso -hfs -joliet -iso -default-volume-name cidata seedconfig/