user1603185
user1603185

Reputation: 23

Is there any way to programatically create hyper-v machines?

Is there any way to programatically( in C++ ) create hyper-v machines. I've hypervisor installed in Windows 2k8 R2 server.

Thanks.

Upvotes: 2

Views: 1851

Answers (1)

Donal Lafferty
Donal Lafferty

Reputation: 5966

Probably best to start from an PowerScript example and work back to what the C++ should be.

Here is an example that uses WMI to create VM object. The WMI objects will be the same in C++, so you should be able to translate this example.

Next, you need to attach a VHD to the VM to act as root device, and you'll want to start that VM. For a detailed example have a look at how OpenStack's Hyper-V driver implements VM creation. Again, the WMI objects are the same in C++, so you should be able to translate to C++

Upvotes: 1

Related Questions