A quick note for anyone out there who is struggling with the problem I had. I have a template for a VM that I use to create more nodes. I want to be able to control where the new vmdk file gets stored. If you run it with the default options for a vm template called ‘node’ it will store it in a path ‘node_1′. Obviously that’s not what you would want if you are trying to build more than on instance and want your files and directories in the right order.
When you run it with the –dry-run option it shows a number of options but the way to override them is not very obvious. Here’ the output of when you run it with –dry-run
leonardo:VirtualBox rp$ VBoxManage import node-ubuntu10.10-template.ova --dry-run
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /Users/rp/VirtualBox/node-ubuntu10.10-template.ova...
OK.
Disks: vmdisk1 5368709120 -1 http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized node-ubuntu10.10-template-disk1.vmdk -1 -1
Virtual system 0:
0: Suggested OS type: "Ubuntu"
(change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all possible values)
1: Suggested VM name "node_1"
(change with "--vsys 0 --vmname <name>")
2: Number of CPUs: 2
(change with "--vsys 0 --cpus <n>")
3: Guest memory: 512 MB
(change with "--vsys 0 --memory <MB>")
4: USB controller
(disable with "--vsys 0 --unit 4 --ignore")
5: Network adapter: orig Bridged, config 3, extra slot=0;type=Bridged
6: CD-ROM
(disable with "--vsys 0 --unit 6 --ignore")
7: IDE controller, type ICH6
(disable with "--vsys 0 --unit 7 --ignore")
8: IDE controller, type ICH6
(disable with "--vsys 0 --unit 8 --ignore")
9: SATA controller, type AHCI
(disable with "--vsys 0 --unit 9 --ignore")
10: Hard disk image: source image=node-ubuntu10.10-template-disk1.vmdk, target path=/Users/rp/VirtualBox/node_1/node-ubuntu10.10-template-disk1.vmdk, controller=9;channel=0
(change target path with "--vsys 0 --unit 10 --disk path";
disable with "--vsys 0 --unit 10 --ignore")
So in order to change the path, note the point number 10. the additional argument needed to be passed would be --vsys 0 --unit 10 --disk
. So to boot a new machine called dev-web-01 and create a vmdk with the same name, the following command will do that:
$ import node-ubuntu10.10-template.ova --vsys 0 --vmname dev-web-01 --unit 10 --disk dev-web-01/dev-web-01.vmdk
