Every node provides CLI that can be used to manage configuration and invoke tasks on vPlus Node. All of the commands are executed using vprotect command. The general syntax is as shown below:
vprotect# usage: vprotect <COMMAND> -<ARG_1> ... -<ARG_N># COMMAND is one of the following:# node Node management# config Node configuration management# hv Hypervisor management# hvm Hypervisor manager management# hc Hypervisor cluster management# hs Hypervisor storage management# vm Virtual machine management# vmpolicy VM backup policy management# bd Backup destination management# sched Schedule management# brvm VM backup & restore# st Storage management# stpool Storage pool management# stprovider Storage provider management# brapp Application backup & restore# mnt Mounted backup management# task Task management# login User login# logout Node and user logout# stop Safely stops node# vm-snappolicy Snapshot policy management for VMs# storage-snappolicy Snapshot policy management for storages# app Application backup management# appconf App command execution management# apppolicy Application backup policy management# restorejob Restore jobs# recplan Recovery plan policies# brst Storage backup & restore# quota Quota management# project Project management# user User management# rbac Rbac management# role AppUser Role management# group AppUser Group management# status Shows node status# start Starts node
Starting and stopping node
To check if vPlus Node is running, run:
systemctlstatusvprotect-node
or
vprotectstatus
To start vPlus Node run:
systemctlstartvprotect-node
or
vprotectstart
To safely stop vPlus Node (this command waits for all tasks to be canceled, so that temporary objects are cleaned up) run:
systemctlstopvprotect-node
or
vprotectstop
In emergency cases you may need to kill the engine without task clean up - get PID of the node by running:
vprotectstatus
and kill process using:
kill<PID>
User login
To log in to CLI use the following command:
vprotectlogin-uUSER_NAME
where USER_NAME is your admin account in vPlus. You will be prompted for a password. From this moment you are able to execute commands.
Once you completed working with CLI, you can log out by running:
vprotectlogout-u
Note about GUIDs
All of the commands require GUID of the object that you want to refer to in the command. GUID is found in the first column of typical list command, e.g.:
Let's list VMs and get VM GUID:
vprotectvm-l <!-- GUID Name Hypervisor Present VM group Protected Last backup
------------------------------------ ----------------------------- ------------------- ------- ----------- --------- ----------------------
b2555a74-97bb-44e4-9c68-ed1ac2ddffcd Windows 7 (32-bit) xcp-ng.vplus.local true PM-T1_Group false 2020-06-03 00:30 (Tue) -->
Note. UUID is the ID used by the hypervisor or HV manager, while GUID is the ID used by vPlus to uniquely identify objects.
Node GUID can be replaced by this keyword to state that action such as restore or mount is going to be run on the node where the command is executed from. For instance, to restore or backup with given GUID on current node to /vprotect_data:
Similarly, backup destinations can be referred to by names. So a backup of some VM with given GUID to backup destination with name ISP can be done like this:
In general vprotect config -s <GUID> <PROPERTY_NO.> <VALUE> the command sets the value of a property with the given number of node configurations with GUID. Property numbers are returned in a detailed view of each node configuration. After you create node configuration, show default values with -g. Then use property numbers (the first number in the property/value line of the detailed view).
More backup destinations can be added by separating GUIDs with commas.
Backup destinations
The backup destination management module is used to add and remove a backup destination (a backup provider instance with retention settings). A backup destination must be assigned to a group for the scheduler to know where to put backups during automatic backup. For on-demand backup, you just need to specify which backup destination should be used.
Backup destinations are assigned to the node configuration. This means that nodes using such configuration are configured to store backups in the selected backup destinations.
Note. The backup task will fail if it is not able to assign a node because the given BD is not assigned to the node config of the node that is required to be used for the given hypervisor.
To manage backup destinations in the system used vprotect bd sub-command.
In general vprotect bd -s <GUID> <PROPERTY_NO.> <VALUE> command sets value of property with the given number of BD with GUID. Property numbers are returned in detailed view of each BD (fields obviously are different for each backup provider). After you create backup destination, show default values with -g. Then use property numbers (first number in the property/value line of the detailed view).
Retention time settings are interpreted in days (just give a number without any additional suffixes).
There are however some mode/type fields that require a string to be typed in the correct format:
Amazon S3 - Backup mode - must be either:
SINGLE_BUCKET - single bucket for all VMs
ONE_BUCKET_PER_VM - separate bucket for each VM (note that default limit is 100 buckets in Amazon S3)
Swift - Auth method - authentication method used to authenticate Swift BD:
To show details of the given HV manager (by GUID) - note that each BD has a different set of fields - numbers at the beginning of a line indicate an identifier of a field you want to set from CLI:
vprotectbd-g3263b196-056e-4485-9e8f-932798b58eb3<!--PropertyValue------------------------------------------------------------------------------------------------GUIDbb0524fe-40a1-4ca3-bbc9-7f0be8ac73ccNodeconfigs1TypeFILESYSTEMTotalavailablespace181GiBTotalusedspace9,1GiB1.Namebackup2.Pre-accessCMDexec.enabledfalse3.Pre-accessCMD []4.Post-accessCMDexec.enabledfalse5.Post-accessCMD []6.Defaultfalse7.Retention (full) - keep last N backups 48.Retention (full) - keep newer than 30d9.Retention (inc.) - keep last N backups 3010.Retention (inc.) - keep newer than 30d11.Paths [/backup]12.Deduplicationenabledfalse13.Deduplicationdevice-14.Deduplicatedfilesystemmountpoint (set as'default'touseBDpath) /backup15.Deduplicationvolumeusedspacethresholdpercentage-16.Encryptionenabled-->
Remember that to use a BD you need to create a new entry of a given type and then configure its properties (example for IBM Spectrum Protect [ISP], assume that GUID returned by the first command was bb74ef6c-f6de-4783-bfa7-70fc2376fb08 ):
vprotectbd-cMyTSMispvprotectbd-gbb74ef6c-f6de-4783-bfa7-70fc2376fb08<!--PropertyValue-----------------------------------------------------------------------------GUIDbb74ef6c-f6de-4783-bfa7-70fc2376fb08Nodeconfigs1TypeISPTotalavailablespace-Totalusedspace0B1.NameIBMSpectrumProtect2.Pre-accessCMDexec.enabledfalse3.Pre-accessCMD []4.Post-accessCMDexec.enabledfalse5.Post-accessCMD []6.Defaultfalse7.Retention (full) - keep last N backups 48.Retention (full) - keep newer than 30d9.Retention (inc.) - keep last N backups 3010.Retention (inc.) - keep newer than 30d11.dsm.optfilepath/opt/vprotect/dsm.opt12.Nodenamevprotect13.Nodepassword***14.TimezoneEurope/Sarajevo15.Backupprogressrefreshrate2016.Restoreprogressrefreshrate20-->
Hypervisor manager management module is used to add, remove hypervisor managers (currently only oVirt and RHV managers) and invoke indexing task. Indexing tasks gathers information about hypervisors and VMs running in the managed environment and updates their location if the VM has been moved to the different hypervisor.
To manage HV managers in the system usedvprotect hvm sub-command.
Note. If you're using RHV/oVirt/Oracle VM/Nutanix/Kubernetes then hypervisors will be detected automatically as a part of the index task. So there is no need to define every hypervisor manually as they will be detected automatically.
By default current node configuration is used for created HV manager - you may change it with this command (first HV GUID, then node configuration GUID):
Hypervisors connected to the HV manager will have node configuration of the HV manager assigned by default. For backup export always node configuration assigned to the HV is used.
Hypervisors
The Hypervisor management module is used to add, remove hypervisors and invoke indexing tasks. Indexing tasks gather information about VMs running on the hypervisor and update their location if the VM has been moved within the pool.
To manage hypervisors in the system used vprotect hv sub-command.
Note. If you're using RHV/oVirt/Oracle VM then hypervisors will be detected automatically as a part of the index task. So there is no need to define OVM hypervisors and for RHV/oVirt KVM hosts will be detected automatically.
By default current node configuration is used for created hypervisor - you may change it with this command (first HV GUID, then node configuration GUID):
Hypervisor clusters management module enables you to view and remove clusters detected on RHV/oVirt/Nutanix/OVM/XenServer environments.
To view or delete them use vprotect hc sub-command.
vprotecthc# Incorrect syntax: Missing required option: [-d Delete HV cluster, -l List HV clusters]# usage: hc -d <GUID> | -l# Hypervisor cluster management# -d,--delete <GUID> Delete HV cluster# -l,--list List HV clusters# -sn,--set-name <GUID> <NAME> Change Hypervisor Cluster name# -sp,--set-storage-provider <GUID> <STORAGE_PROVIDER_GUID>> Assign Storage Provider to Hypervisor Cluster. No value unassigns Storage Provider
Examples (Hypervisor clusters)
To list all detected clusters:
vprotecthc-l
To delete a cluster with GUID 107bc87a-9adf-4d6c-b732-345dd06c59e9:
vprotecthc-d107bc87a-9adf-4d6c-b732-345dd06c59e9
Hypervisor storage
Hypervisor storage management module enables you to view and remove storage detected on RHV/oVirt/Nutanix/OVM/XenServer environments. You can select storage in the restore dialog box for XenServer/Nutanix and RHV/oVirt (v4) platforms.
To view or delete them used vprotect hs sub-command.
To delete a storage volume with GUID 6b5aa45a-5436-47cd-82ce-1c4250742323:
vprotecths-d6b5aa45a-5436-47cd-82ce-1c4250742323
Virtual machines
The Virtual machine management module is used to provide information about VMs that has been detected on hypervisors, report the status of the last backup of your VMs (and all backups for a particular VM) and set priority for operations invoked on VM.
To manage VMs in the system used vprotect vm sub-command.
VMs are detected automatically during Index tasks executed on the HV or HV manager.
vprotectvm# Incorrect syntax: Missing required option: [-A Assign VM to the policy, -D List detected VM disks, -xC Set pre-snapshot CMD as semi-colon-separated string, i.e. "cmd;-a;-b", -wb Acknowledge warnings related to the backup, -L List backups of the VM, -xE Set pre-snapshot CMD exec enabled (1) / disabled (0), -rvS Revert snapshot, -cS Create VM snapshot, -se Set handling for pre-snap standard error. Values: DONT_IGNORE, IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING, -S List managed VM snapshots, -T List tasks related to the VM, -si Set pre-snap ignored command exit codes e.g. '15, 101-150' or '*', -gb Show backup details, -d Delete VM, -g Show virtual machine details, -XC Set post-snapshot CMD as semi-colon-separated string, i.e. "cmd;-a;-b", -l List VMs, -XE Set post-snapshot CMD exec enabled (1) / disabled (0), -sC Set SSH access credentials, -sE Set handling for post-snap standard error. Values: DONT_IGNORE, IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING, -sH Set SSH access host/port, -sI Set post-snap ignored command exit codes e.g. '15, 101-150' or '*', -w Acknowledge all backup warnings related to the VM, -sK Set SSH key path, -rmS Remove old snapshots, -eD Exclude disk from backup excluded (1) / included (0)]
# usage: vm -A <GUID> <VM_POLICY_GUID> | -cS <GUID> <RULE_GUID> <PRIORITY> | -D <GUID> | -d <GUID> | -eD <DISK_GUID> <0|1> | -g <<VM_GUID>> | -gb <BACKUP_GUID> | -L <GUID> | -l | -rmS <VM_GUID,...,VM_GUID> | -rvS <SNAPSHOT_GUID> | -S <GUID> | -sC <GUID> <SSH_USER> <SSH_PASS> | -se
# <GUID> <HANDLING> | -sE <GUID> <HANDLING> | -sH <GUID> <SSH_HOST> <SSH_PORT> | -si <GUID> <IGNORED_EXIT_CODES> | -sI <GUID> <IGNORED_EXIT_CODES> | -sK <GUID> <SSH_KEYPATH> | -T <GUID> | -w <GUID> | -wb <BACKUP_GUID> | -xC <GUID> <CMD_STRING> | -XC <GUID> <CMD_STRING> | -xE
# <GUID> <0|1> | -XE <GUID> <0|1># Virtual machine management# -A,--assign-vm-policy <GUID> <VM_POLICY_GUID> Assign VM to the policy# -cS,--create-snapshot <GUID> <RULE_GUID> <PRIORITY> Create VM snapshot# -D,--list-disks <GUID> List detected VM disks# -d,--delete <GUID> Delete VM# -eD,--exclude-disk <DISK_GUID> <0|1> Exclude disk from backup excluded (1) / included (0)# -dnp,--delete-non-present <[PROJECT_UUID]> Delete non-present Virtual Machines. Project UUID is optional
# -g,--details <<VM_GUID>> Show virtual machine details# -gb,--show-backup-details <BACKUP_GUID> Show backup details# -L,--list-backups <GUID> List backups of the VM# -l,--list List VMs# -rmS,--remove-snapshot <VM_GUID,...,VM_GUID> Remove old snapshots# -rvS,--revert-snapshot <SNAPSHOT_GUID> Revert snapshot# -S,--list-snapshots <GUID> List managed VM snapshots# -sC,--set-ssh-credentials <GUID> <SSH_USER> <SSH_PASS> Set SSH access credentials# -se,--set-pre-std-error-out <GUID> <HANDLING> Set handling for pre-snap standard error. Values: DONT_IGNORE, IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING
# -sE,--set-post-std-error-out <GUID> <HANDLING> Set handling for post-snap standard error. Values: DONT_IGNORE, IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING
# -sH,--set-ssh-host <GUID> <SSH_HOST> <SSH_PORT> Set SSH access host/port# -si,--set-pre-ignored-codes <GUID> <IGNORED_EXIT_CODES> Set pre-snap ignored command exit codes e.g. '15, 101-150' or '*'
# -sI,--set-post-ignored-codes <GUID> <IGNORED_EXIT_CODES> Set post-snap ignored command exit codes e.g. '15, 101-150' or '*'
# -sK,--set-ssh-key-path <GUID> <SSH_KEYPATH> Set SSH key path# -T,--list-tasks <GUID> List tasks related to the VM# -w,--ack-all-backup-warnings <GUID> Acknowledge all backup warnings related to the VM# -wb,--ack-backup-warnings <BACKUP_GUID> Acknowledge warnings related to the backup# -xC,--set-pre-snap-cmd <GUID> <CMD_STRING> Set pre-snapshot CMD as semi-colon-separated string, i.e. "cmd;-a;-b"
# -XC,--set-post-snap-cmd <GUID> <CMD_STRING> Set post-snapshot CMD as semi-colon-separated string, i.e. "cmd;-a;-b"
# -xE,--set-pre-snap-cmd-exec-enabled <GUID> <0|1> Set pre-snapshot CMD exec enabled (1) / disabled (0)# -XE,--set-post-snap-cmd-exec-enabled <GUID> <0|1> Set post-snapshot CMD exec enabled (1) / disabled (0)
Examples (Virtual machines)
To list all VMs
vprotect vm -l
To show details of the given VM (by GUID)
vprotect vm -g 0f36f40c-6427-4035-9f2b-1ead6aca3597
To add VM (first GUID) to the given policy (second GUID):
vprotect vm -A 0f36f40c-6427-4035-9f2b-1ead6aca3597 3afcd507-a4f5-484d-8d34-53c73d7a5809
To show backup history of a VM with given GUID:
vprotect vm -L 0f36f40c-6427-4035-9f2b-1ead6aca3597
To create snapshot of a VM with given GUID (VM must have snapshot policy already assigned):
vprotect vm -cS 0f36f40c-6427-4035-9f2b-1ead6aca3597
Storage backup management
This module is responsible for managing storage instances and actions related to backups/schedules/policies etc.
vprotect st
# Incorrect syntax: Missing required option:
# [-A Assign Storage to the policy, -a Assign Storage to the snapshot policy,
# -d Delete Storage, -g Show Storage details, -wb Acknowledge warnings related
# to the backup, -xC Set pre-snapshot CMD as semi-colon-separated string,
# i.e. "cmd;-a;-b", -XC Set post-snapshot CMD as semi-colon-separated string,
# i.e. "cmd;-a;-b", -l List Storages, -L List backups of the Storage,
# -sC Set SSH access credentials, -se Set handling for pre-snap standard error.
# Values: DONT_IGNORE, IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING,
# -sE Set handling for post-snap standard error. Values: DONT_IGNORE,
# IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING, -s Modify Storage configuration,
# -T List tasks related to the Storage, -w Acknowledge all backup warnings
# related to the Storage, -gb Show backup details]
# usage: st -A <GUID> <STORAGE_POLICY_GUID> | -a <GUID> <SNAPSHOT_POLICY_GUID> |
# -d <GUID> | -g <GUID> | -gb <BACKUP_GUID> | -l | -L <GUID> |
# -s <GUID> <PROPERTY_NO.> <VALUE> | -sC <GUID> <SSH_USER> <SSH_PASS> |
# -se <GUID> <HANDLING> | -sE <GUID> <HANDLING> |-T <GUID> | -w <GUID> |
# -wb <BACKUP_GUID> | -xC <GUID> <CMD_STRING> | -XC <GUID> <CMD_STRING>
# Storage management
# -A,--assign-storage-policy <GUID> <STORAGE_POLICY_GUID>
# #Assign Storage to the policy
# -a,--assign-snapshot-policy <GUID> <SNAPSHOT_POLICY_GUID>
# #Assign Storage to the snapshot policy
# -d,--delete <GUID>
# #Delete Storage
# -g,--details <GUID>
# #Show Storage details
# -gb,--show-backup-details <BACKUP_GUID>
# #Show backup details
# -l,--list
# #List Storages
# -L,--list-backups <GUID>
# #List backups of the Storage
# -s,--configuration <GUID> <PROPERTY_NO.> <VALUE>
# #Modify Storage configuration
# -sC,--set-ssh-credentials <GUID> <SSH_USER> <SSH_PASS>
# #Set SSH access credentials
# -se,--set-pre-std-error-out <GUID> <HANDLING>
# #Set handling for pre-snap standard error. Values: DONT_IGNORE,
# #IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING
# -sE,--set-post-std-error-out <GUID> <HANDLING>
# #Set handling for post-snap standard error. Values: DONT_IGNORE,
# #IGNORE_WITH_WARNING, IGNORE_WITHOUT_WARNING
# -T,--list-tasks <GUID>
# #List tasks related to the Storage
# -w,--ack-all-backup-warnings <GUID>
# #Acknowledge all backup warnings related to the Storage
# -wb,--ack-backup-warnings <BACKUP_GUID>
# #Acknowledge warnings related to the backup
# -xC,--set-pre-snap-cmd <GUID> <CMD_STRING>
# #Set pre-snapshot CMD as semi-colon-separated string, i.e. "cmd;-a;-b"
# -XC,--set-post-snap-cmd <GUID> <CMD_STRING>
# #Set post-snapshot CMD as semi-colon-separated string, i.e. "cmd;-a;-b"
Examples (Storage backup management)
Storage pool management
This small module allows us to list and deleting inventoried storage pools.
vprotect stpool
# Incorrect syntax: Missing required option: [-d Delete Storage Pool,
# -l List Storage Pools]
# usage: stpool -d <GUID> | -l
# Storage pool management
# -d,--delete <GUID> Delete Storage Pool
# -l,--list List Storage Pools
This module is responsible for managing the storage provider's infrastructure. So performing tasks such as adding/removing / inventorying, etc.
vprotect stprovider
# Incorrect syntax: Missing required option: [-sC Modify Storage Provider configuration, -c Create Storage Provider, -s Synchronize inventory with Storage Provider, -d Delete Storage Provider, -u Set user/password, -nC Set node config for Storage Provider, -g Show Storage Providers details, -h Set host for Storage Provider, -l List Storage Providers, -L List Storages for Storage Provider, -n Set node for Storage Provider]
# usage: stprovider -c <HOST> <TYPE> | -d <GUID> | -g <GUID> | -h <GUID> <HOST> | -l | -L <GUID> | -n <GUID> <NODE_GUID> | -nC <GUID> <NODE_CONFIG_GUID> | -s <GUID> | -sC <GUID> <PROPERTY_NO.> <VALUE> | -u <GUID> <USER> <PASSWORD>
# +Storage provider management
# -c,--create <HOST> <TYPE> Create Storage Provider
# -d,--delete <GUID> Delete Storage Provider
# -g,--details <GUID> Show Storage Providers details
# -h,--set-host <GUID> <HOST> Set host for Storage Provider
# -l,--list List Storage Providers
# -L,--list-storages <GUID> List Storages for Storage Provider
# -n,--set-node <GUID> <NODE_GUID> Set node for Storage Provider
# -nC,--set-node-config <GUID> <NODE_CONFIG_GUID> Set node config for Storage Provider
# -s,--sync <GUID> Synchronize inventory with Storage Provider
# -sC,--configuration <GUID> <PROPERTY_NO.> <VALUE> Modify Storage Provider configuration
# -u,--credentials <GUID> <USER> <PASSWORD> Set user/password
Examples (Storage providers management)
VM backup policies
Virtual machine backup policies management module is used to define backup policies of VMs. You can assign different backup priorities for a policy when the scheduler invokes a backup task. You need first to define a VM policy and then add VMs to it. VM can belong only to a single backup policy.
To manage VM policies in the system use vprotect vmpolicy sub-command.
VMs are assigned automatically to the policy only if VM has no policy assigned already. If an automatic assignment has been turned on for a policy and either name of the VM matches the regular expression, or tag-detected (Citrix/oVirt/RHV/Oracle VM) matches tag defined for the policy, VM is assigned to the policy, and all schedules for a policy will also be automatically invoked for this VM.
Note. it is important to assign a backup destination for a policy (required for a node to know where to store backups).
vprotect vmpolicy
# Required option: [-rR Remove auto-assignment RE, -rT Remove auto-assignment tag, -aC Set auto-assignment HV clusters, -b Set backup destination for the VM policy, -c Create a new policy, -d Delete a policy, -g Show details, -l List policies, -L List VMs in the policy, -aM Set auto-assignment mode, -m Modify policy, -aN Set auto-removal of non-present VMs flag, -p Set policy's backup task priority (0-100, 50 = default), -aR Add auto-assignment RE, -aT Add auto-assignment tag, -S List schedules for the policy, -s Set schedules for the VM policy, -U Unassign VMs from the policy, -V Assign VMs to the policy]
# usage: vmpolicy -aC <GUID > <[HV_CLUSTER_GUID,...,HV_CLUSTER_GUID]> | -aM <GUID> <DISABLED|ASSIGN_ONLY|ASSIGN_AND_REMOVE> | -aN <GUID> <0|1> | -aR <GUID>
# <inc|exc> <REG_EXP> | -aT <GUID> <inc|exc> <TAG> | -b <GUID> <BD_GUID | BD_NAME>> | -c <NAME> | -d <GUID> | -g <GUID> | -l | -L <GUID> | -m <GUID>
# <NAME> | -p <GUID> <PRIORITY> | -rR <GUID> <inc|exc> <REG_EXP> | -rT <GUID> <inc|exc> <TAG> | -S <GUID> | -s <GUID> <SCHED_GUID,...,SCHED_GUID> | -U
# <VM_GUID,...,VM_GUID> | -V <GUID> <VM_GUID,...,VM_GUID>
# VM backup policy management
# -aC,--set-auto-assign-hv-clusters <GUID > <[HV_CLUSTER_GUID,...,HV_CLUSTER_GUID]> Set auto-assignment HV clusters
# -aM,--set-auto-assign-mode <GUID> <DISABLED|ASSIGN_ONLY|ASSIGN_AND_REMOVE> Set auto-assignment mode
# -aN,--set-auto-remove-non-present <GUID> <0|1> Set auto-removal of non-present VMs flag
# -aR,--add-auto-assign-re <GUID> <inc|exc> <REG_EXP> Add auto-assignment RE
# -aT,--add-auto-assign-tag <GUID> <inc|exc> <TAG> Add auto-assignment tag
# -b,--set-backup-destination <GUID> <BD_GUID | BD_NAME>> Set backup destination for the VM policy
# -c,--create <NAME> Create a new policy
# -d,--delete <GUID> Delete a policy
# -g,--details <GUID> Show details
# -l,--list List policies
# -L,--list-vms <GUID> List VMs in the policy
# -m,--modify <GUID> <NAME> Modify policy
# -p,--set-priority <GUID> <PRIORITY> Set policy's backup task priority (0-100, 50 = default)
# -rR,--remove-auto-assign-re <GUID> <inc|exc> <REG_EXP> Remove auto-assignment RE
# -rT,--remove-auto-assign-tag <GUID> <inc|exc> <TAG> Remove auto-assignment tag
# -S,--list-schedules <GUID> List schedules for the policy
# -s,--set-schedules <GUID> <SCHED_GUID,...,SCHED_GUID> Set schedules for the VM policy
# -U,--unassign-vms <VM_GUID,...,VM_GUID> Unassign VMs from the policy
# -V,--assign-vms <GUID> <VM_GUID,...,VM_GUID> Assign VMs to the policy
The snapshot management policies module enables CDM for your VMs and manages their retention. Currently, it is supported for KVM, Citrix, RHV/oVirt/OLVM platforms.
To manage snapshot policies for VMs in the system use vprotect vm-snappolicy sub-command.
VMs are assigned automatically to the policy only if VM has no policy assigned already. If an automatic assignment has been turned on for a policy and either name of the VM matches a regular expression, or tag-detected (Citrix/RHV/oVirt/OLVM) matches tag defined for the policy, VM is assigned to the policy, and all schedules for a policy will also be automatically invoked for this VM.
Note. Only VMs with assigned snapshot management policy can be a snapshot from the CLI or UI.
vprotect vm-snappolicy
# Required option: [-rR Remove rules from policy, -rT Remove auto-assignment tag, -aC Set auto-assignment HV clusters, -c Create a new policy, -d Delete a policy, -g Show details, -l List policies, -L List VMs in the policy, -aM Set auto-assignment mode, -m Modify policy, -aN Set auto-removal of non-present VMs flag, -p Set policy's backup task priority (0-100, 50 = default), -aR Add new rule to selected policy, -r List rules for policy, -aT Add auto-assignment tag, -U Unassign VMs from the policy, -V Assign VMs to the policy]
# usage: vm-snappolicy -aC <GUID > <[HV_CLUSTER_GUID,...,HV_CLUSTER_GUID]> | -aM <GUID> <DISABLED|ASSIGN_ONLY|ASSIGN_AND_REMOVE> | -aN <GUID> <0|1> | -aR <NAME>
# <POLICY_GUID> <RETENTION_DAYS> <RETENTION_VERSIONS> | -aT <GUID> <inc|exc> <TAG> | -c <NAME> | -d <GUID> | -g <GUID> | -l | -L <GUID> | -m <GUID>
# <NAME> | -p <GUID> <PRIORITY> | -r <GUID> | -rR <POLICY_GUID> <RULE_GUID,...,RULE_GUID> | -rT <GUID> <inc|exc> <TAG> | -U <VM_GUID,...,VM_GUID> | -V
# <GUID> <VM_GUID,...,VM_GUID>
# Snapshot policy management
# -aC,--set-auto-assign-hv-clusters <GUID > <[HV_CLUSTER_GUID,...,HV_CLUSTER_GUID]> Set auto-assignment HV clusters
# -aM,--set-auto-assign-mode <GUID> <DISABLED|ASSIGN_ONLY|ASSIGN_AND_REMOVE> Set auto-assignment mode
# -aN,--set-auto-remove-non-present <GUID> <0|1> Set auto-removal of non-present VMs flag
# -aR,--add-rule <NAME> <POLICY_GUID> <RETENTION_DAYS> <RETENTION_VERSIONS> Add new rule to selected policy
# -aT,--add-auto-assign-tag <GUID> <inc|exc> <TAG> Add auto-assignment tag
# -c,--create <NAME> Create a new policy
# -d,--delete <GUID> Delete a policy
# -g,--details <GUID> Show details
# -l,--list List policies
# -L,--list-vms <GUID> List VMs in the policy
# -m,--modify <GUID> <NAME> Modify policy
# -p,--set-priority <GUID> <PRIORITY> Set policy's backup task priority (0-100, 50 = default)
# -r,--list-rules <GUID> List rules for policy
# -rR,--remove-rules <POLICY_GUID> <RULE_GUID,...,RULE_GUID> Remove rules from policy
# -rT,--remove-auto-assign-tag <GUID> <inc|exc> <TAG> Remove auto-assignment tag
# -U,--unassign-vms <VM_GUID,...,VM_GUID> Unassign VMs from the policy
# -V,--assign-vms <GUID> <VM_GUID,...,VM_GUID> Assign VMs to the policy
To manage snapshot policies for storage in the system used vprotect storage-snappolicy sub-command.
Storages are assigned automatically to the policy only if storage has no policy assigned already. If an automatic assignment has been turned on for a policy and the name of the storage matches the regular expression, storage is assigned to the policy, and all schedules for a policy will also be automatically invoked for this storage.
Note. only storage with an assigned snapshot management policy can be a snapshot from the CLI or UI.
vprotect storage-snappolicy
# Incorrect syntax: Missing required option: [-rR Remove rules from policy, -c Create a new policy, -d Delete a policy, -g Show details, -l List policies, -aM Set auto-assignment mode, -L List storages in the policy, -m Modify policy, -aN Set auto-removal of non-present VMs flag, -aP Set auto-assignment storage pools, -p Set policy's backup task priority (0-100, 50 = default), -aR Add new rule to selected policy, -r List rules for policy, -S Assign storages to the policy, -U Unassign storages from the policy]
# usage: storage-snappolicy -aM <GUID> <DISABLED|ASSIGN_ONLY|ASSIGN_AND_REMOVE> | -aN <GUID> <0|1> | -aP <GUID > <[STORAGE_POOL_GUID,...,STORAGE_POOL_GUID]> | -aR <NAME> <POLICY_GUID> <RETENTION_DAYS> <RETENTION_VERSIONS> | -c <NAME> | -d <GUID> | -g <GUID> | -l | -L <GUID> | -m
# <GUID> <NAME> | -p <GUID> <PRIORITY> | -r <GUID> | -rR <POLICY_GUID> <RULE_GUID,...,RULE_GUID> | -S <GUID> <STORAGE_GUID,...,STORAGE_GUID> | -U <STORAGE_GUID,...,STORAGE_GUID>
# +Snapshot policy management for storages
# -aM,--set-auto-assign-mode <GUID> <DISABLED|ASSIGN_ONLY|ASSIGN_AND_REMOVE> Set auto-assignment mode
# -aN,--set-auto-remove-non-present <GUID> <0|1> Set auto-removal of non-present VMs flag
# -aP,--set-auto-assign-storage-pools <GUID > <[STORAGE_POOL_GUID,...,STORAGE_POOL_GUID]> Set auto-assignment storage pools
# -aR,--add-rule <NAME> <POLICY_GUID> <RETENTION_DAYS> <RETENTION_VERSIONS> Add new rule to selected policy
# -c,--create <NAME> Create a new policy
# -d,--delete <GUID> Delete a policy
# -g,--details <GUID> Show details
# -l,--list List policies
# -L,--list-storages <GUID> List storages in the policy
# -m,--modify <GUID> <NAME> Modify policy
# -p,--set-priority <GUID> <PRIORITY> Set policy's backup task priority (0-100, 50 = default)
# -r,--list-rules <GUID> List rules for policy
# -rR,--remove-rules <POLICY_GUID> <RULE_GUID,...,RULE_GUID> Remove rules from policy
# -S,--assign-storages <GUID> <STORAGE_GUID,...,STORAGE_GUID> Assign storages to the policy
# -U,--unassign-storages <STORAGE_GUID,...,STORAGE_GUID> Unassign storages from the policy
Examples (Snapshot management policies for storage)
To list all snapshot policies
vprotect storage-snappolicy -l
To show details of the given snapshot policy (by GUID)
The schedule management module is used to create schedules associated with VMs or groups of VMs. Each schedule defines the days of a week and the hour when the backup tasks should be invoked. Each schedule also defines a time window in which the backup process must start. If the task queue is full and the tasks start after the specified amount of time from the schedule – it will be canceled and marked as failed.
Note.
Tasks in the queue are run in order from the highest to the lowest priority.
You can assign multiple schedules if you need backup to be executed at different hours on different days.
Remember always to assign schedules to VM or VM group – schedule can be assigned only to a single VM or VM group.
To manage schedules in the system used vprotect sched sub-command.
vprotect sched
# Incorrect syntax: Missing required option: [-a Set schedule to be active (1) / not active (0), -c <NAME> <VM_BACKUP | SNAPSHOT | APP_BACKUP> <BACKUP_TYPE> <TIME | INTERVAL> <START_TIME | INTERVAL_START_HOUR-INTERVAL_END_HOUR> <DURATION | INTERVAL_FREQUENCY> <everyday | LIST_OF_DAYS_OF_WEEK> <any | FIRST_IN_MONTH | SECOND_IN_MONTH | THIRD_IN_MONTH | FOURTH_IN_MONTH | LAST_IN_MONTH> <any | LIST_OF_MONTHS
# Create schedule for VM (backup type: FULL / INCREMENTAL), -d Delete schedule, -g Show details, -l List schedules, -m <GUID> <NAME> <TYPE> <TIME | INTERVAL> <START_TIME | INTERVAL_START_HOUR-INTERVAL_END_HOUR> <DURATION | INTERVAL_FREQUENCY> <everyday | LIST_OF_DAYS_OF_WEEK> <any | FIRST_IN_MONTH | SECOND_IN_MONTH | THIRD_IN_MONTH | FOURTH_IN_MONTH | LAST_IN_MONTH> <any | LIST_OF_MONTHS
# Modify schedule (backup type: FULL / INCREMENTAL)]
# usage: sched -a <arg> | -c <arg> | -d <arg> | -g <arg> | -l | -m <arg>
# Schedule management
# -a,--set-active <GUID> <0|1> Set schedule to be active (1) / not active (0)
# -c,--create <NAME> <VM_BACKUP | SNAPSHOT | APP_BACKUP> <BACKUP_TYPE> <TIME | INTERVAL> <START_TIME | INTERVAL_START_HOUR-INTERVAL_END_HOUR> <DURATION |
# INTERVAL_FREQUENCY> <everyday | LIST_OF_DAYS_OF_WEEK> <any | FIRST_IN_MONTH | SECOND_IN_MONTH | THIRD_IN_MONTH | FOURTH_IN_MONTH | LAST_IN_MONTH> <any | LIST_OF_MONTHS>
# Create schedule for VM (backup type: FULL / INCREMENTAL)
# -d,--delete <GUID> Delete schedule
# -g,--show-details <GUID> Show details
# -l,--list List schedules
# -m,--modify <GUID> <NAME> <TYPE> <TIME | INTERVAL> <START_TIME | INTERVAL_START_HOUR-INTERVAL_END_HOUR> <DURATION | INTERVAL_FREQUENCY> <everyday |
# LIST_OF_DAYS_OF_WEEK> <any | FIRST_IN_MONTH | SECOND_IN_MONTH | THIRD_IN_MONTH | FOURTH_IN_MONTH | LAST_IN_MONTH> <any | LIST_OF_MONTHS>
# Modify schedule (backup type: FULL / INCREMENTAL)
Examples (Schedules)
To list all schedules
vprotect sched -l
To create a full virtual machine backup schedule with a name Schedule1 executed every day at 05:00 with 60 minutes of time window:
vprotect sched -c Schedule1 VM_BACKUP FULL TIME 05:00 60 everyday any any
To create an incremental virtual machine backup schedule with a name Schedule2 executed every Monday, Wednesday and Friday at 17:00 with 90 minutes of time window:
vprotect sched -c Schedule2 VM_BACKUP INCREMENTAL TIME 17:00 90 mon,wed,fri any any
Note. Days of the week are provided as a single comma-separated string of short (3-letter) weekday names
To disable a schedule with GUID 6651787d-9a55-421d-8158-ead80a70a9cb:
vprotect sched -a 6651787d-9a55-421d-8158-ead80a70a9cb 0
VM backup/restore
This module is used to manage the backup and restore processes. It is also used to list backups of a particular VM.
To invoke backup and restore tasks use vprotect brvm sub-command.
vprotect brvm
# Required option: [-b Backup (full), -B Backup (full) with task priority (0-100, 50 = default), -gL Show file details, -F List file systems, -H Restore the backup to the hypervisor. For KVM mixed volumes please provide storages in form of BF_GUID=STORAGE_ID with files separated by semicolon, i.e. "BF_GUID=STORAGE_ID; BF_GUID2=STORAGE_ID2 ...", -i Backup VM (incremental), -I Backup VM (incremental) with task priority (0-100, 50 = default), -l List backups, -L List backup files, -M Restore the backup to the hypervisor manager, -r Restore the backup, -T List tasks related to the backup, -gb Show backup details]
# usage: brvm -b <GUID> <BP_GUID | BP_NAME> | -B <GUID> <BP_GUID | BP_NAME> <PRIORITY> | -F <GUID> | -gb <BACKUP_GUID> | -gL <BACKUP_FILE_GUID> | -H <GUID>
# <HV_GUID | HV_HOST> <STORAGE_ID> | -i <VM_GUID> <BP_GUID | BP_NAME> | -I <VM_GUID> <BP_GUID | BP_NAME> <PRIORITY> | -l | -L <GUID> | -M <GUID>
# <HVM_GUID | HVM_HOST> <STORAGE_ID> <[CLUSTER_ID]> | -r <GUID> <NODE_GUID | NODE_NAME> <DIRECTORY> | -T <GUID>
# VM backup & restore
# -b,--backup <GUID> <BP_GUID | BP_NAME> Backup (full)
# -B,--backup-with-priority <GUID> <BP_GUID | BP_NAME> <PRIORITY> Backup (full) with task priority (0-100, 50 = default)
# -F,--list-file-systems <GUID> List file systems
# -gb,--show-backup-details <BACKUP_GUID> Show backup details
# -gsi,--show-backup-status-info <BACKUP_GUID> Show backup status info
# -gL,--show-files-details <BACKUP_FILE_GUID> Show file details
# -H,--restore-to-hv <GUID> <HV_GUID | HV_HOST> <STORAGE_ID> Restore the backup to the hypervisor. For KVM mixed volumes please provide
# storages in form of BF_GUID=STORAGE_ID with files separated by semicolon, i.e. "BF_GUID=STORAGE_ID; BF_GUID2=STORAGE_ID2 ..."
# -i,--backup-inc <VM_GUID> <BP_GUID | BP_NAME> Backup VM (incremental)
# -I,--backup-inc-with-priority <VM_GUID> <BP_GUID | BP_NAME> <PRIORITY> Backup VM (incremental) with task priority (0-100, 50 = default)
# -l,--list List backups
# -L,--list-files <GUID> List backup files
# -M,--restore-to-hvm <GUID> <HVM_GUID | HVM_HOST> <STORAGE_ID> <[CLUSTER_ID]> Restore the backup to the hypervisor manager
# -r,--restore <GUID> <NODE_GUID | NODE_NAME> <DIRECTORY> Restore the backup
# -T,--list-tasks <GUID> List tasks related to the backup
Examples (VM backup/restore)
To list all backups and their status:
vprotect brvm -l
To show backups of a particular VM:
vprotect vm -L 0f36f40c-6427-4035-9f2b-1ead6aca3597
The Mounted backup management module is used to mount and unmounts backups on the given node. This feature is currently supported for RHV/oVirt/OVM VMs. Each mounted backup can be mounted automatically (auto-detection of mount points within a single root or manually with separate mount points for each volume.
To invoke mount/unmount tasks use vprotect mnt sub-command.
vprotect mnt
# Incorrect syntax: Missing required option: [-T List tasks related to the mounted backup, -u Unmount previously mounted backup, -F List file systems, -l List mounted backups, -L List mounted files, -mi Mount iSCSI., -m Mount backup according to the MOUNT_SPECIFICATION, -Li List files for selected backup, that can be mounted using iSCSI mode.]
# usage: mnt -F <GUID> | -l | -L <GUID> | -Li <BACKUP_GUID> | -m <GUID> <NODE_CONFIG_GUID | NODE_CONFIG_NAME> <auto|manual> <MOUNT_SPECIFICATION> | -mi <BACKUP_GUID> <NODE_CONFIG_GUID | NODE_CONFIG_NAME> <ALLOWED_CLIENT,...,ALLOWED_CLIENT> <DISK_GUID,...,DISK_GUID> | -T <GUID> | -u <GUID>
# Mounted backup management
# -F,--list-file-systems <GUID> List file systems
# -l,--list List mounted backups
# -L,--list-files <GUID> List mounted files
# -Li,--list-iscsi-mountable-files <BACKUP_GUID> List files for selected backup, that can be mounted using iSCSI mode.
# -m,--mount <GUID> <NODE_CONFIG_GUID | NODE_CONFIG_NAME> <auto|manual> <MOUNT_SPECIFICATION> Mount backup according to the MOUNT_SPECIFICATION
# -mi,--mount-iscsi <BACKUP_GUID> <NODE_CONFIG_GUID | NODE_CONFIG_NAME> <ALLOWED_CLIENT,...,ALLOWED_CLIENT> <DISK_GUID,...,DISK_GUID> Mount iSCSI.
# -T,--list-tasks <GUID> List tasks related to the mounted backup
# -u,--unmount <GUID> Unmount previously mounted backup
Examples (Mounted backups)
To list all mounted backups:
vprotect mnt -l
To list all mounted files used by mounted backup with GUID 1ac068d3-4848-4c98-b30b-54ce050b6a95 (note that this is mounted backup GUID not a backup GUID):
To mount all file systems in backup with GUID 2132182d-e9ab-4478-a1db-48222b0e515b and node config with GUID 3a9d48dc-e48f-11eb-a1ce-005056a6b7e5 to /mnt/myVM/2017-01-01:
vprotect mnt -m 2132182d-e9ab-4478-a1db-48222b0e515b 3a9d48dc-e48f-11eb-a1ce-005056a6b7e5 auto /mnt/myVM/2017-01-01
To mount manually file systems in backup with GUID 2132182d-e9ab-4478-a1db-48222b0e515b with specifying mount points you need to provide semicolon-separated list where you provide name of the volume=mount point (white space before or after semicolon or equal sign is not allowed)
Note. Some tasks may need to be finished before they are cancelled, for example export VM from the hypervisor – after cancellation it may take some time for the task to process the cancel request and clean up the snapshots etc. If necessary, the backup will be marked as failed.
Project
The Project module is used to view details and set a quota for available projects.
vprotect project
# Incorrect syntax: Missing required option: [-g Show Project details, -l List Projects, -sQ Set Project Quota]
# usage: project -g <GUID> | -l | -sQ <GUID> <QUOTA_GUID>
# Project management
# -g,--details <GUID> Show Project details
# -l,--list List Projects
# -sQ,--set-quota <GUID> <QUOTA_GUID> Set Project Quota
Examples (Project)
To list all projects:
vprotect project -l
To set quota with GUID 6f0bfb3c-24dd-4d12-8a72-997ded2ecc98 to project with GUID ca707d31-f403-40d5-b160-6ac512457b87
The User module is used to manage users and their settings. You can add or remove users, change their password or timezone.
vprotect user
# Incorrect syntax: Missing required option: [-c Create user, -d Delete user, -g Show user details, -l List users, -m Update user's property, -sP Update user's password, -sA Update user's activation state]
# usage: user -c <LOGIN> <FIRST_NAME> <LAST_NAME> <TIMEZONE> <LANGUAGE> <ACTIVE> | -d <GUID> | -g <GUID> | -l | -m <GUID> <PROPERTY_NO.> <VALUE> | -sA <GUID> <ACTIVE> | -sP <GUID>>
# User management
# -c,--create <LOGIN> <FIRST_NAME> <LAST_NAME> <TIMEZONE> <LANGUAGE> <ACTIVE> Create user
# -d,--delete <GUID> Delete user
# -g,--details <GUID> Show user details
# -l,--list List users
# -m,--modify <GUID> <PROPERTY_NO.> <VALUE> Update user's property
# -sA,--set-active <GUID> <ACTIVE> Update user's activation state
# -sP,--set-password <GUID>>
Examples (User Management)
To create a new user
vprotect user -c jdoe John Doe UTC EN true
To list all users
vprotect user -l
GUID First Name Last Name Active
------------------------------------ ---------- --------- ------
1 The Admin true
259c07ab-5097-4826-8a91-dd281840faf5 John Doe true
To set password for the user
vprotect user -sP 705490c2-7734-4a56-a563-24471447bf2b
Quota
Quota management module is used to manage backup/restore limits for virtual machines in projects.
To manage Quotas in the system use vprotect quota sub-command.
vprotect quota
# Incorrect syntax: Missing required option: [-aR Add Rule to Quota, -c Create Quota, -d Delete Quota, -g Show Quota details, -sN Change Quota name, -l List Quotas, -L List Projects for Quota, -eR Edit Rule in Quota, -sA Change Quota active state, -dR Delete Rule from Quota]
# usage: quota -aR <GUID> <RULE_NAME> <TYPE> <ACTIVE> <HARD_LIMIT> <HARD_LIMIT_TIME_FRAME> <SOFT_LIMIT> <SOFT_LIMIT_TIME_FRAME> | -c <NAME> | -d <GUID> | -dR <GUID> <RULE_NAME> <TYPE> | -eR <GUID> <RULE_NAME> <TYPE> <ACTIVE>
# <HARD_LIMIT> <HARD_LIMIT_TIME_FRAME> <SOFT_LIMIT> <SOFT_LIMIT_TIME_FRAME> | -g <GUID> | -l | -L <GUID> | -sA <GUID> <ACTIVE> | -sN <GUID> <NAME>
# Quota management
# -aR,--add-rule <GUID> <RULE_NAME> <TYPE> <ACTIVE> <HARD_LIMIT> <HARD_LIMIT_TIME_FRAME> <SOFT_LIMIT> <SOFT_LIMIT_TIME_FRAME> Add Rule to Quota
# -c,--create <NAME> Create Quota
# -d,--delete <GUID> Delete Quota
# -dR,--delete-rule <GUID> <RULE_NAME> <TYPE> Delete Rule from Quota
# -eR,--edit-rule <GUID> <RULE_NAME> <TYPE> <ACTIVE> <HARD_LIMIT> <HARD_LIMIT_TIME_FRAME> <SOFT_LIMIT> <SOFT_LIMIT_TIME_FRAME> Edit Rule in Quota
# -g,--details <GUID> Show Quota details
# -l,--list List Quotas
# -L,--list-projects <GUID> List Projects for Quota
# -lR,--list-all-rules List all possible rule names
# -sA,--set-active <GUID> <ACTIVE> Change Quota active state
# -sN,--set-name <GUID> <NAME> Change Quota name