Manage Logical Folders

Logical Folders are containers for storing and organizing inventory objects, in this case virtual machines. Just like networks, a Folder has a Managed Object Reference (moref) which is required for either virtual machine deployment (where a virtual machine will be placed upon creation) or updating virtual machine containing folder (move).

The vss-cli compute folder command lists, create and obtain information regarding a specific folder you have permission on.

Usage: vss-cli compute folder [OPTIONS] COMMAND [ARGS]... Logical Folders are containers for storing and organizing inventory objects, in this case virtual machines. Options: --help Show this message and exit. Commands: get Given folder info. ls list folders mk create folder rm remove folder set update folder

List

Run vss-cli compute folder to list available logical folders. Filter list by name using the option --filter-by/-f which is structured <field_name>=<operator>,<value> and available operators are eq, ne, lt, le, gt, ge, like, in as follows:

vss-cli compute folder ls -f name=ut moref name parent.name path ----------- ---------------- ----------- ---------------------------------------------- group-v8900 ut20170135153548 Testing VSS > Development > Testing > ut20170135153548 group-v8923 ut20170621092129 Testing VSS > Development > Testing > ut20170621092129

Info

Folder info, such as name, parent and path, children folders and stored virtual machines are available via vss-cli compute folder get <name-path-or-moref> command.

vss-cli compute folder get group-v8900 moref : group-v905 name : ut20170135153548 path : Development > Testing > ut20170135153548 parent.name : Testing parent.moref : group-v8900 has_children : False

Create

To create a new folder just run vss-cli compute folder mk <name> --parent <name-path-moref>, for instance:

Check the state of the request made by running vss-cli request folder ls -s created_on desc -c 1 or vss-cli request folder get <id>.

Or you can submit multiple folder creation for a given folder, for instance:

Update

Moving and renaming folders are command enclosed in the vss-cli compute folder set group.

Rename

Run vss-cli compute folder set <name-path-moref> name <new_name> to rename a folder. For example, the following command renames a given moref to Prd:

Check the state of the request made by running vss-cli request folder ls -s created_on desc -c 1 or vss-cli request folder get <id>.

Move

To move folders run vss-cli compute folder set <name-path-moref> parent <parent-name-path-moref> where the first name-path-moref is the folder required to move and the parent-name-path-moref is the target folder to move to.

Check the state of the request made by running vss-cli request folder ls -s created_on desc -c 1 or vss-cli request folder get <id>.

Remove

To remove a new folder just run vss-cli compute folder rm <name-path-moref> ..., for instance:

Folder must be empty or request will not be accepted.

To delete multiple folders and wait for requests to complete, execute the following command:

Check the state of the request made by running vss-cli request folder ls -s created_on desc -c 1 or vss-cli request folder get <id>.

University of Toronto - Since 1827