SimpliVity CLi  Set VM backup policy


Create a list of all VM where we want to set the backup policy.

$ svt-vm-show --datastore DS01
.----------------------------------------------------------------------------------------------------------------------.
| Virtual Machines for Datastore DS01                                                                                  |
+--------------+-------------+-----------+--------------------------------+-----------+------------+-------------------+
| Datacenter   | Cluster     | Datastore | Virtual Machine                | Policy    | Storage HA | Created At        |
+--------------+-------------+-----------+--------------------------------+-----------+------------+-------------------+
| SVT-Training | SVT-Cluster | DS01      | 01_Windows                     | Simple | Yes        | 2022-Dec-12 21:11 |
|              |             |           | 02_Windows                     | Simple | Yes        | 2022-Dec-12 21:14 |
|              |             |           | 03_Windows                     | Simple | Yes        | 2022-Dec-12 21:17 |
|              |             |           | 04_Windows                     | Simple | Yes        | 2022-Dec-12 21:20 |
|              |             |           | 05_Windows                     | Simple | Yes        | 2022-Dec-12 21:23 |
'--------------+-------------+-----------+--------------------------------+-----------+------------+-------------------'


Now cut the vm name from the list:

$ svt-vm-show --datastore DS01 | cut -f5 -d"|" |   grep -i win
 01_Windows
 02_Windows
 03_Windows
 04_Windows
 05_Windows
 
The VM name kist will be used to create a command line with xargs to set the backup policy.


$ svt-vm-show  --datastore DS01  | cut -f5 -d"|" |   grep -i win | xargs -n 1 svt-vm-policy-set   --datastore DS01 --policy "Fixed Default Backup Policy"   --vm
.-------------------------------------------------------------------------------.
| Policy Change Impact Report                                                   |
+------------------+----------------------+-------------------------------------+
| Metric           | Current System Level | Predicted System Level After Change |
+------------------+----------------------+-------------------------------------+
| Daily Backups    |                   0% |                                  0% |
| Retained Backups |                   0% |                                  0% |
'------------------+----------------------+-------------------------------------'
..
Task Complete
.-------------------------------------------------------------------------------.
| Policy Change Impact Report                                                   |
+------------------+----------------------+-------------------------------------+
| Metric           | Current System Level | Predicted System Level After Change |
+------------------+----------------------+-------------------------------------+
| Daily Backups    |                   0% |                                  0% |
| Retained Backups |                   0% |                                  0% |
'------------------+----------------------+-------------------------------------'
. . .

Let's prove the result.

$ svt-vm-show
.------------------------------------------------------------------------------------------------------------------------------------------.
| Virtual Machines                                                                                                                         |
+--------------+---------------+-----------+--------------------------------+-----------------------------+------------+-------------------+
| Datacenter   | Cluster       | Datastore | Virtual Machine                | Policy                      | Storage HA | Created At        |
+--------------+---------------+-----------+--------------------------------+-----------------------------+------------+-------------------+
| SVT-Training | SVT-Cluster   | DS01      | 01_Windows                     | Fixed Default Backup Policy | Yes        | 2022-Dec-12 21:11 |
|              |               |           | 02_Windows                     | Fixed Default Backup Policy | Yes        | 2022-Dec-12 21:14 |
|              |               |           | 03_Windows                     | Fixed Default Backup Policy | Yes        | 2022-Dec-12 21:17 |
|              |               |           | 04_Windows                     | Fixed Default Backup Policy | Yes        | 2022-Dec-12 21:20 |
|              |               |           | 05_Windows                     | Fixed Default Backup Policy | Yes        | 2022-Dec-12 21:23 |
'--------------+---------------+-----------+--------------------------------+-----------------------------+------------+-------------------'