Thru the VI Client we are given option while removing the virtual disk whether to keep the backing file or delete it, but thru VI SDK I am not able to do it. It allows me to remove the disk, but I have to delete the backing file also.
Do anyone have any sample of hot to remove the Virtual disk without deleting the backing file.
ns2__VirtualDisk newdisk;
// newdisk.deviceInfo=&descr;
// newdisk.capacityInKB=2097152;
newdisk.backing=&virtDisk;
newdisk.controllerKey=&ckey;
newdisk.unitNumber=&uno;
newdisk.key=2001;
newdisk.connectable=&conninfo;
ns2__VirtualDeviceConfigSpecFileOperation foptype=ns2__VirtualDeviceConfigSpecFileOperation__destroy; -
> If I use replace or create, it fails
ns2__VirtualDeviceConfigSpecOperation optype=ns2__VirtualDeviceConfigSpecOperation__remove;
ns2__VirtualDeviceConfigSpec *cspec=new ns2__VirtualDeviceConfigSpec () ;
cspec->operation=&optype;
cspec->fileOperation=&foptype;
cspec->device=&newdisk;
-Sunil