Virtualization, Servers and Storage : How-to Deploy an Ubuntu Server or AlmaLinux instance with the vss-cli

The ITS Private Cloud is now offering in experimental stage Ubuntu Server and AlmaLinux Cloud image deployment that allows users having a virtual instance up and running in minutes. Ubuntu images are directly imported to our content library from the official repository, however, AlmaLinux images are hand-crafted into OVA by our amazing team using the official generic cloud sources.

(blue star) Create SSH Keys (optional)

Although the ITS Private Cloud provides temporary credentials to access your Ubuntu/AlmaLinux virtual machine (vss-user ), it is highly recommended to use SSH Key exchange to access. In this section, we will be using ssh-keygen to generate a keypair.

To create a SSH Key, open a terminal on your workstation and run the OpenSSH tool ssh-keygen command as follows:

ssh-keygen -b 2048 -t rsa -f ~/.ssh/vss_id_rsa

Note that vss_id_rsa could be any file name you want.

Once you complete the prompts, you would get one private key and a public key: vss_id_rsa and vss_id_rsa.pub.

The following is the output of a successful execution:

ssh-keygen -b 2048 -t rsa -f ~/.ssh/vss_id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/user/.ssh/vss_id_rsa
Your public key has been saved in /Users/user/.ssh/vss_id_rsa.pub
The key fingerprint is:
SHA256:dBFIH0n4X020qRMA+XBxwabE9PkFKlwcsPJxBTCPBYg user@hostname
The key's randomart image is:
+---[RSA 2048]----+
|       o.*#@B=+..|
|      E +=.&==..+|
|        o.& *+ =.|
|       . +.*  = o|
|        S .. + . |
|            . .  |
|                 |
|                 |
|                 |
+----[SHA256]-----+

(blue star) Upload SSH Public Keys (optional)

To upload the public key to your ITS Private Cloud account, run the vss-cli key import command with the location of the vss_id_rsa.pub or the public key equivalent file:

vss-cli key mk .ssh/vss_id_rsa.pub

A similar output is expected:

id                  : 14
created_on          : 2023-04-19 Wed 11:32:14 EDT
updated_on          : 2023-04-19 Wed 11:32:14 EDT
type                : ssh-rsa
comment             : user@hostname

To verify a successful import, run vss-cli key ls or vss-cli key get <id> as follows:

vss-cli key get 14
id                  : 14
created_on          : 2023-04-19 Wed 11:32:14 EDT
updated_on          : 2023-04-19 Wed 11:32:14 EDT
type                : ssh-rsa
comment             : user@hostname
fingerprint         : dBFIH0n4X020q...XBxwabE9PkFKlwcsPJxBTCPBYg
value               : AAAAB3NzaC1yc2EAAAADAQABAAABAQC5fLJwE3dYS1/yoAgAqHFHdMi9CHTBA..+gvz/k7

The key is now ready to be used by our post-deployment customization tools to allow ssh access to the virtual instance.

We are working on providing a SSH Key Management interface in the ITS Private Cloud Portal, but for now the vss-cli and the API are the only interfaces available to manage Keys.

(blue star) Deploy Instance

This experimental feature allows picking from either of the following AlmaLinux and Ubuntu Server versions:

  1. AlmaLinux

    vss-cli compute contentlib ovf ls -f name=Alma

    output:

    id                                    name             library.name         size
    ------------------------------------  ---------------  --------------  ---------
    f0e29501-be02-4436-bf01-17e36d315a9b  AlmaLinux9-Tmpl  VSS-Nix         658671692
    dbaffe53-22ab-4b25-aa0b-ed351bbfe798  AlmaLinux8-Tmpl  VSS-Nix         931240012       665984022

  2. Ubuntu Server

    vss-cli compute contentlib ovf ls -f name=Ubuntu -a

    output:

    id                                    name                                         library.name         size
    ------------------------------------  -------------------------------------------  --------------  ---------
    323806f8-8a04-4eda-b1fe-680ca0bbd79c  Ubuntu-20.04.focal-server-cloudimg-amd64     VSS-Nix         887508654
    8c22bc65-0fe9-4017-94f2-ca68fd698cf0  Ubuntu-18.04.bionic-server-cloudimg-amd64    VSS-Nix         544945842
    ffc229e6-e00b-49dd-8f27-c9ff9e1b1917  Ubuntu-16.04.xenial-server-cloudimg-amd64    VSS-Nix         462491314
    8261093e-281a-42db-8d1c-1c2f68e30b33  Ubuntu-22.04.jammy-server-cloudimg-amd64     VSS-Nix         958488663
    f936d907-d44c-4fd4-86f8-a8cd48ba2a7a  Ubuntu-22.10.kinetic-server-cloudimg-amd64   VSS-Nix         952631903
    a5461319-b5dc-4c74-b2b0-e79010601157  Ubuntu-23.10.mantic-server-cloudimg-amd64    VSS-Nix         934276187
    e743ec85-e660-42eb-85e4-bff4eea75481  Ubuntu-23.04.lunar-server-cloudimg-amd64     VSS-Nix         971834455
    aaaf791f-f71c-44db-9190-933627c4873c  Ubuntu-24.04.noble-server-cloudimg-amd64     VSS-Nix         932095063
    18944b79-5b80-48ae-a4c8-7adf982fce33  Ubuntu-24.10.oracular-server-cloudimg-amd64  VSS-Nix         993016931


The simplest approach to deploy AlmaLinux or Ubuntu-22.04 is shown below:

vss-cli --wait compute vm mk from-clib --source AlmaLinux9-Tmpl \
--net VSS-CGN -d 'Testing vss-public deployment' \
--folder Folder -b EIS --os centos9_64Guest --vss-service N/A \
--power-on alma9
vss-cli --wait compute vm mk from-clib --source Ubuntu-22.04 \
--net VSS-CGN -d 'Testing vss-public deployment' \
--folder Folder -b EIS --os ubuntu64Guest --vss-service N/A \
--power-on ubunutu22

A confirmation email is sent while the virtual machine is deployed with three important pieces of information: ssh port, admin username and temporary password, and VM console password.

Once the deployment is complete, cloud-init kicks in and starts customizing the operating system.

id                  : 7505
status              : IN_PROGRESS
task_id             : 74eea3a2-cfea-4c09-91f1-f28154b6d415
message             : Request has been accepted for processing
⏳ Waiting for request 7505 to complete...
🎉 Request 7505 completed successfully:
warnings            : Userdata not provided. Default Udata will be generated.,
                      Temp Console root password is: ...., 
                      Temp SSH@2222 username vss-admin password is: ...., 
                      Fault Domain: FD4 (domain-c66), Created in: Public > Folder (group-v4122),
                      Network adapter 1 (vmxnet3): 00:50:56:92:3f:95: VL-0253-EIS-VSS-CGN, 
                      Power on delayed. Waiting for cloud-init to be applied., 
                      Waiting for cloud-init to be applied., User data will be applied., 
                      Successfully allocated 00:50:56:92:3f:95 -> 100.76.X.X

(tick) Verify Instance

cloud-init will run OS updates and customize the operating system, which takes some time depending on the number of packages to be updated. If the OS requires to reboot, it will take a bit longer.

You can follow up the process via the VM Console and tailing /var/log/cloud-init-output.log or /var/log/cloud-init.log .

After the OS reboot, try logging into the VM with the details provided in the email as follows:

ssh -p $PORT $USER@$IP_ADDRESS

Last login: Wed Jun 14 11:09:47 2023 from X.X.X.X

  University of Toronto ITS Private Cloud Instance

  Name:     2306T-alma9
  ID:       vm-866664

[$USER@2306T-alma9 ~]$