Xen的CDROM支持系列命令

Xen CDROM Support

Contents

  • PV Guest
  • HVM Guest
    • Adding CDROM to guest
    • Change CDROM for a running guest
    • Booting from CDROM
  • Troubleshooting

PV Guest

Currently, there's no paravirtual CDROM driver available. So in PV guest, youcan only add a iso image as a disk and cannot change this disk at runtime. Butas a workaround, you can detach it and re-attach another iso as the samefrontend. e.g.:

# xm block-attach <domain> file:/path/to/cd1.iso hdc:cdrom r
# xm block-detach <domain> <devid>
# xm block-attach <domain> file:/path/to/cd2.iso hdc:cdrom r

But this command doesn't work:

# xm block-attach <domain> "" hdc:cdrom r

Although the above command successes, but there will be no cdrom drive being initialized in the guest.

And this command fails:

# xm block-attach <domain> "" hdd r

HVM Guest

Adding CDROM to guest

To add a physical CDROM drive or iso file as CDROM, you need to append ":cdrom"suffix to the target device name. e.g.:

disk = ['phy:/dev/hdc,hdc:cdrom,r']
disk = ['file:/test.iso,hdc:cdrom,r']
disk = ['phy:/dev/null,hdc:cdrom,r']
disk = [',hdc:cdrom,r']

Change CDROM for a running guest (更改光盘的时候最好使用此命令)

If you attached a physical CDROM drive, the CDROM media in the guest willchange automatically when you change it physically.

If it doesn't change, execute the following command in Dom0:

# xm block-configure <domain> phy:/dev/hdc hdc:cdrom r

If you want to bind an iso to a CDROM:

# xm block-configure <domain> file:/test.iso hdc:cdrom r

To eject the CDROM:

# xm block-configure <domain> "" hdc:cdrom r

Note

The CDROM can only be added to the VM configure file. You cannotattach/detach it when the VM is running.

You can also do these in the qmonitor. If you are using the SDL viewer, insidethe VM console press the following key combination to get into the monitor:

Ctrl-Alt-2

And then use the following command to eject the CDROM:

eject hdc [return]

Now you should be able to eject the cd manually, and put in a different CD.Then type the following command to change CDROM for the guest:

change hdb /dev/hdc [return]

To get back to the VM gui, press:

Ctrl-Alt-1

The new disk should be ready for mounting.

Booting from CDROM

To boot from CDROM, add config parameter "boot=c" to the vm configure file.

Troubleshooting

  • The configure option "cdrom" is obsolete as of Xen 3.0.3.
  • Under certain circumstance, using /dev/cdrom, which is a symbol link to theactual device, doesn't work.

你可能感兴趣的:(Xen的CDROM支持系列命令)