On Fri, Dec 7, 2012 at 3:18 AM, Paul Pridt <p.pr...@chello.at> 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=="add", PROGRAM!="/opt/xensource/libexec/check-device-sharing %k", GOTO="end_xapi" ACTION=="add", SYMLINK+="xapi/block/%k" ACTION=="add", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'" ACTION=="remove", 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@lists.xen.org http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api