I have been scripting the creation of my Hyper-V VMs with vbscript successfully for sometime now. All the technician has to do is run my script, select the type of server they are building (EG. a Web server, SQL server, etc) and all the appropriate virtual resources are allocated (so the RAM size, disk size etc will differ depending on the function of the server).
The problem I now have is that I need to ammend the script to add a second VHD. It can either be added as secondary drive on IDE Controller 0, or it can be added to IDE Controller 1 (leaving the primary drive on IDE Controller 0).
I posted this question on StackOverflow on 22/02/12: http://stackoverflow.com/questions/9395823/scripting-the-addition-of-a-second-vhd-to-a-hyper-v-vm. I've had avery few hits and no responses so far.
I cannot work out how to modify the existing code to add the second VHD!
I suppose there are two options:
- Modify my script replacing the existing functions with a different programatic approach. Any ideas?
- If anyone knows how to do this using the command line, I can quite easily incorporate that approach into my script using the shell object.
I'm open to any suggestions.