WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Attach CDROM to windows

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Attach CDROM to windows
From: 田世坤 <aixt2006@xxxxxxxxx>
Date: Mon, 19 Apr 2010 21:16:12 +0800
Delivery-date: Mon, 19 Apr 2010 06:18:14 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=os7IjxvuoJIkbWTOIx7dhsNoVXJCKhfx0bl6wwacD1I=; b=CLlUD6PoWl0dKDXESm/yJd6iSMtdMPKBLRpJ2Njs6wERph4ZAlwOB0ViCV6ruaCZ9x 0ZTdKdTIj2/qERSBIcJNJpMyOh4PTbIX+5C/vMv7uC09XbwG7G7h9T46cXTv+pY1PCJ/ vfgS7I9u5r7AIRWFZB/xyp6djg/xRYjWCjBNY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=c1fm7q/pQmx8fYeEWCjZnivOyys3EVM3osR11dKxdvFGzpqjTxNkbWn6lTkAuFYpFP 44ZcL4KL1Yj1kMbf91M7jXQbMUnTFXtnY9427BbEGBK0Kqw/7Rc0MUmmpU8ftPuFkYgn TJroiT250r1viE9YtcxvOF9GGYtFAqRWg2yvY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

Hi Guys,

 

Now I am using Xen-4.0.0.   I need to attach CDROM from ISO files to vitual machines when they are running. The VMs contain RHEL4.6, Windows Server 2003 32bit and Windows Server 2006 64bit.

 

The disk configuration of the VMs is:

disk = [ 'tap:vhd:/guest/SS_test/vhd/hmi-100130.vhd,hda,w']    (1)

 

When I attach a CDROM to RHEL4.6 VM with the command:

virsh attach-device DomID attach-cdrom.xml     (2)

The device come out soon and I can mount it to use, the state from “xm block-list DomID” is (connected). The content of attach-cdrom.xml is:

    <disk type='file' device='cdrom'>

      <driver name='file'/>

      <source file='/guest/SS_test/iso/redhat_4.6_32.iso'/>

      <target dev='hdc' bus='ide'/>

      <readonly/>

</disk>

 

When I detach it with the command after umount the CDROM:

virsh detach-device DomID attach-cdrom.xml     (3)

The device disapear soon.

 

But in windows VMs, I execute (2), the CDROM just not come out. They need to reboot to bring out the CDROM.

 

 

Before, I was using Xen-3.4.2. To avoid the reboot for windows, I changed the disk configuration:

disk = [ 'tap:vhd:/guest/SS_test/vhd/hmi-100127.vhd,hda,w', ',hdc:cdrom,r'] (4)

After boot, the state of the CDROM from “xm block-list DomID” is 1(initialising).

When the VM is running, I execute (2) to assert the ISO file. Though the state is also 1, but the content of ISO file are able to read in the CDROM in the VM.

To remove the ISO file, excute (5):

virsh attach-device DomID detach-cdrom.xml        (5)

The content of detach-cdrom.xml is:

    <disk type='file' device='cdrom'>

      <target dev='hdc' bus='ide'/>

      <readonly/>

    </disk>

 

   It seems very convenience in Xen-3.4.2. I tried to do these in Xen-4.0.0 to avoid reboot. But fail. The state is 6 (closed):

root@SS01 # xm block-list 27

Vdev  BE handle state evt-ch ring-ref BE-path

768    0    0     4      5      8     /local/domain/0/backend/vbd/27/768 

5632   0    0     6      -1     -1    /local/domain/0/backend/vbd/27/5632

 

 When I execute (2), it report: xend.err 'Device 5632 not connected'. So I execute (6) to detach the CDROM:

xm block-detach DomID 5632 –f     (6)

It will block without –f option. Now the devices are:

root@SS01 # xm block-list 27

Vdev  BE handle state evt-ch ring-ref BE-path

768    0    0     4      5      8     /local/domain/0/backend/vbd/27/768 

 

Then I execute (2) to attach the CDROM successfully. The ISO is assert to the CDROM in the VM. The state of eh CDROM is 1(initialising).

root@SS01 # xm block-list 27

Vdev  BE handle state evt-ch ring-ref BE-path

768    0    0     4      5      8     /local/domain/0/backend/vbd/27/768 

5632   0    0     1      -1     -1    /local/domain/0/backend/vbd/27/5632

 

Then I execut (5) to remove the ISO, it report: xend.err 'Device 5632 not connected'. And execute (3) to detach the CDROM device. It will block. I still need to execute (6) to detach it.

 

xm info for Xen-3.4.2:

host                   : houyi-vm03.dev.sd.al

release                : 2.6.18.8-xen

version                : #1 SMP Thu Dec 3 22:46:04 CST 2009

machine                : x86_64

nr_cpus                : 16

nr_nodes               : 1

cores_per_socket       : 4

threads_per_core       : 2

cpu_mhz                : 2400

hw_caps                : bfebfbff:28100800:00000000:00000340:009ce3bd:00000000:00000001:00000000

virt_caps              : hvm

total_memory           : 24567

free_memory            : 22240

node_to_cpu            : node0:0-15

node_to_memory         : node0:22240

xen_major              : 3

xen_minor              : 4

xen_extra              : .2

xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 

xen_scheduler          : credit

xen_pagesize           : 4096

platform_params        : virt_start=0xffff800000000000

xen_changeset          : unavailable

cc_compiler            : gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)

cc_compile_by          : root

cc_compile_domain      : (none)

cc_compile_date        : Thu Dec  3 22:47:18 CST 2009

xend_config_format     : 4


xm info for Xen-4.0.0:

host                   : SS01

release                : 2.6.31.13

version                : #1 SMP Fri Apr 16 14:58:38 CST 2010

machine                : x86_64

nr_cpus                : 16

nr_nodes               : 2

cores_per_socket       : 4

threads_per_core       : 2

cpu_mhz                : 2400

hw_caps                : bfebfbff:28100800:00000000:00001b40:009ce3bd:00000000:00000001:00000000

virt_caps              : hvm

total_memory           : 24540

free_memory            : 4146

node_to_cpu            : node0:0,2,4,6,8,10,12,14

                         node1:1,3,5,7,9,11,13,15

node_to_memory         : node0:1553

                         node1:2593

node_to_dma32_mem      : node0:1017

                         node1:0

max_node_id            : 1

xen_major              : 4

xen_minor              : 0

xen_extra              : .0-rc9-pre

xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 

xen_scheduler          : credit

xen_pagesize           : 4096

platform_params        : virt_start=0xffff800000000000

xen_changeset          : Sat Mar 27 16:01:35 2010 +0000 21078:f3db0ae08304

xen_commandline        : 

cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)

cc_compile_by          : root

cc_compile_domain      : (none)

cc_compile_date        : Fri Apr  9 15:34:38 CST 2010

xend_config_format     : 4



 

What has been changed from Xen-3.4.2 to 4.0.0 for block-attach? Became stricter?

 

So is there any idea for me to attach an ISO CDROM to windows without reboot?

 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Attach CDROM to windows, 田世坤 <=