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: RbVmomi::Fault: FileNotFound: File [datastore1] test-vm4/test-vm4.vmdk was not found #14

Closed milesburton closed 11 years ago

milesburton commented 11 years ago

Hi all,

Using a trial edition of ESXi 5.1 I've executed the following command

knife esx vm create --vm-name test-vm4 --use-template Ubuntu_1210_template-flat.vmdk --esx-templates-dir /vmfs/volumes/datastore1/esx-gem/templates/ --verbose true --skip-bootstrap true

Which returns: Connecting to ESX host xxxx... Creating VM test-vm4 Using template Ubuntu_1210_template-flat.vmdk Cloning template... ERROR: RbVmomi::Fault: FileNotFound: File [datastore1] test-vm4/test-vm4.vmdk was not found

For the life of me this happens regardless of how I operate with some exception. If I use the --free-license true switch it will pass but the VMDK is never copied.

The VMDK itself is a bare install of Ubuntu12.10 with Tools. Nothing fancy.

maintux commented 11 years ago

hi try to remove –flat from template name. if you can, use the standard license...

milesburton commented 11 years ago

Hi,

Strangely that is no dice on ESX5.1 Ubuntu_1210_template causes the script to say Ubuntu_1210_template.vmdk doesn't exist.

I'm currently on the trial license which should be fully featured.

maintux commented 11 years ago

try knife esx template list --your_connection_info and see which templates are detected... if there isn't the Ubuntu_1210_template probably there are mistake on some directory...

Let me know

milesburton commented 11 years ago

Strangely this responds correctly: +---------------------------+ | DISK_TEMPLATES | +---------------------------+ | Ubuntu_1210_template.vmdk | +---------------------------+

milesburton commented 11 years ago

miles@Yellowknife:~/Dropbox/Misc/Chef/Development/chef-repo$ knife esx template list Connecting to ESX host ... +---------------------------+ | DISK_TEMPLATES | +---------------------------+ | Ubuntu_1210_template.vmdk | +---------------------------+ miles@Yellowknife:~/$ knife esx vm create --vm-name test-vm5 --use-template Ubuntu_1210_template.vmdk --verbose true --skip-bootstrap true Connecting to ESX host ... Creating VM test-vm5 Using template Ubuntu_1210_template.vmdk ERROR: Template Ubuntu_1210_template.vmdk not found

milesburton commented 11 years ago

Using -flat

miles@Yellowknife:~$ knife esx vm create --vm-name test-vm5 --use-template Ubuntu_1210_template-flat.vmdk --verbose true --skip-bootstrap true Connecting to ESX host ... Creating VM test-vm5 Using template Ubuntu_1210_template-flat.vmdk Cloning template... ERROR: RbVmomi::Fault: FileNotFound: File [datastore1] test-vm5/test-vm5.vmdk was not found

maintux commented 11 years ago

Ok, this is so strange. I think that you don't have the right template files in your datastore. In template directory you must have 2 files: Ubuntu_1210_template.vmdk (the virtual disk descriptor) and Ubuntu_1210_template-flat.vmdk (the real data). When you clone template, you have to use the Ubuntu_1210_template.vmdk file.

Infact if you use directly the -flat file, vmkfstools assumes that you already have the test-vm5.vmdk. Insted if you use Ubuntu_1210_template.vmdk, vmkfstools crates both files test-vm5.vmdk and test-vm5-flat.vmdk

milesburton commented 11 years ago

Ah then this'll be the problem: here's the list of the directory:

Ubuntu_1210_template-flat.vmdk
Ubuntu_1210_template.vmx Ubuntu_1210_template.nvram
Ubuntu_1210_template.vmxf Ubuntu_1210_template.vmsd
vmware.log

I created the VM by literally copying an existing blank install to the gem directory. Is there an additional step needed?

milesburton commented 11 years ago

Sounds like this could be a missed file during the copy - let me regenerate that file. Hopefully others wont stumble on this problem. I'll get back with results. - thanks for the help!

maintux commented 11 years ago

OK! In addition you can check the vmx content. There is a line with this string scsi0:0.fileName. If the value is Ubuntu_1210_template.vmdk you surely have a missing file...

let me know ;)

milesburton commented 11 years ago

Ah that looked like it worked, the image wasn't created correctly. Next up, getting chef to bootstrap properly

maintux commented 11 years ago

ok good!