Virsh Verzeichnis Pool: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „=Linux Isci= *Iscsi =Virsh XML Definition= *cat virsh-scsi.xml <pre> <pool type="iscsi"> <name>virtimages</name> <source> <host name="doom.xinux.la…“)
 
 
(7 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt)
Zeile 1: Zeile 1:
=Linux Isci=
+
=Verzeichnis erstelle=
*[[Iscsi]]
+
*sudo mkdir -p /mnt/data/images
 
=Virsh XML Definition=
 
=Virsh XML Definition=
*cat virsh-scsi.xml
+
*cat virsh-dir.xml
 
<pre>
 
<pre>
<pool type="iscsi">
+
<pool type="dir">
   <name>virtimages</name>
+
   <name>images-on-doom</name>
  <source>
 
    <host name="doom.xinux.lan"/>
 
    <device path="iqn.2020-12.org.xinux.doom:storage"/>
 
  </source>
 
 
   <target>
 
   <target>
     <path>/dev/disk/by-path</path>
+
     <path>/mnt/data/images</path>
 
   </target>
 
   </target>
 
</pool>
 
</pool>
 
</pre>
 
</pre>
 +
 
=Pool definieren=
 
=Pool definieren=
*virsh pool-define virsh-scsi.xml
+
*virsh pool-define virsh-dir.xml
 
=Pools listen=
 
=Pools listen=
 
*virsh pool-list --all
 
*virsh pool-list --all
Zeile 22: Zeile 19:
 
  -------------------------------------------
 
  -------------------------------------------
 
   default              active    yes
 
   default              active    yes
   ISO                  active    yes
+
   images-on-doom      inactive  no
  media                active    yes
+
 
  qemu                active    yes
 
  virtimages          inactive  no
 
 
=Pool aktivieren=
 
=Pool aktivieren=
*virsh pool-start virtimages
+
*virsh pool-start images-on-doom
 
=Pool für den Autostart markieren=
 
=Pool für den Autostart markieren=
*virsh pool-autostart virtimages
+
*virsh pool-autostart images-on-doom
=Verfügbare Datenträger listen=
+
=Pools listen=
*virsh vol-list virtimages
+
*virsh pool-list --all
   Name                Path
+
   Name                State      Autostart
  ------------------------------------------------------------------------------
+
  -------------------------------------------
   unit:0:0:0          /dev/disk/by-path/ip-192.168.240.3:3260-iscsi-iqn.2020-12.org.xinux.doom:storage-lun-0
+
  default              active    yes
=Info übe den Datenträger=
+
  images-on-doom      active    yes
*virsh vol-info /dev/disk/by-path/ip-192.168.240.3:3260-iscsi-iqn.2020-12.org.xinux.doom:storage-lun-0
+
=Dump Pool=
  Name:          unit:0:0:0
+
*virsh pool-dumpxml images
Type:          block
+
<pre>
Capacity:      100.00 GiB
+
<pool type='dir'>
  Allocation:    100.00 GiB
+
  <name>images</name>
 +
  <uuid>fd376830-81e6-4c85-a827-d710106d7bc2</uuid>
 +
  <capacity unit='bytes'>98293264384</capacity>
 +
  <allocation unit='bytes'>46400319488</allocation>
 +
   <available unit='bytes'>51892944896</available>
 +
  <source>
 +
  </source>
 +
  <target>
 +
    <path>/var/lib/libvirt/images</path>
 +
    <permissions>
 +
      <mode>0711</mode>
 +
      <owner>0</owner>
 +
      <group>0</group>
 +
    </permissions>
 +
  </target>
 +
</pool>
 +
</pre>
 +
=Destroy=
 +
*virsh pool-destroy images
 +
  Pool images zerstört
 +
=Undefine=
 +
*virsh pool-undefine images
 +
  Pool images wurde zurücksetzt

Aktuelle Version vom 8. Juli 2025, 08:53 Uhr

Verzeichnis erstelle

  • sudo mkdir -p /mnt/data/images

Virsh XML Definition

  • cat virsh-dir.xml
<pool type="dir">
  <name>images-on-doom</name>
  <target>
    <path>/mnt/data/images</path>
  </target>
</pool>

Pool definieren

  • virsh pool-define virsh-dir.xml

Pools listen

  • virsh pool-list --all
 Name                 State      Autostart
-------------------------------------------
 default              active     yes
 images-on-doom       inactive   no

Pool aktivieren

  • virsh pool-start images-on-doom

Pool für den Autostart markieren

  • virsh pool-autostart images-on-doom

Pools listen

  • virsh pool-list --all
 Name                 State      Autostart
-------------------------------------------
 default              active     yes
 images-on-doom       active     yes

Dump Pool

  • virsh pool-dumpxml images
<pool type='dir'>
  <name>images</name>
  <uuid>fd376830-81e6-4c85-a827-d710106d7bc2</uuid>
  <capacity unit='bytes'>98293264384</capacity>
  <allocation unit='bytes'>46400319488</allocation>
  <available unit='bytes'>51892944896</available>
  <source>
  </source>
  <target>
    <path>/var/lib/libvirt/images</path>
    <permissions>
      <mode>0711</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

Destroy

  • virsh pool-destroy images
Pool images zerstört

Undefine

  • virsh pool-undefine images
Pool images wurde zurücksetzt