lxd/storage_ceph_utils.go
func cephRBDVolumeMarkDeleted(clusterName string, poolName string,
	volumeType string, oldVolumeName string, newVolumeName string,
	userName string, suffix string) error {
	deletedName := fmt.Sprintf("%s/zombie_%s_%s", poolName, volumeType,
		newVolumeName)
	if suffix != "" {
		deletedName = fmt.Sprintf("%s_%s", deletedName, suffix)
	}
	_, err := shared.RunCommand(
		"rbd",
		"--id", userName,
		"--cluster", clusterName,
		"mv",
		fmt.Sprintf("%s/%s_%s", poolName, volumeType, oldVolumeName),
		deletedName)
	if err != nil {
		return err
	}

	return nil
}
func cephRBDVolumeMarkDeleted(clusterName string, poolName string,
	volumeType string, oldVolumeName string, newVolumeName string,
	userName string, suffix string) error {
	deletedName := fmt.Sprintf("%s/zombie_%s_%s", poolName, volumeType,
		newVolumeName)
	if suffix != "" {
		deletedName = fmt.Sprintf("%s_%s", deletedName, suffix)
	}
	_, err := shared.RunCommand(
		"rbd",
		"--id", userName,
		"--cluster", clusterName,
		"mv",
		fmt.Sprintf("%s/%s_%s", poolName, volumeType, oldVolumeName),
		deletedName)
	if err != nil {
		return err
	}

	return nil
}
func cephRBDVolumeMarkDeleted ( clusterName string , poolName string , volumeType string , oldVolumeName string , newVolumeName string , userName string , suffix string ) error { deletedName := fmt . Sprintf ( " " , poolName , volumeType , newVolumeName ) if suffix != " " { deletedName = fmt . Sprintf ( " " , deletedName , suffix ) } _ , err := shared . RunCommand ( " " , " " , userName , " " , clusterName , " " , fmt . Sprintf ( " " , poolName , volumeType , oldVolumeName ) , deletedName ) if err != nil { return err } return nil }
// cephRBDVolumeMarkDeleted marks an RBD storage volume as being in "zombie"
// state
// An RBD storage volume that is in zombie state is not tracked in LXD's
// database anymore but still needs to be kept around for the sake of any
// dependent storage entities in the storage pool. This usually happens when an
// RBD storage volume has protected snapshots; a scenario most common when
// creating a sparse copy of a container or when LXD updated an image and the
// image still has dependent container clones.
cephRBDVolumeMarkDeleted marks an RBD storage volume as being in zombie state An RBD storage volume that is in zombie state is not tracked in LXD s database anymore but still needs to be kept around for the sake of any dependent storage entities in the storage pool . This usually happens when an RBD storage volume has protected snapshots ; a scenario most common when creating a sparse copy of a container or when LXD updated an image and the image still has dependent container clones .