Linux Virtualization Remove Storage from Guest

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Procedure

Shut down the guest:

virsh shutdown <guest-name>

Edit the guest definition:

virsh edit <guest-name>

Lookup the device definition and remove it:

...
<devices>
  ...
  <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/iso-images/CentOS-7-x86_64-DVD-7.9.2009.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>

Restart the guest:

virsh start <guest-name>