So why won’t EBS work for Windows images in UEC/Eucalyptus 1.6?

I’ve been trying to find an answer to this one for a little while, on and off.  The problem isn’t actually with Eucalyptus itself, as it can be reproduced under a plain Ubuntu libvirt / KVM setup.  Basically, start a SCSI Windows image using virt-manager, then try to attach a second disk using virsh, with something like:

virsh attach-device <my domain> <path to my disk snippet>

The disk snippet is of the format:

<disk type=’file’ device=’disk’>
<source file=’<path to disk image>‘/>
<target dev=’sdb’ bus=’scsi’/>

This basically replicates the process Eucalyptus follows ‘under the hood’ when attaching an EBS volume.

In the above, the disk attaches fine, but isn’t recognised in the Windows guest, even after a SCSI bus rescan.  The closest you can get to the device being recognised is to “Add/Remove hardware”, which leaves you with a second SCSI controller, albeit a broken one.

The answer comes in Daniel Berrange’s blog entry, , in the section “Disk controllers and drive addressing”:

At around the same time that I was looking at static PCI addressing, Wolfgang Mauerer, was proposing a way to fix the SCSI disk hotplug support in libvirt. The problem here was that at boot time, if you listed 4 SCSI disks, you would get 1 SCSI controller with 4 SCSI disks attached. Meanwhile if you tried hotplugging 4 SCSI disks, you’d get 4 SCSI controllers each with 1 disk attached. In other words we were faking SCSI disk hotplug, by attaching entirely new SCSI controllers.

So there’s the explanation: libvirt is “hotplugging” by adding additional SCSI controllers.  Whilst Linux can cope with this sort of abuse, Windows can’t, hence fails to add the device.  The necessary fix is detailed in this patch series:

I guess the solution for Ubuntu users is to either:

  • Put together an updated .deb for Karmic with the required patches applied
  • Wait until Lucid is released, which includes a more recent version of the Libvirt 0.7.x series

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: