Xen的CDROM支持系列命令

Xen CDROM Support

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值