rubiojr / knife-esx

@maintux's FORK IS NOW OFFICIAL: https://github.com/maintux/knife-esx
https://github.com/maintux/knife-esx
Apache License 2.0
35 stars 10 forks source link

ERROR: You have not provided a valid VMDK file. (--vm-disk) - ESXi 5 #8

Closed harryyeh closed 11 years ago

harryyeh commented 11 years ago

knife esx vm create --esx-username root \ --esx-host server1 \ --esx-password password \ --vm-disk /vmfs/volumes/DataStore-1/Ubuntu1204Server/Ubuntu1204Server.vmdk \ --vm-name vmserver1 \ --datastore DataStore-1

This is the command I am running - I have ESXi 5 - is anyone else getting this error?

Not sure if I need a template file but this

ERROR: You have not provided a valid VMDK file. (--vm-disk) is odd.

is the --vm-disk option supposed to point to an image in the DataStore or on the client machine on the chef client where you are running knife?

harryyeh commented 11 years ago

BTW my desktop operating system is Ubuntu 12.04 that I'm using

maintux commented 11 years ago

The VMDK file is copied from your local machine to the hipervisor. So I guess that the path '/vmfs/volumes/DataStore-1/Ubuntu1204Server/Ubuntu1204Server.vmdk' is wrong. If you want use a vmdk from the data store you can use the --use-template option

rubiojr commented 11 years ago

@cometcomputing sorry for the late replay. I believe @maintux did a great job explaining what --vm-disk is for. Feel free to re-open it otherwise.

Thanks!

harryyeh commented 11 years ago

Thanks for the response, I actually went through the source code and noticed there's no way to pass a directory of where the template is actually stored on the server - the code is just using all the defaults. Also if you change the name from datastore1 to something else it won't work

I was actually looking at the ESX Module and gem and

@templates_dir = opts[:templates_dir] || "/vmfs/volumes/datastore1/esx-gem/templates"

How do you actually pass in a template directory parameter with your gem?

maintux commented 11 years ago

You are right, I'll update the knife–esx code asap so will be possible to use custom template directory. stay tuned ;-)

harryyeh commented 11 years ago

Awesome, I was thinking of contributing to the project (never really done that before) with some fixes if the come along - we do a lot of stuff with ESXi, if I find some more errors I'll let you know

maintux commented 11 years ago

ok thank you so much. :-)

harryyeh commented 11 years ago

I submitted some fixes, please review them