virsh を使用してゲスト仮想マシンの XML 設定ファイルを出力します。
virsh dumpxml {guest-id, guestname or uuid}
# virsh dumpxml {guest-id, guestname or uuid}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
このコマンドは、ゲスト仮想マシンの XML 設定ファイルを標準出力 (stdout) に出力します。出力をファイルにパイプすることでデータを保存できます。出力を guest.xml というファイルにパイプする例:
virsh dumpxml GuestID > guest.xml
# virsh dumpxml GuestID > guest.xml
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
このファイル
guest.xml は、ゲスト仮想マシンを再作成できます (参照
「ゲスト仮想マシンの設定ファイルの編集」。この XML 設定ファイルを編集して、追加のデバイスを設定したり、追加のゲスト仮想マシンをデプロイしたりできます。
virsh dumpxml 出力の例:
virsh dumpxml guest1-rhel6-64
# virsh dumpxml guest1-rhel6-64
<domain type='kvm'>
<name>guest1-rhel6-64</name>
<uuid>b8d7388a-bbf2-db3a-e962-b97ca6e514bd</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='rhel6.2.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none' io='threads'/>
<source file='/home/guest-images/guest1-rhel6-64.img'/>
<target dev='vda' bus='virtio'/>
<shareable/<
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<interface type='bridge'>
<mac address='52:54:00:b9:35:a9'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<shareable/> フラグが設定されていることに注意してください。これは、デバイスがドメイン間で共有されることが期待されていることを示します (ハイパーバイザーと OS がこれをサポートしていると仮定)。つまり、そのデバイスのキャッシュを非アクティブ化する必要があります。