Hello
Currenly I'm struggling with the snapshot reference.
This is fragment of the code I'm using:
cnxParams.vmxSpec = "moref=vm-3724"; cnxParams.serverName = "hh-vms"; cnxParams.credType = VIXDISKLIB_CRED_UID; cnxParams.creds.uid.userName = "userName"; cnxParams.creds.uid.password = "password"; cnxParams.port = 0;
VixError vixError = VixDiskLib_InitEx(1, 1, NULL, NULL, NULL, "bin", "config.vddk"); out << VixDiskLib_ListTransportModes() << endl; vixError = VixDiskLib_ConnectEx(&cnxParams, FALSE, "snapshot-3841", NULL, &appGlobals.connection); VixError vixError = VixDiskLib_Open(connection, "HFR_XP_Mini_2/HFR_XP_Mini_2_2-000001.vmdk", 0, &_handle) |
When executing this, the following available transport modes where shown: file:san:hotadd:nbdssl:nbd
The log shows, that the vmdk would be tried to connect via san, ndbssl and nbd but all connections fails with "You do not have access rights to this file".
I know that in my case only nbdssl or nbd are available, but on other machines SAN may be possible also so I prefer to use the automatic transport mode selection.
I was able to write to the virtual disk when I don't suppliy the snapshot reference as shown as follows:
vixError = VixDiskLib_ConnectEx(&cnxParams, FALSE, NULL,
NULL, &appGlobals.connection);
VixDiskLib: config options: libdir 'd:\workspace\VMware\vmware\Debug\libdir', tmpDir 'C:\DOKUME1\holger\LOKALE1\Temp\vmware-holger'. VixDiskLib: Advanced transport plugin was successfully loaded into vixDiskLib. Accelerated transport modes available. VixDiskLib: Enabling advanced transport modes. VMware VixDiskLib (1.1) Release build-207031 Using system libcrypto, version 9070AF NBD_Clientopen: attempting to create connection to vpxa-nfc://[VMStorage1] HFR_XP_Mini_2/HFR_XP_Mini_2_2.vmdk@esx001.hh.novastor.local:902!52 a0 1f 83 c8 f6 cd 44-bd dc e7 4c 4b f6 a7 58 Started up WSA SSLVerifyCertAgainstSystemStore: The remote host certificate has these problems:
SSLVerifyIsEnabled: failed to read registry value. Assuming verification is disabled. LastError = 0 SSLVerifyCertAgainstSystemStore: Certificate verification is disabled, so connection will proceed despite the error Opening file HFR_XP_Mini_2/HFR_XP_Mini_2_2.vmdk (vpxa-nfc://[VMStorage1] HFR_XP_Mini_2/HFR_XP_Mini_2_2.vmdk@esx001.hh.novastor.local:902!52 a0 1f 83 c8 f6 cd 44-bd dc e7 4c 4b f6 a7 58) DISKLIB-LINK : Opened 'vpxa-nfc://[VMStorage1] HFR_XP_Mini_2/HFR_XP_Mini_2_2.vmdk@esx001.hh.novastor.local:902!52 a0 1f 83 c8 f6 cd 44-bd dc e7 4c 4b f6 a7 58' (0x1a): custom, 16777216 sectors / 8 GB. DISKLIB-LIB : Opened "vpxa-nfc://[VMStorage1] HFR_XP_Mini_2/HFR_XP_Mini_2_2.vmdk@esx001.hh.novastor.local:902!52 a0 1f 83 c8 f6 cd 44-bd dc e7 4c 4b f6 a7 58" (flags 0x1a). |
So my actual problem is:
The API reference says that it is necessary to supply the snapshot reference when using SAN transport mode. But if I give that reference, the opening of the disk fails for all transport modes. If I don't give the snapshot reference I can open and write to the virtual disk (choosen tranpsort mode: NBD), but SAN transport won't be available.
In other words: When opening a disk via VixDiskLib_Open the transport mode is choosen automatically. If SAN is possible, I had had to give the snapshot reference to VixDiskLib_ConnectEx before using VixDiskLib_Open. If SAN isn't possible, the snapshot reference has to be omitted to VixDiskLib_Open as otherwise I'll got the permission error.
Regards,
Holger