It’s five-o’clock on Friday and the database admin has just let you know they’re working on a problem and need to keep last week’s Friday afternoon snapshot until further notice. If you do nothing that backup will expire in about an hour due to the protection domain schedule. How can we make sure this snapshot sticks around?
Don’t worry! There‘s an NCLI command for this. You can change that snapshot’s expiration time to indefinite, and it will wait around until you delete it manually later.
See the solution in the KB article here: https://portal.nutanix.com/kb/8594
First, you need the snapshot ID and the protection domain name. You can get this from the Prism UI, or from NCLI.
To capture these details from Prism go to the Data Protection dashboard, Table view, Async DR tab, and select the protection domain from the table here. In the lower panel click on Local Snapshots and find the snapshot with the right Create Time. The number in the ID column is the snapshot ID you need, along with the protection domain name shown to the left.
To capture the snapshot ID from NCLI, SSH to a CVM and run this command:
nutanix@cvm:~$ ncli pd list-snapshots name=<protection_domain_name> | grep -A4 " Id "
The two spaces before and after “Id” in the grep statement allow us to ignore related VM ID’s while capturing the snapshot ID and creation/expiration time details for snapshots in this PD.
Now that we have the details together, we can save the snapshot for later with this command:
nutanix@cvm:~$ ncli pd retain-snap name=<protection_domain_name> id=<snapshot_id>
Now, the snapshot should hang around until you decide to delete it.