Virsh vol-create-as: Difference between revisions
Line 15: | Line 15: | ||
virsh vol-create-as --pool <pool-name> --name <volume-name> --capacity <capacity> --format <fomat> | virsh vol-create-as --pool <pool-name> --name <volume-name> --capacity <capacity> --format <fomat> | ||
</pre> | </pre> | ||
=Options= | |||
====--pool==== | |||
The pool name or pool UUID. The "--pool" label is optional if the pool name is specified as the first argument. | |||
====--name==== | |||
The storage volume name. The "--name" label is optional if the storage volume name is specified as the second argument. | |||
====--capacity==== | ====--capacity==== | ||
The capacity, followed by one of the suffixes 'b', 'k', 'M', 'G', 'T'. The capacity is specified in bytes if there is no suffix. The "--capacity" label is optional if the capacity is specified as the third argument. | |||
====--print-xml==== | |||
If specified, the volume is not created, only the XML of the volume object is printed out. | |||
====--allocation==== | |||
The initial size to be allocated in the volume, as a scaled integer defaulting to bytes. | |||
====--format==== | ====--format==== | ||
Acceptable format types: "raw", "bochs", "qcow", "qcow2", "qed", "host_device", and "vmdk". These are, however, only meant for file based storage pools. By default the qcow version that is used is version 3. | Acceptable format types: "raw", "bochs", "qcow", "qcow2", "qed", "host_device", and "vmdk". These are, however, only meant for file based storage pools. By default the qcow version that is used is version 3. | ||
====--backing-vol==== | |||
The source backing volume to be used if taking a snapshot of an existing volume. | |||
====--backing-vol-format==== | |||
The format of the snapshot backing volume; raw, bochs, qcow, qcow2, qed, vmdk, host_device. | |||
====--prealloc-metadata==== | |||
Preallocate metadata for qcow2 images that don't support full allocation. This option creates a sparse image file with metadata, resulting in higher performance compared to images with no preallocation and only slightly higher initial disk space usage. | |||
=Example= | =Example= |
Revision as of 19:52, 28 June 2017
External
Internal
Overview
Creates a storage volume.
virsh vol-create-as --pool <pool-name> --name <volume-name> --capacity <capacity> --format <fomat>
Options
--pool
The pool name or pool UUID. The "--pool" label is optional if the pool name is specified as the first argument.
--name
The storage volume name. The "--name" label is optional if the storage volume name is specified as the second argument.
--capacity
The capacity, followed by one of the suffixes 'b', 'k', 'M', 'G', 'T'. The capacity is specified in bytes if there is no suffix. The "--capacity" label is optional if the capacity is specified as the third argument.
--print-xml
If specified, the volume is not created, only the XML of the volume object is printed out.
--allocation
The initial size to be allocated in the volume, as a scaled integer defaulting to bytes.
--format
Acceptable format types: "raw", "bochs", "qcow", "qcow2", "qed", "host_device", and "vmdk". These are, however, only meant for file based storage pools. By default the qcow version that is used is version 3.
--backing-vol
The source backing volume to be used if taking a snapshot of an existing volume.
--backing-vol-format
The format of the snapshot backing volume; raw, bochs, qcow, qcow2, qed, vmdk, host_device.
--prealloc-metadata
Preallocate metadata for qcow2 images that don't support full allocation. This option creates a sparse image file with metadata, resulting in higher performance compared to images with no preallocation and only slightly higher initial disk space usage.
Example
virsh vol-create-as --pool main-storage-pool --name test-volume --capacity 1G