Snapshots and Clones
With snapshots and clones, you can leverage fast and thin point-in-time snapshots/clones of Lightbits volumes. A snapshot can be taken from a volume, and a volume can be created from a snapshot (aka a clone).
Snapshots cannot be exported as a volume; only clones of that snapshot can be accessed.
Snapshots and clones will be created on the same failure domain. There is no limit on the per-volume number of snaps and clones, and no limit on the per-failure domain number of snaps and clones.
For snapshot scheduling, create a snapshot of a volume in a predetermined schedule managed by the cluster (multiple schedulers can exist for the same volume).
With regards to Management APIs, snapshots are separate entities and clones are the same as volumes. Clones can be deleted by using the delete volume API. To delete a snapshot, you will need to call the delete snapshot API.
Plugins
OpenStack and Kubernetes are both supported and require compatible plugin versions. OpenStack and Kubernetes support must be updated to include snapshots and cloning. This applies to all plugin versions in production.
Rollback
The Rollback operation takes a volume and restores it back to a snapshot state (data + md). It is recommended to either remove active mounts, detach the volume, or flush caches before performing this operation.
The process should be as follows:
- Stop process/es that use the volume.
- Unmount FS create on top of the volume; e.g., for mount point /mnt/volumetorollback.
a. Unmount /mnt/volumetorollback.
- Perform rollback via lbcli.
- Mount the volume: mount /mnt/volumetorollback.
Snapshots and Clone Commands
List the existing volumes: lbcli -J $JWT list volumes:
$ lbcli --jwt $JWT list volumes --project-name <project name>Name UUID State Protection State NSID Size Replicas Compression ACL Rebuild Progressvol1 a7f67ad0-1f3d-49cb-9650-b82042378014 Available FullyProtected 1 4.0 GiB 1 true values:"acl1" NoneCreate a snapshot from the volume:
lbcli -J $JWT create snapshot --name=<sanpshot name> --project-name=<project name> --source-volume-name=<source volume name>$ lbcli create snapshot --name=vol1 --project-name=default --source-volume-name=vol1Name UUID Source volume UUID Statevol1 bd52d3d8-65a5-49fe-a934-b7d8b07ef040 a7f67ad0-1f3d-49cb-9650-b82042378014 CreatingCheck that the snapshot was created:
lbcli -J $JWT list snapshots --project-name=<project name>$ lbcli list snapshots --project-name=defaultName UUID Source volume UUID Statevol1 bd52d3d8-65a5-49fe-a934-b7d8b07ef040 a7f67ad0-1f3d-49cb-9650-b82042378014 AvailableGet snapshot info:
lbcli -J $JWT get snapshot --project-name=<project-name> --uuid=<snapshot uuid> -o json$ lbcli get snapshot --project-name=default --uuid=bd52d3d8-65a5-49fe-a934-b7d8b07ef040 -o json{ "state": "Available", "UUID": "bd52d3d8-65a5-49fe-a934-b7d8b07ef040", "name": "vol1", "description": "", "creationTime": "2021-03-05T23:11:30.445377399Z", "retentionTime": null, "sourceVolumeUUID": "a7f67ad0-1f3d-49cb-9650-b82042378014", "sourceVolumeName": "vol1", "replicaCount": 1, "nodeList": [ "40365551-f7e0-50b2-b415-ac238d150e16" ], "nsid": 1, "acl": null, "compression": true, "size": "4294967296", "IPAcl": null, "sectorSize": 4096, "statistics": { "physicalCapacity": "0", "physicalOwnedCapacity": "0", "physicalOwnedMemory": "0", "physicalMemory": "0", "userWritten": "0" }, "ETag": "3", "projectName": "default"}Create a volume from snapshot (clone):
lbcli -J $JWT create volume --project-name=<project name> --name=<clone name> --source-snapshot-uuid=<snapshot uuid> --acl=<acl> --size=<size> --compression=<true/false> --replica-count=<1-3>lbcli create volume --project-name=default --name=copy_vol1 --source-snapshot-uuid=bd52d3d8-65a5-49fe-a934-b7d8b07ef040 --acl=acl2 --size="4 Gib" --compression=true --replica-count=1Create a snapshot-policy:
lbcli create snapshots-policy -J $JWT --project-name=<project name> --name=<policy name> --volume-uuid=<volume uuid> --description="<description" --hours-in-cycle=<hours> --start-time=<time> --retention-time=<hours>$ lbcli create snapshots-policy --project-name=default --name=policy1 --volume-uuid=a7f67ad0-1f3d-49cb-9650-b82042378014 --description="my policy" --hours-in-cycle=2 --start-hour=22 --retention-time=4hName UUID Volume Name State Typepolicy1 3c03b2bf-e102-4c6c-8c6d-173224148f31 vol1 Creating HourlyList snapshot-policies:
lbcli list snapshots-policies -J $JWT --project-name=<project name> --volume-uuid=<volume uuid>$ lbcli list snapshots-policies --project-name=default --volume-uuid=a7f67ad0-1f3d-49cb-9650-b82042378014Name UUID Volume Name State Typepolicy1 3c03b2bf-e102-4c6c-8c6d-173224148f31 vol1 Active HourlyGet snapshot-policies:
lbcli get snapshots-policy -J $JWT --project-name=<project name> --volume-uuid=<volume uuid> -o json$ lbcli get snapshots-policy --project-name=default --uuid=3c03b2bf-e102-4c6c-8c6d-173224148f31 -o json{ "UUID": "3c03b2bf-e102-4c6c-8c6d-173224148f31", "name": "policy1", "resourceUUID": "a7f67ad0-1f3d-49cb-9650-b82042378014", "resourceName": "vol1", "projectName": "default", "schedulePolicy": { "snapshotSchedulePolicy": { "hourlySchedule": { "startTime": "2021-03-08T22:16:21Z", "hoursInCycle": 2 } }, "retentionTime": "14400s" }, "description": "my policy", "state": "Active"}Rollback volume:
lbcli rollback volume -J $JWT --project-name=<project-name> --uuid=<volume-uuid> --src-snapshot-uuid=<snapshot-uuid> $ lbcli rollback volume --project-name=default --src-snapshot-uuid=bd52d3d8-65a5-49fe-a934-b7d8b07ef040 --uuid=05f49718-4897-4ff5-adb9-5d7ccd6fc138Delete snapshots/snapshot-policy:
Snapshot: lbcli delete snapshot -J $JWT --project-name=<project-name> --uuid=<snapshot uuid>lbcli delete snapshot --project-name=default --uuid=bd52d3d8-65a5-49fe-a934-b7d8b07ef040Snapshot-policy: lbcli delete snapshot -J $JWT --project-name=<project-name> --uuid=<snapshot-policy uuid>lbcli delete snapshots-policy --project-name=default --uuid=3c03b2bf-e102-4c6c-8c6d-173224148f31