Page 1 of 1

Attaching ISCSI HD to VM using the Virtualbox API and C#

Posted: 7. Aug 2012, 20:43
by SinatraSAM
Hello,

I am having trouble attaching an ISCSI target to a Virtual machine using the c# Virtualbox API. When I try to execute

Code: Select all

IMedium med = vb.OpenMedium("<ip address>|<ISCSI target ID>", DeviceType.DeviceType_HardDisk, AccessMode.AccessMode_ReadWrite, 1);
I receive the following error
"The given path '<ip address>|<ISCSI target ID>' is not fully qualified"

The API says "The format of the location string is medium type specific." (see the IMedium Interface Reference in the API)
What is the format of the location string for an ISCSI target drive?

I am able to attach an ISCSI target HD to a VM using the command line VBoxManage commands so I know it's possible but I need to do it using the API.

Thanks.

Re: Attaching ISCSI HD to VM using the Virtualbox API and C#

Posted: 4. Sep 2012, 21:27
by SinatraSAM
According to the VirtualBox Manual what I am trying to do is not possible at the current time. An iSCSI target cannot be added using the VirtualBox API calls. It can only be added using the "VBoxManage storageattach" command through the command line.

"To use an iSCSI target with VirtualBox, you must use the command line; see the section called 'VBoxManage storageattach'." - VirtualBox Manual, Chapter 5, "iSCSI servers."