Hi All,
I want to read and restore remote disk from a ESXi server.
The read speed is OK. it is about 1MB/s,
But the restore speed is always 64KB/s.
I have tried using large buffer size(1MB) and small buffer size(4KB).
I have tried set UNBUFFERED flag.
I have also tried to connect to another ESXi server.
All attempts get similar results.
The VDDK library is 5.0, The ESXi server is 4.0.0
The transport mode is "nbd"
my restore code snippet:
vixError = VixDiskLib_Open(_connection, path, 0, &_handle);
printf("Disk is open using transport mode \"%s\".\n", VixDiskLib_GetTransportMode(_handle));
VixDiskLibInfo* info = 0;
VixDiskLib_GetInfo(_handle, &info);
FILE* fp = fopen("disk.img", "rb");
for(size_t i=0; i<info->capacity; i+=128)
{
fread(diskbuf, VIXDISKLIB_SECTOR_SIZE, 128, fp);
VixDiskLib_Write(_handle, i, 128, diskbuf);
printf("%d\n", i);
}
fclose(fp);
VixDiskLib_FreeInfo(info);
vixError = VixDiskLib_Close(_handle);