Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

If you do not have a virtual machine with operating system installed, please refer to Deploying a Development Environment.

Info

As a best practice and to speed up deployment, a small sized virtual machine is recommended (1vCPU, 1GB memory, 1NIC and 1x10GB disk). A virtual machine template should hold operating system installation and configuration and resulting virtual machines will be modified as required.

...

Code Block
languagebash
linenumbersfalse
Usage: vss-cli compute vm mk from-template [OPTIONS] [NAME]

  Deploy virtual machine from template.

Options:
  -s, --source TEXT               Source virtual machine or template MOREF or
                                  UUID.  [required]
  -d, --description TEXT          A brief description.  [required]
  -b, --client TEXT               Client department.
  -a, --admin TEXT                Admin name, phone number and email separated
                                  by `:` i.e. "John
                                  Doe:416-123-1234:john.doe@utoronto.ca"
  -r, --inform TEXT               Informational contact emails in comma
                                  separated
  -u, --usage [Test|Prod|Dev|QA]  Vm usage.
  -o, --os TEXT                   Guest operating system id.
  -m, --memory INTEGER            Memory in GB.
  -c, --cpu INTEGER               Cpu count.
  --cores-per-socket INTEGER      Cores per socket.
  -f, --folder TEXT               Logical folder moref name or path.
  --scsi TEXT                     SCSI Controller Spec <type>=<sharing>.
  -i, --disk TEXT                 Disk spec
                                  <capacity>=<backing_mode>=<backing_sharing>.
                                  optional: backing_mode, backing_sharing
  -n, --net TEXT                  Network adapter <moref-or-name>=<nic-type>.
  -t, --domain TEXT               Target fault domain name or moref.
  --notes TEXT                    Custom notes.
  -p, --custom-spec TEXT          Guest OS custom specification in JSON
                                  format.
  -e, --extra-config TEXT         Extra configuration key=value format.
  --power-on                      Power on after successful deployment.
  --template                      Mark the VM as template after deployment.
  --vss-service TEXT              VSS Service related to VM
  --instances INTEGER             Number of instances to deploy  [default: 1]
  -w, --firmware TEXT             Firmware type.
  --tpm                           Add Trusted Platform Module device.
  --storage-type TEXT             Storage type.
  --retire-type [timedelta|datetime]
                                  Retirement request type.
  --retire-warning INTEGER        Days before retirement date to notify
  --retire-value TEXT             Value for given retirement type. i.e.
                                  <hours>,<days>,<months>
  --help                          Show this message and exit.

Anchor
Network
Network
Anchor
DeployandreconfigureInstancefromTemplate-Network
DeployandreconfigureInstancefromTemplate-Network
Network

Run vss-cli compute net ls to list available network segments to your account. You must have at least VL-1584-VSS-PUBLIC which is the VSS public network.

...

Code Block
languagebash
linenumbersfalse
export NET=dvportgroup-11052=e1000e

Anchor
Folder
Folder
Anchor
DeployandreconfigureInstancefromTemplate-Folder
DeployandreconfigureInstancefromTemplate-Folder
Folder

Logical folders can be listed by running vss-cli compute folder ls. Select the target moref folder to store the virtual machine on:

...

The vss-cli compute vm mk from-template command provides the option -p/--custom-spec to pass the guest os customization spec, which is structured as follows:

Code Block
languagepythonjson
linenumbersfalse
{
  "hostname": "string",
  "domain": "string",
  "dns": [
    "string"
  ],
  "dns_suffix": [
    "string"
  ],
  "interfaces": [{"dhcp": "bool",
                  "ip": "string",
                  "mask": "string",
                  "gateway": ["string"]
                 }]
}

Since we are running on a DHCP-enabled network, we will just update the hostname and domain. The customization spec added will be:

Code Block
languagepythonjson
linenumbersfalse
{
  "hostname": "fe1",
  "domain": "eis.utoronto.ca",
  "interfaces": [{"dhcp": true}]
}

...

Info

Passing above JSON data structure to --custom-spec in Linux, macOS, or Unix and Windows PowerShell use the single quote ' to enclose it. On the Windows command prompt, use the double quote " to enclose the data structure and escape the double quotes from the data structure using the backslash \.

Anchor
Deployment
Deployment
Anchor
DeployandreconfigureInstancefromTemplate-Deployment
DeployandreconfigureInstancefromTemplate-Deployment
Deployment

At this point, we have all requirements to run vss-cli compute vm mk from-template command to submit a deployment request. For this example, the request is made for 2GB of memory, 2 vCPU, 2x40GB disks and to reconfigure the hostname and domain.

...