NAME vdiskadm - creates and manages virtual disks SYNOPSIS vdiskadm create -s size [-t type[:opt],[opt]] [-c comment] vdname vdiskadm destroy [-r] vdname|snapshot vdiskadm snapshot vdname@snapname vdiskadm rollback [-r] snapshot vdiskadm clone [-c comment] vdname|snapshot clone_vdname vdiskadm move vdname dir vdiskadm rename [-c comment] vdname|snapshot vdname|snapshot vdiskadm list [-fp] vdname vdiskadm verify vdname vdiskadm prop-get [-l] -p property vdname vdiskadm prop-set -p property=value vdname vdiskadm prop-add -p property=value vdname vdiskadm prop-del -p property vdname vdiskadm help [command] DESCRIPTION The vdiskadm command manages virtual disks within dom0. vdname is the pathname of the virtual disk and it has a maximum length of MAXPATHLEN (1024 bytes). Snapshots A snapshot is a read-only copy of a virtual disk. Snapshots can be created extremely quickly, and initially consume little space. As data within the active virtual disk changes, the snapshot consumes more data than would otherwise be shared with the active virtual disk. Clones A clone is a writable copy of a virtual disk. The default type of clone is a merged (i.e. coalesced) copy of the original virtual disk. An example of this is if the virtual disk is comprised of several snapshots the clone operation will result in a new virtual disk containing no snapshots. The clone will be of the same type as the original virtual disk being copied (i.e. vmdk:fixed). When a merged clone is created there is no linkage back to the original virtual disk or any of its snapshots. This allows the merged clone to be moved to another physical machine. Numeric Values The values of numeric properties can be specified using the following human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications: "1536M", "1.5g", "1.50GB". Types of Virtual Disks The following types and options of virtual disks are supported: vmdk:fixed vmdk:sparse vdi:fixed vdi:sparse raw:fixed where vmdk is the native VMware format, vdi is the native VirtualBox format and raw describes a file that looks like a raw disk. A raw disk is always in fixed format so that can be explicitly set or implicitly understood. If the type is not specified the default value is vmdk. If the option is not specified the default value is fixed for type raw and sparse for types vmdk and vdi. Native Properties Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control vdiskadm behavior. In addition, native properties are either editable or read-only. User properties have no effect on vdiskadm behavior, but you can use them to annotate virtual disks in a way that is meaningful in your environment. For more information about user proper- ties, see the "User Properties" section. Properties are only associated with the virtual disk and not associated with individual snapshots. Every virtual disk has a set of properties that export statistics about the virtual disk as well as control various behaviors. The following are the native properties for a virtual disk: cdrom Boolean property that is true if the virtual disk is a CDROM. removable Boolean property that is true if the virtual disk is a removable media. readonly Boolean property that is true if the virtual disk is read-only. This property is read-only. sectors Numeric property containing the number of disk sectors in the given virtual disk. This property is read-only. name String property that is the name of the virtual disk. This property is read-only. max_size Numeric property containing the maximum size of the virtual disk in bytes. This property is read-only. effective_size Numeric property containing the effective size of the virtual disk in bytes. The effective size includes the size of all files associated with the virtual disk including snapshots. The effective size can exceed the maximum size. This property is read-only. creation-time String property containing the date and time that the virtual disk was created. This property is read-only. creation-time-epoch Numeric property describing the creation-time property in seconds since the epoch (seconds since 00:00:00 UTC, Jan. 1, 1970). This property is read-only. modification-time String property containing the date and time of last modification to virtual disk. This property is read-only. modification-time-epoch Numeric property describing the modification-time property in seconds since the epoch (seconds since 00:00:00 UTC, Jan. 1, 1970). This property is read-only. description String property that contains the comment given when the virtual disk was created or cloned. This property is read-only. type String property that contains the type of virtual disk: vmdk, vdi or raw. This property is read-only. sparse Boolean property that is true if the virtual disk is in sparse format. This property is read-only. owner String property that contains the user name of the owner of the virtual disk. This property is writeable. User Properties In addition to the standard native properties, vdiskadm supports arbitrary user properties. User properties have no effect on vdiskadm behavior, but applications or administrators can use them to annotate virtual disks. User property names must contain a colon (":") character, to distinguish them from native properties. SUBCOMMANDS vdiskadm create -s size [-t type[:opt],[opt]] [-c comment] vdname Creates a new virtual disk of the given size and at the location specified by vdname. If vdname includes a path to the virtual disk the corresponding directories will be created during creation of the virtual disk. -t Specifies the type of virtual disk to be created. The default type is vmdk. For vmdk and vdi types the default opt is sparse. For type raw the default opt is fixed. -c Comment that can be attached to virtual disk. vdiskadm destroy [-r] vdname|snapshot Destroys the given virtual disk or snapshot. By default, the destroy will fail if a virtual disk is specified that contains snapshots. -r Recursively destroys the virtual disk including all snapshots associated with the virtual disk. vdiskadm snapshot vdname@snapname Creates a snapshot of the virtual disk with the given snapname. vdiskadm rollback [-r] snapshot Roll back the virtual disk to a previous snapshot. When a virtual disk is rolled back, all data that has changed since the snapshot is discarded, and the virtual disk reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than the most recent one. In order to do so, all inter- mediate snapshots must be destroyed by specifying the -r option. -r Recursively destroy any snapshots more recent than the one specified. vdiskadm clone [-c comment] vdname|snapshot clone_vdname Creates a clone of the given snapshot or virtual disk. The clone is created with the type:opt and size of the original virtual disk being cloned. If clone_vdname includes a path the corresponding directories will be created during creation of the cloned virtual disk. By default a merged clone image is created. -c Comment that can be attached to cloned virtual disk. vdiskadm move vdname dir Moves the virtual disk into the specified directory. The virtual disk maintains the same name. The new directory must exist. vdiskadm rename vdname|snapshot vdname|snapshot Renames a virtual disk or snapshot. vdiskadm list [-fp] vdname Lists the virtual disk and its snapshots. -f Gives a list of all files associated with the virtual disk. This list would include the store file and the extents. -p Prints the files in an easily parsable format prefixing the files with a label of "file:" "snapshot:" or "store". vdiskadm verify vdname Returns an error if the virtual disk cannot be recognized or opened by xvm. vdiskadm prop-get [-l] -p property vdname Returns the value of the property for the given virtual disk. A property value of "all" will print all native and user defined properties for the virtual disk. -p Specifies the property being queried and prints the value of the property. For the property "all" the name of the property, a colon and a space are printed before the value of the property. -l Gives additional property information such as writeable status of property. vdiskadm prop-set -p property=value vdname Sets the value of the specified property for the given virtual disk. Property can be a native or a user-defined property, but must be writable. Can be used to change the value of a property added with prop-add. -p Specifies the property being set. vdiskadm prop-add -p property=value vdname Adds the user property with the specified value to the given virtual disk. Returns error if property already exists. The user property must contain a ":". -p Specifies the property being added. vdiskadm prop-del -p property vdname Deletes the user property from the given virtual disk. -p Specifies the property being deleted vdiskadm help [command] Displays a general or command specific help message. EXAMPLES Example 1 Creating a 8G vmdk sparse file The following command creates a virtual disk named disk1 of size 8GB in the directory /guests/disks. # vdiskadm create -s 8g -t vmdk:sparse /guests/disks/disk1 Example 2 Creating snapshots The following command creates a snapshot named install of the virtual disk located at /guests/disks/disk1. # vdiskadm snapshot /guests/disks/disk1@install Example 3 Taking and destroying multiple snapshots The following command creates two snapshots named "install" and "bfu" of the virtual disk located at /guests/disks/disk1. The third command destroys the newly created snapshot. # vdiskadm snapshot /guests/disks/disk1@install # vdiskadm snapshot /guests/disks/disk1@bfu # vdiskadm destroy /guests/disks/disk1@install Example 4 Rolling back a virtual disk The following command reverts the contents of the virtual disk to the snapshot named "install", deleting all intermediate snapshots. # vdiskadm rollback /guests/disks/disk1@install Example 5 Listing a virtual disk and snapshots The following command lists all of the images associated with the given virtual disk. # vdiskadm list /guests/disks/disk1 disk1@install disk1@bfu disk1 Example 6 Creating a clone The following command creates a new virtual disk that is a coalesced copy of the given virtual disk. The clone is created in the same format (i.e. vmdk sparse) as the original virtual disk. # vdiskadm clone /guests/disks/disk1 /guests/clone/clone_disk1 Example 7 Adding a user property The following command adds a user defined property to the virtual disk and assigns it the specified value. This property name was chosen to represent the source and requirements of this virtual disk data using the required ":" to delineate the fields. # vdiskadm prop-add -p com.sun:required-nic=2 /guests/disks/disk1