How-to add additional contacts on a Virtual Machine
All virtual machines running on ITS Private Cloud are required to have VM Administrator up-to-date. Based on Virtual Machine Administrator
This tutorial will guide you through adding additional contacts to your VM so you can send alerts to other users.
Instructions
There are two ways to add additional contacts: through the Cloud Portal or using the VSS-CLI. The VSS-CLI also allows you to perform bulk updates.
Using VSS Cloud Portal
Open a web browser and log into the VSS Cloud Portal
Select the virtual machine you wish to update by clicking on the edit icon.
Navigate to the ADMIN tab and proceed to add an additional contact email address in the Aditional Contacts text field text field.
Click ADD CONTACT button.
Click UPDATE button.
Click CONFIRM button to apply and save the changes.
To add additional contacts of other virtual machines, simply repeat the steps outlined above for each machine that requires an update. This will ensure that all virtual machines have up-to-date contact information and are receiving important updates from the ITS Private Cloud Portal.
Using VSS-CLI commands
For this example we will use the of test.user
To view a list of virtual machines with administrator information, enter the following command:
format:vss-cli --columns moref,name,folder.path,admin,inform compute vm ls -f admin=<EMAIL OR ID>example:
vss-cli --columns moref,name,folder.path,admin,inform compute vm ls -f admin=test.useroutput:
moref name folder.path admin inform --------- --------------- ----------------------------- ----------------------------------------------- ------------------------ vm-552331 2206Z-BLA-Dev TEST > 123 > Services > Dev Test User 1:815-948-1399:test.user@utoronto.ca test.user.2@utoronto.ca vm-829984 2107Y-TEST123 TEST > 123 > Services > DEV Test User 1:815-948-1399:test.user@utoronto.ca test.user.2@utoronto.ca vm-449021 2206X-XYZ-Dev2 TEST > 123 > Services > Dev Test User 1:815-948-1399:test.user@utoronto.ca test.user.2@utoronto.caTo add additional contacts, provide the ID of the virtual machine you wish to edit. (moref column) vm-55231
format:
vss-cli compute vm set <Virtual_Machine_ID> inform <EMAIL>example:
vss-cli compute vm set vm-55231 inform test.user.5@utoronto.caoutput:
id : 41063 status : SUBMITTED task_id : dfefdd03-d5c4-4b73-8030-193315f8be38 message : Request has been accepted for processingVerify the changes have been successfully applied to the virtual machine.
format:vss-cli compute vm get <Virtual_Machine_ID> informexample:
vss-cli compute vm get vm-55231 informoutput:
inform : test.user.5@utoronto.caTo add additional contacts of other virtual machines, simply repeat the steps outlined above for each machine that requires an update. This will ensure that all virtual machines have up-to-date contact information and are receiving important updates from the ITS Private Cloud Portal.
Bulk Update – Add an Additional Contact to Multiple VMs
This procedure allows you to add an additional contact to all virtual machines that currently belong to a specific admin email. It works in two main steps:
Find all virtual machines that are associated with a given admin.
Loop through those virtual machines and add a new contact to each one.
This is useful when an admin changes roles, leaves the organization, or when you want to ensure another person is copied on all VM notifications.
How It Works
The script uses vss-cli together with Bash to automate the process.
Step 1 – Define the base command
VSS_CLI_CMD="vss-cli compute vm set"This stores the base command that will be used to modify virtual machine settings.
Step 2 – Get all VMs for a specific admin
VM_IDS=$(vss-cli --columns moref --table-format plain --no-headers compute vm ls -f admin=oldadmin@mutoronto.ca)
This command:
Lists all virtual machines.
Filters them by the current admin email (
oldadmin@mutoronto.ca).Outputs only the VM IDs (
moref), one per line.
The result is a list of VM identifiers that belong to that admin.
Step 3 – Define the new contact
ADDITIONAL_EMAIL="john.doe@example.com"This is the email address that will be added as an additional contact to each VM.
Step 4 – Loop through each VM and update it
while IFS= read -r VM_ID; do
[ -z "$VM_ID" ] && continue
echo "Add additional contact on VM $VM_ID..."
$VSS_CLI_CMD "$VM_ID" inform "$ADDITIONAL_EMAIL"
echo "Additional contact added on VM $VM_ID."
done <<< "$VM_IDS"This loop:
Reads each VM ID line by line.
Skips empty lines (for safety).
Runs the command to add the additional contact to that VM.
Prints progress messages so you can see what is being updated.
Summary
In simple terms, this script:
Finds all VMs owned by a specific admin.
Takes each VM one by one.
Adds a new contact email to each VM automatically.
This avoids having to update dozens of VMs manually and ensures consistent contact information across all resources.
Related articles
University of Toronto - Since 1827