-
Navigate to Get Ubuntu Server | Download | Ubuntu.
-
Right-click on the download now button and copy the URL.
-
Logon to Nutanix web console.
-
Click on Settings >> Image configuration.
-
Click Upload image.
-
Set Name.
-
Select ‘ISO’ on image type list.
-
Select ‘SelfServiceContainer’ container on storage container list.
-
On Image source select ‘From URL’ and paste the download link from ubuntu website that we copied earlier and click ‘Save’.
- Check task history to make sure the image has been uploaded as shown below
- Navigate to Home >> VM.
- Click Create VM.
- Fill in the following settings:
- Name
- VCPU(s)
- Memory
- Click on Edit option on the CD-ROM.
-
Select ‘Clone from Image Service’ as operation
-
Set bus type as ‘IDE’
-
Select the image we uploaded earlier and click ‘Update’
-
Click on ‘Add New Disk’.
-
Set the config as shown below.
-
Click on Add New Nic.
-
Select available VLAN as shown below and click ‘Add’.
-
Click ‘Save’ to create the VM.
-
Click on Table and select the VM
-
Click on Power on.
-
Click on Launch Console.
-
Follow the Ubuntu server installation wizard and set the following:
- Update to the latest installer if a later version is available
- Use the entire disk and deselect the option to set up the disk as an LVM group
- Configure an account and set a password
- Opt to install OpenSSH Server
- Other optional packages aren’t needed for this basic Ubuntu image
If you see the following error just press Enter and reboot.
-
Once the VM has been rebooted logon to the VM.
-
Apply package update/Upgrade with the following commands:
apt-get update
apt-get upgrade
-
Update GRUB by editing file ‘/etc/default/grub’.
-
Modify the line 'GRUB_CMDLINE_LINUX=“” ’ with the following :
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
- Run the following command :
update-grub
- Run the following command to update file ‘70-persistent-net.rules’.
cat << EOF > /etc/udev/rules.d/70-persistent-net.rulesSUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"EOF
- Remove the file ‘subiquity-disable-cloudinit-networking.cfg’ with following command as cloud-init will skip network configuration if it’s present:
rm -f /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
- Update file ‘99-pve.cfg’ with the following:
cat << EOF > /etc/cloud/cloud.cfg.d/99-pve.cfgdatasource_list: [ConfigDrive, NoCloud]EOF
- Remove Netplan files with the following command as they won’t be generated if present:
rm -f /etc/netplan/00-installer-config.yaml
rm -f /etc/netplan/50-cloud-init.yaml
- Run the following command to clean cloud-init:
cloud-init clean
-
Reboot the VM and notice the network interface label has now changed to ‘eth0’.
-
Clear the Bash history with the following command:
cat /dev/null > ~/.bash_history && history -c && exit
- Shutdown the VM.
To Convert the VM to an image follow the steps below:
-
Logon to Nutanix CVM via ssh.
-
Run the following command to list disks for vm ‘MyUbuntuImgVM’ that we just created:
acli vm.get MyUbuntuImgVM include_vmdisk_paths=1 | grep -E 'disk_list|vmdisk_nfs_path|vmdisk_size|vmdisk_uuid'
- Make note of the vmdisk_nfs_path as shown below:
Note that the full disk URL will be : nfs://your_nutanix_node_url/your_vmdisk_nfs_path
- To create an image with the above disk url, Navigate to Settings >> Image Configuration >> upload image.
-
Fill in the name text box.
-
Select ‘Disk’ as image type.
-
Set storage container to ‘SelfServiceContainer’.
-
On the from URL, paste in the full disk path from step 42 and click ‘Save’…
Note that the full disk URL will be : nfs://your_nutanix_node_url/your_vmdisk_nfs_path
- Click view all tasks to check the status of image creation process.
- Confirm that the image has been created from disk as shown below.
-
On Morpheus navigate to Infrastructure >> Clouds >> Nutanix cloud.
-
Run a short cloud refresh.
-
Once synced confirm that the image has been synced into Morpheus by searching under Library >> Virtual Images.
-
Under ‘Virtual Images’ change the filter to ‘Synced’.
-
Search for image to confirm it has been synced.
- Edit the image by clicking on the pencil icon.
- Make sure the following settings are set and click save changes.