Direct Disk Access in XenServer (iSCSI Trick)
filed in Uncategorized on Aug.14, 2010
XenServer does not allow direct Hard Drive access from a Virtual Machine.
But we can use a trick to mount the Drive or Volume as an iSCSI device. This will let us use it as a Removable Device in XenServer.
Just Edit the udev file:
nano /etc/udev/rules.d/50-udev.rules
And add these 2 lines of code (replace md0 with your device)
ACTION=="add", KERNEL=="md0", SYMLINK+="xapi/block/%k", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"
ACTION=="remove", KERNEL=="md0", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"
To Save and quit nano type:
ctrl+w then ctrl+o
Now if you go into your XenServer Console, Go to a Virtual Machine > Storage.
Select Attach, Then Under Removable Storage you will see your Drive or Volume.
Note: It will come up as “Unreconised bus type” that is safe to ignore, if you would to change it go to “Removable Storage” on your Server, then click on “Unreconised bus type” then Properties and change its name.