2

I'm developing in .net, but can use c++. I'm looking for a way to create a disk image. Ideally there could be an API somewhere that looks like this:

createVMDK(string driveLetter, out string pathToVMDKOutputfile);
createVHD(string driveLetter, out string pathToVHDOutputfile);

Does anyone know of any API from Microsoft, VMWare or other that allows for the creation of full disk images like this?

kaes
  • 1,267
  • 2
  • 13
  • 17
  • +1 For a rather interesting question. I also wondered if there was some simple API function you could call to accomplish this. – Mike Bailey Jun 18 '11 at 23:37

1 Answers1

1

If there's no API, you can invoke Disk2VHD in a Process:

disk2vhd <[drive: [drive:]…]|[*]> <vhdfile>
Jim
  • 1,695
  • 2
  • 23
  • 42
  • Yes I found that tool. Problem is that you can't redestribute it legally... MS isn't licensing any of the sysinternals tools... which means you can't really use it in a commercial / production application. I guess I could make it a "pre-requisite" for installation, but given how MS isn't supporting it for that kind of usage (use from another app vs use from a user) I think that's pretty risky – kaes Jun 20 '11 at 05:24
  • 1
    So just thinking... is there any way to find out how disk2vhd is doing its work? i.e. that is _precisely_ the functionality that I want... – kaes Jun 20 '11 at 05:29
  • I know it uses VSS, but don't know about the rest. Good luck ;) – Jim Jun 20 '11 at 05:57