Take a snapshot to capture a volume’s data at one point in time. Protect it when you want to create volumes or images from it. You don’t have to detach a volume to snapshot it.
Before you begin
- The volume’s URN.
- Permission
pvs.snapshot.createon the volume, andpvs.snapshot.protecton the snapshot. See Roles. - A volume that reports
AVAILABLEorINUSE. A volume inCREATINGis refused, not queued; wait forAVAILABLE. A volume inDELETING,DELETED, orERRORhas nothing left to copy. - An active organization and a billing account that can pay. See Add a payment method.
- Room in your snapshot quota. See Limits.
Create the snapshot
-
If the volume is attached to a running instance, quiesce the filesystem inside the guest when you need more than crash consistency. The snapshot is taken while the instance runs and captures the disk as a sudden power-off would.
-
Create the snapshot.
Terminal window origin storage create-snapshot --volume-urn <volume-urn>With the API, use the
createSnapshotmutation:mutation {pvs {createSnapshot(input: { volumeUrn: "<volume-urn>" }) {urnstatus}}}The snapshot reports
PENDING. Note itsurn. -
Check the snapshot until it reports
status: COMPLETED.Terminal window origin storage get-snapshot --snapshot-urn <snapshot-urn>If it reports
ERROR, the copy failed. Delete it and take a new one.
Protect the snapshot
Protect the snapshot only after it reports COMPLETED. A protect request for a PENDING snapshot is refused, not queued.
-
Protect the snapshot.
Terminal window origin storage protect-snapshot --snapshot-urn <snapshot-urn>With the API, use the
protectSnapshotmutation:mutation {pvs {protectSnapshot(input: { snapshotUrn: "<snapshot-urn>" }) {acceptedmessage}}} -
Check the snapshot until it reports
protectionStatus: PROTECTED.Terminal window origin storage get-snapshot --snapshot-urn <snapshot-urn>If it reports
FAILED, the protection state is unknown. Protect it again. See Snapshot states.
The snapshot is now a clone source: status: COMPLETED and protectionStatus: PROTECTED.