Virsh Vol: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 14: Zeile 14:
 
=Clone a Volume=
 
=Clone a Volume=
 
*virsh vol-clone vol-new vol-clone
 
*virsh vol-clone vol-new vol-clone
 +
=Dumo XML from a Volume=
 +
*virsh vol-dumpxml --vol vol-new.raw  --pool  default
 +
<pre>
 +
<volume type='file'>
 +
  <name>vol-new.raw</name>
 +
  <key>/var/lib/libvirt/images/vol-new.raw</key>
 +
  <source>
 +
  </source>
 +
  <capacity unit='bytes'>10737418240</capacity>
 +
  <allocation unit='bytes'>10737422336</allocation>
 +
  <target>
 +
    <path>/var/lib/libvirt/images/vol-new.raw</path>
 +
    <format type='raw'/>
 +
    <permissions>
 +
      <mode>0600</mode>
 +
      <owner>0</owner>
 +
      <group>0</group>
 +
    </permissions>
 +
    <timestamps>
 +
      <atime>1508272953.383646344</atime>
 +
      <mtime>1508272953.371646487</mtime>
 +
      <ctime>1508272953.375646440</ctime>
 +
    </timestamps>
 +
  </target>
 +
</volume>
 +
</pre>
 +
=Delete a Volume=
 +
*virsh vol-delete --vol vol-new.raw  --pool  default
 +
Vol vol-new.raw deleted
 +
=Info from a Volume=
 +
*virsh vol-info  walden.qcow2  --pool default
 +
setlocale: No such file or directory
 +
Name:          walden.qcow2
 +
Type:          file
 +
Capacity:      15.00 GiB
 +
Allocation:    1.68 GiB
 +
=Download Volume (Vorsicht BUG)=
 +
*virsh vol-download --pool default walden.qcow2  /tmp/myimage.qcow2
  
 
=Links=
 
=Links=
 
*https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7-Beta/html/Virtualization_Deployment_and_Administration_Guide/sect-Managing_guest_virtual_machines_with_virsh-Storage_Volume_Commands.html
 
*https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7-Beta/html/Virtualization_Deployment_and_Administration_Guide/sect-Managing_guest_virtual_machines_with_virsh-Storage_Volume_Commands.html

Aktuelle Version vom 18. Oktober 2017, 05:32 Uhr

List a Volume Pool

  • virsh vol-list default
 Name                 Path
------------------------------------------------------------------------------
 elan.foreman.lan-disk1 /var/lib/libvirt/images/elan.foreman.lan-disk1
 vol-new              /var/lib/libvirt/images/vol-new
 vol-new.qcow2        /var/lib/libvirt/images/vol-new.qcow2

Create a qcow2 image

  • virsh vol-create-as default vol-new.qcow2 10G --format qcow2

Create a raw image

  • virsh vol-create-as default vol-new.raw 10G --format raw

Clone a Volume

  • virsh vol-clone vol-new vol-clone

Dumo XML from a Volume

  • virsh vol-dumpxml --vol vol-new.raw --pool default
<volume type='file'>
  <name>vol-new.raw</name>
  <key>/var/lib/libvirt/images/vol-new.raw</key>
  <source>
  </source>
  <capacity unit='bytes'>10737418240</capacity>
  <allocation unit='bytes'>10737422336</allocation>
  <target>
    <path>/var/lib/libvirt/images/vol-new.raw</path>
    <format type='raw'/>
    <permissions>
      <mode>0600</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
    <timestamps>
      <atime>1508272953.383646344</atime>
      <mtime>1508272953.371646487</mtime>
      <ctime>1508272953.375646440</ctime>
    </timestamps>
  </target>
</volume>

Delete a Volume

  • virsh vol-delete --vol vol-new.raw --pool default
Vol vol-new.raw deleted

Info from a Volume

  • virsh vol-info walden.qcow2 --pool default
setlocale: No such file or directory
Name:           walden.qcow2
Type:           file
Capacity:       15.00 GiB
Allocation:     1.68 GiB

Download Volume (Vorsicht BUG)

  • virsh vol-download --pool default walden.qcow2 /tmp/myimage.qcow2

Links