Quantcast
Channel: VMware Communities : Discussion List - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 2039

VixDiskLib_Open fails with VIX_E_FILE_ACCESS_ERROR: You do not have access rights to this file

$
0
0

 

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".

 

 

 

 

Using system libcrypto, version 9070AF

                Vmacore::InitSSL: doVersionCheck = true, handshakeTimeoutUs = 20000000

                Connecting to host hh-vms on port 443 using protocol https

                Initializing SSL context

                Connected using API Namespace vim.version.version5.

                Authenticating user administrator

                Logged in!

                Performing SearchIndex find.

                MoRef vm-3724 is a valid virtual machine.

                Found vm moref=vm-3724

                Examining special transport modes.

                Checking transport mode san.

                BIOS UUID obtained: 44454c4c-3000-1050-8057-c4c04f56304a

                Performing SearchIndex find.

                Could not find virtual machine.

                Transport mode san passed pre-flight checks. Adding to list of available transports.

                Checking transport mode hotadd.

                BIOS UUID obtained: 44454c4c-3000-1050-8057-c4c04f56304a

                Performing SearchIndex find.

                Could not find virtual machine.

                Transport mode hotadd failed pre-flight check. Ignoring.

                Checking transport mode nbdssl.

                Transport mode nbdssl passed pre-flight checks. Adding to list of available transports.

                Checking transport mode nbd.

                Transport mode nbd passed pre-flight checks. Adding to list of available transports.

                Creating mount directory C:\DOKUME1\holger\LOKALE1\Temp\vmware-holger\4220a60a-93a8-bdf2-f197-f922e2e1dbb3-vm-3724\san.

                Starting to write unmount info.

                Mount operation obtained backup info.

                Successfully mounted snapshot ssid:snapshot-3841 on mount point C:\DOKUME1\holger\LOKALE1\Temp\vmware-holger\4220a60a-93a8-bdf2-f197-f922e2e1dbb3-vm-3724\san

                Got credentials to access disk HFR_XP_Mini_2/HFR_XP_Mini_2_2-000001.vmdk using mode san.

                Obtained list of SCSI disk devices.

                Establishing new connection for hh-vms:administrator

                Connecting to host hh-vms on port 443 using protocol https

                Connected using API Namespace vim.version.version5.

                Authenticating user administrator

                Logged in!

                Starting to fetch block map.

                Performing SearchIndex find.

                VM Hosted by VMware ESX, version 4.0.0

                Trying to open new LUN LVID:4b025e16-05da754e-d68b-00212800629e/499e95bd-33bc1e15-c5d3-00144feb150a/1.

                Attempting to open LVID:4b025e16-05da754e-d68b-00212800629e/499e95bd-33bc1e15-c5d3-00144feb150a/1.

                No path to device LVID:4b025e16-05da754e-d68b-00212800629e/499e95bd-33bc1e15-c5d3-00144feb150a/1 found.

                Failed to open new LUN LVID:4b025e16-05da754e-d68b-00212800629e/499e95bd-33bc1e15-c5d3-00144feb150a/1.

                Cannot access LUN LVID:4b025e16-05da754e-d68b-00212800629e/499e95bd-33bc1e15-c5d3-00144feb150a/1, cannot open disk snapshot-3841[VMStorage1] HFR_XP_Mini_2/HFR_XP_Mini_2_2-000001.vmdk. Giving up.

               

                Closing connection hh-vms:administrator

                Creating mount directory C:\DOKUME1\holger\LOKALE1\Temp\vmware-holger\4220a60a-93a8-bdf2-f197-f922e2e1dbb3-vm-3724\nbdssl.

                Starting to write unmount info.

                Mount operation obtained backup info.

                Successfully mounted snapshot ssid:snapshot-3841 on mount point C:\DOKUME1\holger\LOKALE1\Temp\vmware-holger\4220a60a-93a8-bdf2-f197-f922e2e1dbb3-vm-3724\nbdssl

                Sending soap request to : randomAccessOpenReadonly

                Received soap response from : randomAccessOpenReadonly

                Got credentials to access disk HFR_XP_Mini_2/HFR_XP_Mini_2_2-000001.vmdk using mode nbdssl.

                NfcFssrvr_DiskOpen: received NFC error 11 from server: NfcFssrvrOpen: permission check failed for file HFR_XP_Mini_2/HFR_XP_Mini_2_2-000001.vmdk, access = 3

                Creating mount directory C:\DOKUME1\holger\LOKALE1\Temp\vmware-holger\4220a60a-93a8-bdf2-f197-f922e2e1dbb3-vm-3724\nbd.

                Starting to write unmount info.

                Mount operation obtained backup info.

                Successfully mounted snapshot ssid:snapshot-3841 on mount point C:\DOKUME1\holger\LOKALE1\Temp\vmware-holger\4220a60a-93a8-bdf2-f197-f922e2e1dbb3-vm-3724\nbd

                Sending soap request to : randomAccessOpenReadonly

                Received soap response from : randomAccessOpenReadonly

                Got credentials to access disk HFR_XP_Mini_2/HFR_XP_Mini_2_2-000001.vmdk using mode nbd.

                NfcFssrvr_DiskOpen: received NFC error 11 from server: NfcFssrvrOpen: permission check failed for file HFR_XP_Mini_2/HFR_XP_Mini_2_2-000001.vmdk, access = 3

               Error:   d 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:

 

                

  • A certificate in the host's chain is based on an untrusted root.

               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

 

 


Viewing all articles
Browse latest Browse all 2039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>