VSS Command Line Interface (vss-cli) v0.10.4🎉

VSS-CLI v0.10.4 is available for download via PyPI or GitLab. Latest version includes the following improvements and bug fixes:

This release blog post includes improvements from v0.10.1, v0.10.2, v0.10.3 and v0.10.4.

Improvements

compute vm set disk mk: scsi bus support (#387)

Commands:

  • compute vm set diks mk --disk

By default, the ITS Private Cloud API creates disks using the first SCSI controller and available slots in it. If a SCSI controller is full, a new controller will be created using our pre-defined settings based on operating systems.

There are cases when a virtual machine has more than one SCSI controller to ensure compatibility during the installation of the operating system and an additional using the VMware Paravirtual SCSI Controller to take advantage of the greater throughput and lower CPU utilization.

Assuming there is a virtual machine with the following SCSI controller layout:

vss-cli compute vm get vm-2551 controller scsi

label                bus_number  type
-----------------  ------------  -------------------------
SCSI controller 0             0  VirtualLsiLogicController
SCSI controller 1             1  ParaVirtualSCSIController

And there is a requirement to create a 100GB disk on SCSI controller 1 (Paravirtual), just include the scsi attribute with the bus_number as value in the --disk JSON payload as follows:

vss-cli compute vm set vm-2551 disk mk --disk '{"capacity_gb": 100, "scsi": 1}'

The previous command creates a disk in the next available slot of SCSI Controller 1.


compute vm mk from-image: --network-config improvements to handle cloud config network-config file. (#385)

compute vm mk from-image: --user-data improvements to handle cloud config user data file. (#383)

Commands:

  • compute vm mk from-image

Deploying Cloud images with pre-installed operating systems such as Ubuntu Cloud in the ITS Private Cloud has become simpler and more powerful. With a recent update in the ITS Private Cloud API, we have updated the Cloud-Init (NoCloud datasource) integration, which allows customizing the Cloud image upon first boot. To deploy a virtual machine and customize it with the VSS CLI, you just need the following files:

  • network-config.yaml: network configuration for the virtual machine.  For instance: 

    dhcp
    version: 2
    ethernets:
      ens192:
       dhcp4: true
    fixed ip
    version: 2
    ethernets:
      ens192:
         addresses: [192.168.0.125/24]
         gateway4: 192.168.0.1
         dhcp6: false
         nameservers:
           addresses:
             - 192.168.0.1
             - 128.100.100.128
           search:
             - dept.utoronto.ca
         dhcp4: false
         optional: true
  • cloud-init.yaml: contains the cloud-config descriptor where you can define users, disk layout, filesystem setup, mounts, files, commands, etc. For example:

    #cloud-config
    hostname: host.dept.utoronto.ca
    timezone: America/Toronto
    fqdn: host.dept.utoronto.ca
    
    disk_setup:
      /dev/sdb:
        table_type: 'mbr'
        layout: True
        overwrite: True
      /dev/sdc:
        table_type: 'mbr'
        layout: True
        overwrite: True
    
    fs_setup:
      - label: DATA
        device: /dev/sdb
        partition: 'auto'
        filesystem: ext4
      - label: DATANOSNAP
        device: /dev/sdc
        partition: 'auto'
        filesystem: ext4
    
    mounts:
      - [ /dev/sdb, /data, "auto", "defaults,nofail", "0", "0" ]
      - [ /dev/sdc, /data-nosnap, "auto", "defaults,nofail", "0", "0" ]
    
    # Add users to the system. 
    # Users are added after groups are added.
    users:
       - name: vss-admin
        gecos: VSS Admin
        sudo: ALL=(ALL) ALL
        groups: users, admin
        ssh_import_id: None
        lock_passwd: false
        shell: /bin/bash
        passwd: <password hash>
        ssh_authorized_keys:
          - <ssh pub key 1>
    	  - <ssh pub key 2>
      - name: nosshlogins
        ssh_redirect_user: true
    
    rsyslog:
      remotes:
        log_serv: "*.* @<ip-address>:514"
    
    write_files:
    - path: /etc/update-motd.d/10-motd-vss
      permissions: '0755'
      content: |
        #!/bin/bash
    
        INSTANCE_ID=`vmtoolsd --cmd "info-get guestinfo.ut.vss.instance.id"`
        INSTANCE_NAME=`vmtoolsd --cmd "info-get guestinfo.ut.vss.instance.name"`
        printf "\n"
        printf "  University of Toronto ITS Private Cloud Instance\n"
        printf "\n"
        printf "  Name:     $INSTANCE_NAME\n"
        printf "  ID:       $INSTANCE_ID\n"
    
    packages:
      - csh
      - ntp
      - git
      - tcsh
      - snmp
      - nginx
      - snmpd
      - unzip
      - httpie
    
    runcmd:
    - sudo cp /usr/share/doc/util-linux/examples/securetty /etc/securetty
    - chmod -x /etc/update-motd.d/50-motd-news
    - chmod -x /etc/update-motd.d/10-help-text
    - touch /etc/cloud/cloud-init.disabled

With the previous files just execute the following command to deploy a virtual machine:

vss-cli --wait compute vm mk from-image \
--memory 4 --cpu 1 \
--source ubuntu-20.04-focal-server-cloudimg-amd64.ova \
--disk 10 --disk 200 --disk 200=independent_persistent \
--description 'Application for a new dept.' \
--client EIS --os ubuntu64Guest --usage Prod \
--folder group-v4122 --net NET  \
--extra-config disk.EnableUUID=TRUE \
--network-config network-config.yaml \
--user-data cloud-init.yaml \
--power-on app-01


core: direct status messages and user-interaction prompts to stderr instead of stdout. (#379)

core: direct migrate from jsonpath-rw to jsonpath-ng. (#380)


Bug Fixes

compute vm mk from-image:  throws VssError (#378)


Upgrade

Remember, VSS-CLI documentation is now available in VSS-CLI and the full Change Log is available here. Upgrade or install VSS-CLI as follows:

# using vss-cli
vss-cli upgrade 

# upgrade with pip
pip install vss-cli --upgrade

# install
pip install vss-cli 


For more information, please refer to the official documentation site.

University of Toronto - Since 1827