Bases: cinder.volume.drivers.nfs.RemoteFsDriver
Gluster based cinder driver. Creates file on Gluster share for using it as block device on hypervisor.
Just to override parent behavior.
Copy the volume to the specified image.
Creates a clone of the specified volume.
Exports the volume.
Create a snapshot.
If volume is attached, call to Nova to create snapshot, providing a qcow2 file. Otherwise, create locally with qemu-img.
A file named volume-<uuid>.info is stored with the volume data and is a JSON table which contains a mapping between Cinder snapshot UUIDs and filenames, as these associations will change as snapshots are deleted.
Basic snapshot operation:
volume-1234
volume-1234 <- volume-1234.aaaa
volume-1234.aaaa becomes the new “active” disk image. If the volume is not attached, this filename will be used to attach the volume to a VM at volume-attach time. If the volume is attached, the VM will switch to this file as part of the snapshot process.
Note that volume-1234.aaaa represents changes after snapshot ‘aaaa’ was created. So the data for snapshot ‘aaaa’ is actually in the backing file(s) of volume-1234.aaaa.
This file has a qcow2 header recording the fact that volume-1234 is its backing file. Delta changes since the snapshot was created are stored in this file, and the backing file (volume-1234) does not change.
‘aaaa’: ‘volume-1234.aaaa’ }
volume-1234 <- volume-1234.aaaa <- volume-1234.bbbb
volume-1234.bbbb now becomes the “active” disk image, recording changes made to the volume.
‘aaaa’: ‘volume-1234.aaaa’, ‘bbbb’: ‘volume-1234.bbbb’ }
volume-1234 <- volume-1234.aaaa(* now with bbbb’s data)
volume-1234.aaaa is removed (logically) from the snapshot chain. The data from volume-1234.bbbb is merged into it.
“removed” aaaa’s snapshot point but the .aaaa file now represents snapshot with id “bbbb”.
‘bbbb’: ‘volume-1234.aaaa’ (* changed!)
}
volume-1234
volume-1234.bbbb is removed from the snapshot chain, as above. The base image, volume-1234, becomes the active image for this volume again. If in-use, the VM begins using the volume-1234.bbbb file immediately as part of the snapshot delete process.
info file: { ‘active’: ‘volume-1234’ }
For the above operations, Cinder handles manipulation of qcow2 files when the volume is detached. When attached, Cinder creates and deletes qcow2 files, but Nova is responsible for transitioning the VM between them and handling live transfers of data between files as required.
Creates a volume.
Creates a volume from a snapshot.
Snapshot must not be the active snapshot. (offline)
Delete a snapshot.
If volume status is ‘available’, delete snapshot here in Cinder using qemu-img.
If volume status is ‘in-use’, calculate what qcow2 files need to merge, and call to Nova to perform this operation.
Deletes a logical volume.
Any initialization the volume driver does while starting.
Synchronously recreates an export for a logical volume.
Returns filename of the active image from the info file.
Allow connection to connector and return connection info.
Removes an export for a logical volume.
Disallow connection from connector.