Difference between revisions of "Virsh pool-define-as"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
<code>virsh<ref>https://linux.die.net/man/1/virsh</ref> pool-define-as name type</code><pre>
+
<code>virsh<ref>https://linux.die.net/man/1/virsh</ref> pool-define-as name type</code>
 +
:pool types fs, logical, disk, iscsi, iscsi-direct, zfs, vstorage<ref>https://libvirt.org/formatstorage.html</ref>
 +
 
 +
<pre>
 
  [--source-host hostname]
 
  [--source-host hostname]
 
  [--source-path path]
 
  [--source-path path]
Line 17: Line 20:
 
== Create a pool ==
 
== Create a pool ==
 
=== Create a permanent, autostart pool of type dir ===
 
=== Create a permanent, autostart pool of type dir ===
1. <pre>virsh pool-define-as MY_STORAGE_POOL --type dir --target /var/lib/[[libvirt]]/MY_STORAGE_POOL_PATH
+
virsh pool-define-as MY_STORAGE_POOL --type dir --target  
Pool MY_STORAGE_POOL defined</pre>
+
/var/lib/[[libvirt]]/MY_STORAGE_POOL_PATH
 +
Pool MY_STORAGE_POOL defined
  
2. <pre>virsh pool-autostart MY_STORAGE_POOL
+
[[virsh pool-autostart]] MY_STORAGE_POOL
Pool MY_STORAGE_POOL marked as autostarted</pre>
+
Pool MY_STORAGE_POOL marked as autostarted
  
2. <code>[[virsh pool-start]] MY_STORAGE_POOL</code>
+
[[virsh pool-start]] MY_STORAGE_POOL
Pool MY_STORAGE_POOL started
+
Pool MY_STORAGE_POOL started
  
 
=== Review creation ===
 
=== Review creation ===
  virsh pool-list
+
  [[virsh pool-list]]
 
  Name                State      Autostart
 
  Name                State      Autostart
 
  -------------------------------------------
 
  -------------------------------------------
Line 47: Line 51:
  
  
<code>[[virsh/virsh vol-list|virsh vol-list]] MY_STORAGE_POOL --details</code>
+
<code>[[virsh vol-list]] MY_STORAGE_POOL --details</code>
 
<pre>
 
<pre>
 
  Name  Path  Type  Capacity  Allocation
 
  Name  Path  Type  Capacity  Allocation
Line 57: Line 61:
 
# Create a Persistent storage pool
 
# Create a Persistent storage pool
 
# Create a Persistent storage pool and migrate some machines: [[Offline Migrate or move a virtual machine between two KVM servers without shared storage]]
 
# Create a Persistent storage pool and migrate some machines: [[Offline Migrate or move a virtual machine between two KVM servers without shared storage]]
 +
 +
 +
== Related commands ==
 +
* <code>[[virsh pool-list --all]]</code>
 +
* <code>[[virsh vol-create-as]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 07:58, 3 March 2020

virsh pool-define-as Create a permanent pool but do not start it.


virsh[1] pool-define-as name type

pool types fs, logical, disk, iscsi, iscsi-direct, zfs, vstorage[2]
 [--source-host hostname]
 [--source-path path]
 [--source-dev path]
 [--source-name name]
 [--target path]
 [--source-format format]
 [--auth-type authtype --auth-username username
 [--secret-usage usage
 |--secret-uuid uuid]] [[--adapter-name name]
 [--adapter-wwnn --adapter-wwpn] [--adapter-parent parent]] [--print-xml]

Create a pool[edit]

Create a permanent, autostart pool of type dir[edit]

virsh pool-define-as MY_STORAGE_POOL --type dir --target 
/var/lib/libvirt/MY_STORAGE_POOL_PATH
Pool MY_STORAGE_POOL defined
virsh pool-autostart MY_STORAGE_POOL
Pool MY_STORAGE_POOL marked as autostarted
virsh pool-start MY_STORAGE_POOL
Pool MY_STORAGE_POOL started

Review creation[edit]

virsh pool-list
Name                 State      Autostart
-------------------------------------------
MY_STORAGE_POOL               active     yes


virsh pool-info MY_STORAGE_POOL

Name:           MY_STORAGE_POOL
UUID:           4a208Ra0-tf7x-49b6-9ad7-47e71dfeb82d
State:          inactive
Persistent:     yes
Autostart:      yes
Capacity:       9.02 TiB
Allocation:     2.16 TiB
Available:      6.87 TiB


virsh vol-list MY_STORAGE_POOL --details

 Name  Path  Type  Capacity  Allocation
----------------------------------------

Activities[edit]

  1. Understand differences between pool-define, pool-define-as and pool-create, pool-create-as
  2. Create a Persistent storage pool
  3. Create a Persistent storage pool and migrate some machines: Offline Migrate or move a virtual machine between two KVM servers without shared storage


Related commands[edit]

See also[edit]

  • https://linux.die.net/man/1/virsh
  • https://libvirt.org/formatstorage.html
  • Advertising: