I have problem opening a disk when vmdk path contain a ñ or invalid char. I am using a .net wrapper to invoke vddk and i have tried to escape chars from .net but I cant find the solution. Any help on how can I escape these chars?
vixdisklib_open vmdk path eschape chars
compilation failure on SUSE 11 SP1
I am getting following error when I am trying to compile the sample code with vddk api
:~/vddk/vmware-vix-disklib-distrib/doc/sample # make
g++ -o vix-disklib-sample `pkg-config --cflags --libs vix-disklib` vixDiskLibSample.cpp
Package vix-disklib was not found in the pkg-config search path.
Perhaps you should add the directory containing `vix-disklib.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vix-disklib' found
/tmp/cceC4nxk.o: In function `DoRWBench(bool)':
vixDiskLibSample.cpp:(.text+0x273): undefined reference to `VixDiskLib_GetInfo'
vixDiskLibSample.cpp:(.text+0x35b): undefined reference to `VixDiskLib_FreeInfo'
vixDiskLibSample.cpp:(.text+0x3e9): undefined reference to `VixDiskLib_Read'
vixDiskLibSample.cpp:(.text+0x422): undefined reference to `VixDiskLib_Write'
/tmp/cceC4nxk.o: In function `DoClone()':
vixDiskLibSample.cpp:(.text+0x63c): undefined reference to `VixDiskLib_Connect'
vixDiskLibSample.cpp:(.text+0x726): undefined reference to `VixDiskLib_Clone'
vixDiskLibSample.cpp:(.text+0x733): undefined reference to `VixDiskLib_Disconnect'
/tmp/cceC4nxk.o: In function `DoDump()':
...
..
also when I check if the said ".pc" file exist I found it in following location
:~/vddk/vmware-vix-disklib-distrib/doc/sample # find / -name vix-disklib.pc
/usr/lib/pkgconfig/vix-disklib.pc
So it seems that the package is installed correctly. Can anybody help?
How to get the mapping from VMDK file to the physical disk
Hi,
I'm new in this area. Maybe someone already posted the similar question. We want to get a mapping between the VMDK files and the physical disk.
I can open the vmx file and get the content. But it only gives me the logical location, such as /vmfs/volumes/storage1/TestVM1/TestVM1.vmdk. But how do I know which physical hard disk this vmdk file is located? For example, /dev/sda or /dev/sdb.
Thanks.
sike
CBT for eager zero disks
Hey guys i just want to ask maybe a stupid question.
is there a prospect that i can in the future only backup the used blocks of a eager zeroed disc in a full backup? (Today i have to backup hole disc space)
In my opinion while disc is created and all blocks are set to 0 the hypervisor is able to track that a block is never touched by the vm so there should be a way to skip this never touched 0 blocks?!
Tell me if i am totally wrong or if there mght be a way in near future.
Thanks
Application doesn't return exit code when using VDDK 5.1/5.1.1
Hello
We've compiled the following code against VDDK 5 U1, 5.1 and 5.1.1 on Windows as x32 application.
int main(int argc, char *argv[]) { VixError ret; char *msg = NULL; if(VIX_OK != (ret = VixDiskLib_InitEx(1, 1, m_logfunc, m_warnfunc, m_panicfunc, "libdir", "config.vddk"))) { cout << "VixDiskLib_InitEx" << endl; return ret; } VixDiskLib_Exit(); cout << "\nRETURN 42" << endl; return 42;
}
In case using VDDK 5 and it's dll's the application is returning 42 as expected.
In case using 5.1 and above, the application is returning 0 most of the times.
The problem arises in case the diskLibPlugin.dll can be found and is beeing initialized.
In this case the application will return 0.
If the dll isn't available and cannot be initialized, the return code will be the expected 42.
Any hints how to resolve this issue?
Regards
vmware vdiskmanager User not authorized for host agent contact.
Hi guys,
I've been trying for a couple o' days now to export a vmdk from ESXi to my local machine using vmware vdiskmanager and the command as follows:
vmware-vdiskmanager -S -h 192.168.1.9 -u myuser -f "E:\password.txt" -t 0 -r "[datastore1] TestVm/TestVm.vmdk" "E:\vm.vmdk"
myuser belongs to the Administrator group but whenever I run that command I get the following:
[NFC ERROR] NfcNewAuthdConnectionEx: Failed to connect to peer. Error: 550 User not authorized for host agent contact
VixDiskLib: NFC Error during user connect: 550 User not authorized for host agent contactFailed to convert disk: Cannot connect to the host (0x4650).
If I issue the same command with the root user, it works just fine, but I need it to work with an Administrator account.
I couldn't find anything on why it shouldn't work with an administrator account, given that the root account belongs to the same group.
Any thoughts would be kindly appreciated.
Thanks!
VDDK 5.1.1 segfaults
Hi,
I've been working on a project where the VM's from vCenter are being backed up through VDDK-VADP and it works sufficiently.
However, we use the old VDDK on old CentOS 5 and I tried to renew all of this. I downloaded VDDK 5.1.1, updated CentOS to 6.3 and made few modifications to our application and it fails, when trying to dump the vmdk disk, because of segfault in the libvmacore. Have anyone experienced such behaviour?
We are using this application https://github.com/starpos/vmbkp#readme and traces of the segfault are here (valgrind) and here (strace).
Thanks in advance..
vstor2-mntapi10.sys installation
Hi,
Our application will use vmware-mount.exe, and here is written vstor2-mntapi10.sys can be redistributed, so I'd like to install it manually, without installation of whole VDDK.
What should I do to install vstor2-mntapi10.sys? May be some installation script already exists?
Best regards,
Sergey.
Issue with advanced transport methods. VixDiskLib_Open alway open with "nbd"
Hi All ,
I am writing application to access the disk by using the advanced transport methods for Linux 64 bit. I have downloaded and instaleed VDDK 5.1.1 for Linux 64 bit. When i access the disk by SAN or hotadd it is saying that SAN and hotadd supported but it is not opening the disk with SAN or hot-add. Instead it is opening by ndb all the time. command line parameters are:
./sanv_rep -info -host <name> -user root -password <password> -mode san -libdir /usr/lib/vmware-vix-disklib -vm vmPath=ha-datacenter/vm/TEST "[datastore1] TEST/TEST.vmdk"
LOG IS AS FOLLOWS
==================================================================================================================================================
Log: VixDiskLib: linuxVerifySSLCertificates is 0
Log: VixDiskLib: config options: libdir '/usr/lib/vmware-vix-disklib', tmpDir '/tmp/vmware-root'.
Log: OBJLIB-LIB : Objlib initialized.
Log: VixDiskLib: Attempting to locate advanced transport module in "/usr/lib/vmware-vix-disklib".
Log: VixDiskLib: Advanced transport plugin was successfully loaded into vixDiskLib.
Log: VixDiskLib: Enabling advanced transport modes.
Log: OBJLIB-LIB : Objlib initialized.
Log: VixDiskLib: Transport modes available: file:nbdssl:nbd:san.
Log: VMware VixDiskLib (5.1) Release build-1042608
Log: 2013-05-31T20:40:33.357+05:30 [7F503C1C5720 info 'Libs'] GVMOMI request limit: -1
Log: VixDiskLib: VixDiskLibResolveHostName: resolving 172.168.1.114
Log: VixDiskLib: VixDiskLibResolveHostName: returned 172.168.1.114
Log: VixDiskLib: Added thumbprint 69:35:B3:A9:BB:47:DB:B0:8C:C9:49:C1:8C:37:B7:D3:FD:BB:58:D8 to sslIdDb for 172.168.1.114
Log: VixDiskLibVimResolveHostName: Resolving IP address for hostname 172.168.1.114.
Log: VixDiskLibVimResolveHostName: Resolved to 172.168.1.114.
Log: VixDiskLibVim: VixDiskLibVimLogin
Warning: HostAgent is not a VirtualCenter, cannot disable sVmotion.
Log: VixDiskLibVim: VixDiskLibVimLogout
Log: VixDiskLib: VixDiskLibResolveHostName: resolving 172.168.1.114
Log: VixDiskLib: VixDiskLibResolveHostName: returned 172.168.1.114
Log: VixDiskLib: Added thumbprint 69:35:B3:A9:BB:47:DB:B0:8C:C9:49:C1:8C:37:B7:D3:FD:BB:58:D8 to sslIdDb for 172.168.1.114
Log: VixDiskLibVimResolveHostName: Resolving IP address for hostname 172.168.1.114.
Log: VixDiskLibVimResolveHostName: Resolved to 172.168.1.114.
Log: VixDiskLibVim: VixDiskLibVimLogin
Log: VixDiskLibVim: TicketFindVMByInvPath: vmxPath = -ha-datacenter/vm/TEST-
Log: VixDiskLibVim: VixDiskLibVimLoadVM
Log: VixDiskLibVim: TicketLoadInternalSic
Log: VixDiskLibVim: VixDiskLibVimLoadVMCb
Log: VixDiskLibVim: TicketLoadNfcTicket: Request RandomAccessRO diskKey = 2000, readOnly = 1, openSnapshot = 0
Log: VixDiskLibVim: VixDiskLibVimLogout
Log: VixDiskLib: Found Thumbprint for 172.168.1.114 in memory database
Log: VixDiskLib: Thumbprint for 172.168.1.114 not found in memory database
Log: NBD_ClientOpen: attempting to create connection to ha-nfc://[datastore1] TEST/TEST.vmdk@172.168.1.114:902
Log: Opening file [datastore1] TEST/TEST.vmdk (ha-nfc://[datastore1] TEST/TEST.vmdk@172.168.1.114:902)
Log: DISKLIB-LINK : Opened 'ha-nfc://[datastore1] TEST/TEST.vmdk@172.168.1.114:902' (0x1e): custom, 33554432 sectors / 16 GB.
Log: DISKLIB-LIB : Opened "ha-nfc://[datastore1] TEST/TEST.vmdk@172.168.1.114:902" (flags 0x1e, type custom).
Disk "[datastore1] TEST/TEST.vmdk" is open using transport mode "nbd".
capacity = 33554432 sectors
number of links = 1
adapter type = LsiLogic SCSI
BIOS geometry = 0/0/0
physical geometry = 2088/255/63
Transport modes supported by vixDiskLib: file:san:hotadd:nbdssl:nbd
Log: VixDiskLib: VixDiskLibResolveHostName: resolving 172.168.1.114
Log: VixDiskLib: VixDiskLibResolveHostName: returned 172.168.1.114
Log: VixDiskLib: Added thumbprint 69:35:B3:A9:BB:47:DB:B0:8C:C9:49:C1:8C:37:B7:D3:FD:BB:58:D8 to sslIdDb for 172.168.1.114
Log: VixDiskLibVimResolveHostName: Resolving IP address for hostname 172.168.1.114.
Log: VixDiskLibVimResolveHostName: Resolved to 172.168.1.114.
Log: VixDiskLibVim: VixDiskLibVimLogin
Warning: HostAgent is not a VirtualCenter, cannot enable sVmotion.
Log: VixDiskLibVim: VixDiskLibVimLogout
Log: VixDiskLib: VixDiskLib_Exit called. Unmatched Init calls so far: 1.
Log: OBJLIB-LIB : ObjLib cleanup done.
Log: 2013-05-31T20:40:37.170+05:30 [7F503C1C5720 trivia 'Default'] Starting to shut down worker thread pool.
Log: 2013-05-31T20:40:38.170+05:30 [7F503C1C5720 trivia 'Default'] Worker thread pool is shut down.
===================================================================================================================================================
I have modified code by calling VixDiskLib_PrepareForAccess and VixDiskLib_EndForAccess calling unconditionally. Still it didnt help.
Can u please help me to fix this issue.
thanks,
Pavan
Can't able to open the drive after mounting VMDK file of 2012 guest os using vddk's vmware-mount.exe
Hi
I am trying to mount the vmdk file of 2012 guest OS using VDDK(5.0,5.1,5.1.1) vmware-mount.exe.
It has mounted the disk but while i'm trying to open the drive in command prompt it will return the following error"A device attached to the system is not functioning."
I have tried the following steps
Command Prompt 1: (Mounting the vmdk file)
=================================================================================================
C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe
No volumes mounted.
C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe T: "F:\Vmdk_Files\2012-guest_os.vmdk"
C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount.exe
T:\ => F:\Vmdk_Files\2012-guest_os.vmdk
C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin>
=================================================================================================
Command Prompt 2:(Trying to open the mounted disk with the drive letter)
======================================================
C:\>T:
A device attached to the system is not functioning.
C:\>
======================================================
How can i view the files inside the disk.
Thanks in advance.
Thanks & Regards
Manickam
Vddk wrapper in C# gives VIX_E_INVALID_ARG ie.,"One of the parameters was invalid." error
Hi,
I am using Vddk API to mount and manage vmdk files in C#. I am using a wrapper class from " http://communities.vmware.com/thread/193704?start=0&tstart=0 " to convert C# calls to C++ . When I try to connect to a remote vcenter server/esx host using VixDiskLib_Connect, I get the Error Code :3 – VIX_E_INVALID_ARG ie.,"One of the parameters was invalid. A direct C++ connect call works. C# connect to local vmdk works as well.
C# program that calls the connect method:
using System;
using System.Runtime.InteropServices;
namespace Connect2VMwareServer2
{
class Program
{
private static readonly uint VIXDISKLIB_FLAG_OPEN_READ_ONLY = 4;
static void Main(string[] args)
{
string libDir="C:\\Program Files (x86)\\VMware\\VMware Virtual Disk Development Kit\\";
ulong vixError = vixDisk.VixDiskLib_Init(1, 0, null, null, null, libDir);
VixDiskLibConnectParams vxConParams = new VixDiskLibConnectParams();
vxConParams.serverName = "192.168.11.40";
vxConParams.port = 902;
vxConParams.creds.uid.userName = "root"; // UPDATE with good value
vxConParams.creds.uid.password = "PASSOWRD"; // UPDATE with good value
vxConParams.vmxSpec = "moRef=3"; //UPDATE with good value, vm moid
vxConParams.credType = VixDiskLibCredType.VIXDISKLIB_CRED_UID;
IntPtr pConnection = IntPtr.Zero;
vixError = vixDisk.VixDiskLib_Connect(vxConParams, ref pConnection); // EXCEPTION OCCURS HERE ( ERROR CODE : 3 /14008)
}
}
}
I am stuck here terribly. Kindly suggest where I am going wrong. If I pass reference to vxConParams, I get the error "14008 – VIX_E_HOST_SERVER_NOT_FOUND ie., "The specified server could not be contacted.".
Regards,
Murugan
How to access VM disk
I have created a snapshot and its name is in the form of RHEL6x64bit-000009.vmdk. I am able to access the disk when it is powered off. But i am not able to access the snapshot file when the VM is powered on.
What i understand that we should create a redo log for a snapshot. I am trying to use the DoRedo() function to understand in the sample but still it is throwing an error stating that disk is in use when i call this function :
vixError = VixDiskLib_CreateChild(parentDisk.Handle(),
appGlobals.diskPath,
VIXDISKLIB_DISK_MONOLITHIC_SPARSE,
NULL, NULL);
and also QueryDiskChangedArea API its work fine when VM is powered off but not when VM is powered on. Can some help me to solve this issue. BTW i am using Linux64 bit ans also can someone tell me the command line parameters i have to pass for vixdisklibsample to invoke DoRedo function.
One more thing is that vixdisklib options works fine when the source vm is powered of but it will not work when is powered on.
For ex:-
./sanv_rep -dump -host 172.168.1.114 -user root -password Sanovi123$ "[datastore1] ACTVM/ACTVM.vmdk"
[NFC ERROR] NfcFssrvrProcessErrorMsg: received diskLib error 16392 from server: NfcFssrvrOpen: Failed to open '[datastore1] ACTVM/ACTVM.vmdk': Failed to lock the file
Error: [vixDiskLibSample.cpp:606] 40080000000f The file is already in use
with thanks,
Santosh
Unable to accessing VMDK files of Windows 2012 Guest os with VixMntApi. (VMDK files of other guest OSs are working fine)
Hi,
I have mounted the the VMDK file with the following API and got a handle to it.
I have opened the disk using
VixDiskLib_Open(
vixDiskLibCon,
fileName,
VIXDISKLIB_FLAG_OPEN_READ_ONLY,
&vixDiskLibHandle);
[I have tried with the other two flags(VIXDISKLIB_FLAG_OPEN_UNBUFFERED,VIXDISKLIB_FLAG_OPEN_SINGLE_LINK) also]
And i have got the device path for the volume like \\.\vstor2-mntapi10-shared-D62BC271000071180000000002000000\
Then i'm trying to list the files inside the volume by using Windows API(FindFirstFile())
string volPath = \\.\vstor2-mntapi10-shared-D62BC271000071180000000002000000\\*
HANDLE h = FindFirstFile(volPath.c_str() , &fd);
but it returns INVALID_HANDLE_VALUE as result and the GetLasterror() returns error code as 19
For The System error code 19, MSDN says that "The media is write protected".
Again, this is happening only for the VMDK files of Windows 2012 guest OS.
Any help on this is much appriciated.
Thanks
Manickam
Requires clarification on accessing snapshot files
I have Linux 64 bit VM. I have enable CTK and then taken a snashots.I have taken about 5 snapshots before that and deleted all.
Now by calling QueryDiskChangedArea("*") got a vector of offset to write and i did active blocks written to destination VM.I used base disk to open and write it.
When i power on the vm its showing the old files. New files whatever i copied between the snapshot creation and deletion is not showing.
Siva, you told that once we delete the snashot all the containts will be merged to base disk.If i power off the VM and open the current snapshot file and write it , its seems to be working.
Need a clarification on the steps.Can some one please clarify this.
with thanks,
Santosh
VMware Virtual Disk Manager - [NFC ERROR] NfcNetTcpRead: bRead: -1
Getting NFC error when trying to download VMDK using VMware Virtual Disk Manager.
VDDK version: 5.1.0-774844
Error detail:
Creating disk 'C:\BACKUP\VM01_2.vmdk'
SSL_VerifyCbHelper: Certificate verification is disabled, so connection will proceed despite the error
SSL_VerifyCbHelper: Certificate verification is disabled, so connection will proceed despite the error
SSL_VerifyCbHelper: Certificate verification is disabled, so connection will proceed despite the error
Convert: 27% done.[NFC ERROR] NfcNetTcpRead: bRead: -1
[NFC ERROR] NfcNet_Recv: requested 261664, recevied only 163840 bytes
[NFC ERROR] NfcFile_RecvMessage: data recv failed. retval = 3, expected 261664
[NFC ERROR] NFC_NETWORK_ERROR
Any help would be appreciated.
VMware Virtual Disk Manager - Received signal 11
Getting error message "Received signal 11" when trying to download VMDK using VMware Virtual Disk Manager (VDDK 5.1.1-1042608). Tried with multiple versions of ESXi (4.1.0-260247, 5.1.0-1065491, 5.1.0-799733) and getting same result.
VDDK 5.1.0-774844 does not produce this error.
Any help would be appreciated.
Virtual Disk Development Kit: config.ini & settings.ini
I am getting the following errors in vdiskmanager.log:
sg_Reset:
[msg.dictionary.load.openFailed] Cannot open file "C:\ProgramData\VMware\VMware Virtual Disk Development Kit\config.ini": The system cannot find the file specified.
----------------------------------------
PREF Optional preferences file not found at C:\ProgramData\VMware\VMware Virtual Disk Development Kit\config.ini. Using default values.
Msg_Reset:
[msg.dictionary.load.openFailed] Cannot open file "C:\ProgramData\VMware\VMware Virtual Disk Development Kit\settings.ini": The system cannot find the file specified.
----------------------------------------
PREF Optional preferences file not found at C:\ProgramData\VMware\VMware Virtual Disk Development Kit\settings.ini. Using default values.
Msg_Reset:
[msg.dictionary.load.openFailed] Cannot open file "C:\ProgramData\VMware\VMware Virtual Disk Development Kit\config.ini": The system cannot find the file specified.
----------------------------------------
PREF Optional preferences file not found at C:\ProgramData\VMware\VMware Virtual Disk Development Kit\config.ini. Using default values.
If I create a blank text files for config.ini and settings.ini the errors are no longer logged. My question is; are there certain settings that I can add to these files to either improve performance, change transport mode, etc.?
Thanks in advance.
Where to put VixDiskLib_Cleanup ?
Hi !
The docu says, I should always call VixDiskLib_Cleanup to cleanup some state in some case. I'm wondering where to put it exactly. I checked the vixDiskLibSample - it doesn't call it at all.
Right now I do it like this
VixDiskLib_Disconnect(srcConnection);
VixDiskLib_EndAccess(&connectParams, "MyApp");
VixDiskLib_Cleanup(&connectParams, &numcleanedup, &numremaining);
VixDiskLib_Exit();
Maybe I should put it before EndAccess() ? Maybe behind Exit() ? I have no idea.
Thx
intripoon
VixDiskLib_PrepareForAccess always returns 1 or 20
Hi !
I noticed that for me
VixDiskLib_PrepareForAccess
always Returns 1 (FAIL) when called on vcenter and 20 (VIX_E_NOT_SUPPORTED_ON_REMOTE_OBJECT) when called on esxi directly.
It this correct?
I'm not exactly sure what this function actually does. I think basically it disables vmotion. So VIX_E_NOT_SUPPORTED_ON_REMOTE_OBJECT makes somewhat sense for esxi. But FAIL for vcenter? Does it return that if there is no vmotion Operation running right now?
If this is wrong, could I get a complete example of how to fill the VixDiskLibConnectParams structure for calling this method? moRef=XXXX is not clear to me. What should XXXX be? I found various things put in there like the vmname or some number I don't know where to get from. Sometimes it's not moRef= but moid=[number]. Sometimes ist written "moref" and sometimes "moRef".
Thx
intripoon
The VMDK chain gets broken after using VixDiskLib_CheckRepair() for a file(other than the last child) in the VMDK chain.
Hi,
I'm opening a VMDK file in R/W mode and processing it.In mid of this the application gets crashed before closing the VMDK file.
If the application crashes before closing the VMDK file.,We will not be able to open the vmdk file again.
As Thomas suggested earlier (http://communities.vmware.com/thread/438208) ,I'm using the below method to Repair and reuse the VMDK file.
// Open disk to mount
VixDiskLibHandle lnv_mountDiskHandle = NULL;
li_vixError = VixDiskLib_Open(lnv_connection, MOUNT_DISK_NAME,
MOUNT_RW ? 0 : VIXDISKLIB_FLAG_OPEN_READ_ONLY, &lnv_mountDiskHandle);
if (VIX_ERROR_CODE(li_vixError) == VIX_E_DISK_NEEDSREPAIR)
{
li_vixError = VixDiskLib_CheckRepair(lnv_connection, MOUNT_DISK_NAME,
TRUE);
li_vixError = VixDiskLib_Open(lnv_connection, MOUNT_DISK_NAME,
MOUNT_RW ? 0 : VIXDISKLIB_FLAG_OPEN_READ_ONLY
, &lnv_mountDiskHandle);
}
ABORT_IF_ERROR(li_vixError)
The Repair method is changing the CID of the VMDK file in Descriptor file.
In my case I'm having the below VMDK chain
win2012-flat.vmdk
win2012-child1.vmdk
win2012-child2.vmdk
win2012-child3.vmdk
In the above chain if i will open and use the last file (win2012-child3.vmdk) and Repair it for using aging.
The VixDiskLib_CheckRepair() method is changing the CID of the file.But it will not affect anything in the above scenario because I'm opening the last file of the chain.
But if i will open the VMDK file other than the last file in the chain.,The VixDiskLib_CheckRepair() method is changing the CID of the file and it is affecting the chain.
Example:
If i will open the first child(win2012-child1.vmdk) and Repair it while opening it after the application crash.
The VixDiskLib_CheckRepair() method is changing the CID of the file(win2012-child1.vmdk).
In the chain the second child[win2012-child2.vmdk] (Immediate child of the opened file) is having the CID of the Parent VMDK file[parentCID=8d7a6a29]
But while repairing the first child it will change the CID of that file.,But the second child[win2012-child2.vmdk] having the older parentCID of the win2012-child1.vmdk file so the link gets broken.
If i will open the VMDK file(from Child 2) After the above scenario.,It throws the below error
"The parent virtual disk has been modified since the child was created.The content ID of the parent virtual disk does not match the corresponding parent content ID in the child."
How to solve this issue?
Any help on this is much appreciated.
Thanks
manickam