Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To manage snapshots in EVE through a controller, a new configuration message SnapshotConfig is planned to be added:

Code Block
themeEmacsEclipse
// RollbackCmd - snapshot rollback command
message RollbackCmd {
	string snpshot_uuid = 1;
	string volume_uuid = 2;
	DeviceOpsCmd rollback = 3;
}

// SnapshotConfig describes a snapshot for a specific logical
// volume that must exist on the device. It has a required field
// volume_uuid for which it was created and UUID for snapshot name in ZFS.
message SnapshotConfig {
	// The real name of the snapshot in ZFS. It is the link between
	// the command and the response to the command. It is assumed
	// that the field will always be filled with a unique value
	// that the controller will generate.
	string uuid = 1;
	// Display name (User-friendly name). This name does not affect
	// the snapshot properties in ZFS in any way.
	// Can be filled on the controller side.
	// If a snapshot has already been created and this field has changed,
	// it can be assumed that the friendly name for this snapshot has
	// been renamed on the controller side.
	string display_name = 2;
	// Volume ID of the volume this snapshot belongs to. The field is
	// required for all messages. Must always be filled in on the
	// controller side before sending to create snapshot command.
	string volume_uuid = 3;
	// The command for the snapshot rollback operation.
	// It should also be taken that the rollback cmd
	// to snapshot k will implicitly automatically delete
	// all snapshots from k+1 to N, If the deletion of snapshots
	// from k+1 to N was not initiated by the controller before
	// the rollback cmd
	RollbackCmd rollback = 4;
}

...

The structure of the informational message ZInfoSnapshot will consist of the following fields:

Code Block
themeEmacsEclipse
// Snapshot states
enum ZSnapshotState {
	Z_SNAPSHOT_STATE_UNSPECIFIED = 0;
	// This state is used when a snapshot is in the process of being
	// created or an error occurred during the first attempt to create it.
	// (For example, the operation was delayed)
	Z_SNAPSHOT_STATE_CREATING = 1;
	// This state is used when the snapshot has been successfully created.
	Z_SNAPSHOT_STATE_CREATED = 2;
	// This state is used when the snapshot is pending deletion or
	// the first deletion attempt was not successful.
	Z_SNAPSHOT_STATE_DELETING = 3;
	// This state is used to send information to the controller about a
	// snapshot that was implicitly deleted after a rollback snapshot
	// or volume delete command.
	Z_SNAPSHOT_STATE_IMPLICITLY_DELETED = 4;
}

// ZInfoSnapshot - Information about snapshot in zfs for zvol
message ZInfoSnapshot {
	uint64 creation_time = 1; // In seconds
	string uuid = 2; // link a command and a response. Is the real name of the snapshot in ZFS
	string volume_uuid = 3; // Volume ID of the volume this snapshot belongs to.
	string display_name = 4; // Ex: "Tuesday" or creation time (User-friendly name)
	bool encryption = 5;
	ZSnapshotState current_state = 6; // Displays the current state of the snapshot
	string error_msg = 7; // Ops error
	uint32 rollback_cmd_counter = 8; // Counter for rollback cmd
	uint64 rollback_time_last_op = 9; // The time when the last rollback operation was performed for this snapshot
}

The structure of the message ZMetricSnapshot with metrics will consist of the following fields:

Code Block
themeEmacsEclipse
// Metrics for a snapshot
// When a snapshot is created, its disk space is initially shared between
// the snapshot and the file system, and possibly with previous snapshots.
// As the file system changes, disk space that was previously shared becomes
// unique to the snapshot, and thus is counted in the snapshot's used property.
// Additionally, deleting snapshots can increase the amount of disk space
// unique to (and thus used by) other snapshots.
message ZMetricSnapshot {
	// Snapshot UUID
	string uuid = 1;
	// User-friendly name on controller
	string display_name = 2;
	// Identifies the amount of space consumed by the dataset and all its
	// descendants. (in byte)
	uint64 used_space = 3;
	// Identifies the amount of data accessible by this snapshot, which might
	// or might not be shared with other datasets in the pool. When a snapshot or
	// clone is created, It initially references the same amount of space as the
	// file system or snapshot it was created from because
	// its contents are identical. (in byte)
	uint64 referenced = 4;
	// Identifies the compression ratio achieved for this snapshot,
	// expressed as a multiplier.
	double compressratio = 5;
	// Specifies the logical size of the volume. (in byte)
	uint64 vol_size = 6;
	// The amount of space that is "logically" accessible by this dataset.
	// See the referenced property. The logical space ignores the effect of
	// the compression and copies properties, giving a quantity closer to
	// the amount of data that applications see.
	// However, it does include space consumed by metadata.
	// (in byte)
	uint64 logicalreferenced = 7;
}

...