Cloud images are operating system templates. The default user of cloud image is "ubuntu". We need to set password for default user, or else the password is random.
You can install Ubuntu 20.10 cloud image using either of the following methods:
- Deploy the cloud image with vCenter Server
- Choose the ESXi host or DataCenter.
- Select ACTIONS --> Deploy OVF Template…
- Select an OVF template, you can input the URL of cloud image or upload the local.ova file. Click NEXT.
- Input the Virtual machine name and select a location for the virtual machine. Click NEXT.
- Choose ESXi host and click NEXT.
- Review the details and click NEXT.
- Select storage and virtual disk format. The disk format "Thin Provision" is recommend. Click NEXT.
- Select networks and click NEXT.
- In the "Customize template" stage, Default User's password is required. The default user is "ubuntu" for cloud image.
You need to input the password or else the random password is created. The other fields are optional. Click NEXT. - Review all the details and click FINISH.
- Deploy cloud image with host WEB UI, if you do not have a vCenter Server.
Note: Deploying .ova file takes some time to complete. You can check the progress in the "Recent Tasks" window.
- Prepare ISO within config data: You need to prepare an ISO with the config data about customizing the VM instance.
The component "Cloud-init" in ubuntu cloud image is the tool that applies config data to your instance automatically.
- Construct file user-data
cat >user-data << EOF
#cloud-config
password: your-password
chpasswd: { expire: false }
ssh_pwauth: True
EOF
Note: you can add more configuration details, if required.
- Construct file meta-data
echo "instance-id: $(uuidgen || echo i-abcdefg)" > meta-data
- Build iso with files user-data and metadata using the following commands:
cloud-localds seed.iso user-data metadata (Note: cloud-image-utils provides cloud-localds)
or
genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
The contents of the iso with label cidata are:
/user-data
/meta-data
- Construct file user-data
- Deploy .ova file without PowerOn
- Create VM, choose "Deploy an virtual machine from and OVF and OVA".
- Enter a name for virtual machine, and select .ova file.
- Select storage.
- In stage "Deployment options", select network, format of disk provisioning and uncheck "Power on automatically".
- Review the detail and click Finish.
- Mount prepared ISO to CD/DVD1, connect CD/DVD1 to VM and Power on VM.
- Select the deployed VM and click Edit settings.
- In Edit VM setting window, choose "Datastore ISO file" for CD/DVD Drive 1 and then select the prepared ISO file.
You may need to upload the prepared ISO to datastore of ESXi host. Select checkbox "Connect at poweron". - Power on the VM.
- Login to VM as user "ubuntu" and using the password that you set while constructing the file user-data.