Virsh pool-define-as: Difference between revisions
Jump to navigation
Jump to search
(→type) |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=External= | |||
* [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/sect-Managing_guest_virtual_machines_with_virsh-Storage_pool_commands.html#sect-Storage_pool_commands-Creating_defining_and_starting_storage_pools RHEL 7 Virtualization Administration Guide - virsh Storage Pool Commands] | |||
=Internal= | =Internal= | ||
Line 19: | Line 23: | ||
====type==== | ====type==== | ||
Can be one of: "dir", "disk", "fs", "logical", "iscsi", "zfs", "sheepdog", "gluster", "netfs", "ceph", "rbd" | Can be one of: "dir", "disk", "fs", "logical", "iscsi", "scsi", "mpath", "zfs", "sheepdog", "gluster", "netfs", "ceph", "rbd". | ||
When using "pool-create-as" for a pool of type "disk", the existing partitions found on the [[#--source-dev|--source-dev]] path will be used to populate the disk pool. | When using "pool-create-as" for a pool of type "disk", the existing partitions found on the [[#--source-dev|--source-dev]] path will be used to populate the disk pool. | ||
====--print-xml==== | |||
If specified, the command will print the XML of the pool object without defining the pool. | |||
====--source-dev==== | ====--source-dev==== | ||
====--source-path==== | |||
Specifies the source directory path for directory-backed pools. | |||
====--target==== | ====--target==== | ||
The path for mapping of the storage pool into the host file system. For directory-backed pools, it is the same as the directory we're using as source. | |||
=Examples= | =Examples= | ||
Portion-based storage pool: | |||
<pre> | <pre> | ||
virsh pool-define-as main-storage-pool fs --source-dev /dev/sda7 --target /main-storage-pool | virsh pool-define-as main-storage-pool fs --source-dev /dev/sda7 --target /main-storage-pool | ||
</pre> | |||
The corresponding XML is: | |||
<pre> | |||
<pool type='fs'> | |||
<name>main-storage-pool</name> | |||
<source> | |||
<device path='/dev/sda7'/> | |||
</source> | |||
<target> | |||
<path>/main-storage-pool</path> | |||
</target> | |||
</pool> | |||
</pre> | |||
Directory-based storage pool: | |||
<pre> | |||
virsh pool-define-as iso-images dir --source-path /iso-images --target /iso-images | |||
</pre> | </pre> |
Latest revision as of 00:56, 29 June 2017
External
Internal
Overview
Create, but do not start, a storage pool.
virsh pool-define-as <name> <type> --source-dev <source-dev> --target <target>
where:
name
The name of the storage pool.
type
Can be one of: "dir", "disk", "fs", "logical", "iscsi", "scsi", "mpath", "zfs", "sheepdog", "gluster", "netfs", "ceph", "rbd".
When using "pool-create-as" for a pool of type "disk", the existing partitions found on the --source-dev path will be used to populate the disk pool.
--print-xml
If specified, the command will print the XML of the pool object without defining the pool.
--source-dev
--source-path
Specifies the source directory path for directory-backed pools.
--target
The path for mapping of the storage pool into the host file system. For directory-backed pools, it is the same as the directory we're using as source.
Examples
Portion-based storage pool:
virsh pool-define-as main-storage-pool fs --source-dev /dev/sda7 --target /main-storage-pool
The corresponding XML is:
<pool type='fs'> <name>main-storage-pool</name> <source> <device path='/dev/sda7'/> </source> <target> <path>/main-storage-pool</path> </target> </pool>
Directory-based storage pool:
virsh pool-define-as iso-images dir --source-path /iso-images --target /iso-images