Replacing a virtual DVD
The virtual server accesses a provided ISO image as a virtual DVD through the virtual SCSI-attached CD/DVD drive. You can remove a virtual DVD, and provide a different one.
Before you begin
Make sure that the virtual DVD drive is configured as a virtual SCSI device .
About this task
The guest is able to mount and to unmount the file system residing on a virtual DVD. You can remove the ISO image which represents the virtual DVD and provide a different one during the life time of the virtual server. If you try to remove an ISO image that is still in use by the guest, QEMU forces the guest to release the file system.
Procedure
Example
After the guest has unmounted the file system on the
virtual DVD, this example removes the currently provided virtual DVD from the virtual DVD
drive:
# virsh domblklist vserv1 Target Source ------------------------------------------------ vda /dev/storage1/vs1_disk1 sda /var/lib/libvirt/images/cd2.iso # virsh change-media vserv1 sda --eject Successfully ejected media. # virsh domblklist vserv1 Target Source ------------------------------------------------ vda /dev/storage1/vs1_disk1 sda -
If the virtual DVD is still in use by the guest, the change-media command with the --eject option forces the guest to unmount the file system.
This example inserts a virtual DVD, which is represented by the ISO image, into a virtual DVD
drive:
# virsh change-media vserv1 sda --insert /var/lib/libvirt/images/cd2.iso Successfully inserted media.