change-media

Removes a currently provided ISO image from a virtual SCSI-attached CD/DVD drive, or provides a different ISO image.

Syntax


1  change-media !  --domain <VS>

1 !  --path <logical-device-name>
1  --eject
1   --insert <iso-image>
1! !  --update? <iso-image>
2 ?  --force
2 
3.1 !  --live? 
--config
3.1  --current
Where:
<logical-device-name>
Identifies the virtual SCSI-attached CD/DVD drive as specified with the target dev attribute in the domain configuration-XML file.
<iso-image>
Is the fully qualified path to the ISO image on the host.
<VS>
Is the name, ID or UUID of the virtual server.

Selected options

--config
Persistently adds or removes the ISO image with the next virtual server restart.
--current
Depending on the virtual server state:
running, paused
Adds or removes the ISO image until the virtual server is terminated.
shut off
Persistently removes the ISO image from the virtual server or provides a different one with the next restart.
--domain
Specifies the virtual server.
--eject
Removes the currently provided ISO image from the virtual SCSI-attached CD/DVD drive.
--force
Forces the guest to release the file system residing on the virtual DVD, even if it is currently in use.
--insert
Provides a different ISO image for the virtual server.
--live
Removes an ISO image from the running virtual server or provides an ISO image for a running virtual server until the virtual server is terminated.
--path
Specifies the virtual SCSI-attached CD/DVD drive.
--update
If no ISO image is specified:
Removes the currently provided ISO image, just like the --eject option.
If an ISO image is specified:
Provides the specified ISO image. In case the current disk image has not been removed before, it is replaced by the new one.

Usage

Replacing a virtual DVD

Example

This command replaces the currently provided virtual DVD by a different one:
# virsh change-media vserv1 vdc -update /var/lib/libvirt/images/cd2.iso
Successfully inserted media.