Since VixDiskLib_Create does not work with ESX, how then do we create a redo file? Create one locally, clone it, then Attach? The clone process gives you a file the size of your original. Not very space saving...
You can create a snapshot for a VM using VI api. I don't think that's what you are looking for though, can you explain what you are trying to do?
-Sudarsan
I was looking for a way to create a redo log of a VM with the new VDDK, like I can do for hosted disks. I guess there is none. But then, what is the Attach() function good for? You can't create a new disk directly, and if you create a hosted disk and clone it, you get a monolithic flat disk. If all i wanted was to read read the redo log I created with the VI SDK, I would simply Open() that one directly.
One usecase : open a managed disk read-only, create a local child and attach the managed disk to form a chain that is 'writable'. This is needed for such tools that need read-write access to a volume (win2k) though there may be no 'writes'.
-Sudarsan
I agree that this VDDK stuff is quite confusing.
VixDiskLib_Create creates hosted disks. The documentation says (not describes!!!) that for managed virtual disks you should first create a hosted disk, and then clone it to a managed one.
Anyway, VixDiskLib_CreateChild should create redo logs for both, managed and hosted disks (I did not get that to work either).
Documentation is quite poor on VixDiskLib!!
Tos2k
Okay, just to see if I understood that right:
1) ESX hosting a VM
2) my local win host hosts vddk
3) CreateChild creates a local (on the local win host) redo file for the remote VM (on ESX)
4) I can write to the local redo log
5) attaching the parent to the child is basically a commit, that will merge the changes contained by the local redo file into the parent disk?
Thx, Tos2k
5 - Attaching is simply that - it adds a new child disk to the chain of disks. All writes will now go to the new child. There is no 'commit' done - ie the older disks are not modified. You can throw away the child disk and the changes will disappear.
For example, say you have a disk on an datastore that is read-only, and you want to be able to mount a volume from this disk on Windows. Further, Windows 2k does not let you mount a volume in read-only mode, but actually needs to write to this volume. So you create a local child disk and attach it to the read-only disk on esx. You can now mount the volume(s) on this disk chain and let Windows write whatever it needs to, but these changes are not to be made persistent, so you can just throw away the child disk.
As you state, child creation works only locally - ie you can't create a child disk on an esx datastore (just like you can't create a disk on a datastore).
Hope that clarifies,
Sudarsan
OK! How then do one go forward to create a child disk, or a new disk, on an ESX datastore?
You should create a snapshot using the VI api's. This will (among other things) create a child disk.
-Sudarsan
