NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Problem attaching a usb drive to vm



Hello everyone,
I'm trying to attach an external drive to a VM, but I keep getting this
error:

xm block-attach myvm phy:/dev/sd1 /dev/xvdb w

"Error: Device 51728 (vbd) could not be connected. Hotplug scripts not
working.
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]

Create a new virtual block device."

The guest VM is CentOS 5.

This is probably something simple that I'm overlooking because the had
drive is recognized by NetBSD:

sd1 at scsibus1 target 0 lun 0: <WD, Ext HDD 1021, 2021> disk fixed
sd1: fabricating a geometry
sd1: 1863 GB, 1907727 cyl, 64 head, 32 sec, 512 bytes/sect x 3907024896
sectors

But the xenbackendd.log says differently:

xenstore-read: couldn't read path /local/domain/0/backend/vbd/3/51712/type
xenstore-read: couldn't read path /local/domain/0/backend/console/6/0/type
stat: /dev/sd1: lstat: No such file or directory
stat: /dev/sd1: lstat: No such file or directory

This is the xen.log:
[2012-06-12 14:32:30 267] DEBUG (XendDomainInfo:650)
XendDomainInfo.device_create: ['vbd', ['uname', 'phy:/dev/sd1'], ['dev',
'/dev/xvdb'], ['mode', 'w']]
[2012-06-12 14:32:30 267] DEBUG (XendDomainInfo:654)
XendDomainInfo.device_create: {'uuid':
'4de12979-6220-8f3f-d40d-60f56577d644', 'bootable': 0, 'driver':
'paravirtualised', 'dev': '/dev/xvdb', 'uname': 'phy:/dev/sd1', 'mode': 'w'}
[2012-06-12 14:32:30 267] DEBUG (DevController:122) DevController: writing
{'virtual-device': '51728', 'device-type': 'disk', 'protocol':
'x86_32-abi', 'backend-id': '0', 'state': '1', 'backend':
'/local/domain/0/backend/vbd/6/51728'} to /local/domain/6/device/vbd/51728.
[2012-06-12 14:32:30 267] DEBUG (DevController:124) DevController: writing
{'domain': 'mirrors', 'frontend': '/local/domain/6/device/vbd/51728',
'uuid': '4de12979-6220-8f3f-d40d-60f56577d644', 'dev': '/dev/xvdb',
'state': '1', 'params': '/dev/sd1', 'mode': 'w', 'online': '1',
'frontend-id': '6', 'type': 'phy'} to /local/domain/0/backend/vbd/6/51728.
[2012-06-12 14:32:30 267] DEBUG (DevController:656) hotplugStatusCallback
/local/domain/0/backend/vbd/6/51728/hotplug-status.
[2012-06-12 14:32:30 267] DEBUG (DevController:171) Waiting for 51728.
[2012-06-12 14:32:30 267] DEBUG (DevController:656) hotplugStatusCallback
/local/domain/0/backend/vbd/6/51728/hotplug-status.
[2012-06-12 14:32:30 267] DEBUG (DevController:656) hotplugStatusCallback
/local/domain/0/backend/vbd/6/51728/hotplug-status.
[2012-06-12 14:32:30 267] DEBUG (DevController:656) hotplugStatusCallback
/local/domain/0/backend/vbd/6/51728/hotplug-status.


Now the xm block-list myvm -l shows this:
root@core:>#xm block-list -l myvm
(51712
    ((virtual-device 51712)
        (device-type disk)
        (protocol x86_32-abi)
        (backend-id 0)
        (state 4)
        (backend /local/domain/0/backend/vbd/6/51712)
        (ring-ref 8)
        (event-channel 6)
    )
)
(51728
    ((virtual-device 51728)
        (device-type disk)
        (protocol x86_32-abi)
        (backend-id 0)
        (state 1)
        (backend /local/domain/0/backend/vbd/6/51728)
    )
)


And from the guest:

[root@myvm ~]# fdisk -l

Disk /dev/xvda: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux
/dev/xvda2              14         261     1992060   8e  Linux LVM


Many thanks in advance.


Cheers,

Max L


Home | Main Index | Thread Index | Old Index