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

Re: [Xen-API] Attach CD or Removable Devices




On Fri, Dec 7, 2012 at 3:18 AM, Paul Pridt <p.pridt@xxxxxxxxx> wrote:
Hi,
I am looking for a way to attach a physical CD drive or a USB-attached hard drive to a VM.
I know that Citrix Xenserver does that through special udev-SRs. There you even can attach an internal hard drive with the help of an udev rule that creates the vdi.
Has anybody a running solution?
My system is Ubuntu 12.04 with xcp-xapi.

--
Regards,
Paul

What is it exactly you're trying toÂaccomplish? I'd start by checking /etc/udev/rules.d/58-xapi.rules for events and check the scripts that it runs.Â

58-xapi.rules
# Skip devices which fail the local sharing check (to filter out root/mounted devices)
ACTION="" PROGRAM!="/opt/xensource/libexec/check-device-sharing %k", GOTO="end_xapi"

ACTION="" SYMLINK+="xapi/block/%k"

ACTION="" RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"
ACTION="" RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"


Part of /opt/xensource/libexec/local-device-change

Âfor SR in `xe sr-list type=udev sm-config:type=block uuid=${LOCAL_SR} params=uuid --minimal`
   do
    xe vdi-introduce uuid=`uuidgen` sr-uuid=${SR} type=user location=/dev/xapi/block/${DEVICE}
Âdone


Read the whole scripts of course but this might get you started.
_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.