Error deploying virtual machine on VMware ESXi

I deployed OpenNebula 4.12.1
I followed documentation re: VMware driver and:

  1. configured ESXi hosts
  2. VMware driver in OpenNebula
  3. add ESXi hosts into OpenNebula.
  4. import VMware template

When I try to deploy VM from VMware template I get error below:
Fri May 15 12:01:33 2015 [Z0][VMM][I]: Command execution fail: /var/lib/one/remotes/vmm/vmware/deploy ‘/var/lib/one/vms/139/deployment.0’ ‘labesxc2b2’ 139 labesxc2b2
Fri May 15 12:01:33 2015 [Z0][VMM][E]: deploy: Error executing: virsh -c ‘esx://labesxc2b2/?no_verify=1&auto_answer=1’ define /var/lib/one/vms/139/deployment.0 err: /usr/bin/tty_expect: invalid option – 'c’
Fri May 15 12:01:33 2015 [Z0][VMM][I]: Wrong option. Check usage
Fri May 15 12:01:33 2015 [Z0][VMM][I]: myexpect [-h] <-p password> <-u username>
Fri May 15 12:01:33 2015 [Z0][VMM][I]: SYNOPSIS
Fri May 15 12:01:33 2015 [Z0][VMM][I]: Wraps the execution of a command and sends username & password
Fri May 15 12:01:33 2015 [Z0][VMM][I]: OPTIONS
Fri May 15 12:01:33 2015 [Z0][VMM][I]: -h prints this help.
Fri May 15 12:01:33 2015 [Z0][VMM][I]: -p the password
Fri May 15 12:01:33 2015 [Z0][VMM][I]: -u the username
Fri May 15 12:01:33 2015 [Z0][VMM][I]: complete virsh command
Fri May 15 12:01:33 2015 [Z0][VMM][I]: ExitCode: 255
Fri May 15 12:01:33 2015 [Z0][VMM][I]: out:
Fri May 15 12:01:33 2015 [Z0][VMM][I]: ExitCode: 255
Fri May 15 12:01:33 2015 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Fri May 15 12:01:33 2015 [Z0][VMM][E]: Error deploying virtual machine
Fri May 15 12:01:33 2015 [Z0][DiM][I]: New VM state is FAILED

I can connect to ESXi hosts from virsh on front-end
virsh -c esx://labesxc2b2

What did I miss in configuration?

1 Like

Have you set the username and password for the ESX user in /etc/one/vmwarerc?

Also, please note that step 4. import VMware template is not supported in the ESX drivers but rather in the vCenter drivers.

Yes, username and password for the ESX user set in /etc/one/vmwarerc
I am using the same ESX credentials when using virsh
virsh -c esx://labesxc2b2/?no_verify=1

i used this file for the ESX configuration
http://docs.opennebula.org/4.8/design_and_installation/quick_starts/qs_centos_vmware.html#qs-centos-vmware

u can check it

also you need to install the ruby gems

What OS are you using for the front-end?

Please try executing the following command:

tty_expect -u {user} -p {pass} virsh -c esx://labesxc2b2/?no_verify=1 list

where user and pass are the ESX credentials

I get the following

oneadmin@opennebula01:~$ tty_expect -u oneadmin -p ‘myPassword’ virsh -c esx://labesxc2b2/?no_verify=1 list

Id Name State

I use Ubuntu 14.04 for front-end

Could you share the vmwarerc file (removing the password)?

Hi Tino,

Here is vmwarerc file:

# Libvirt congfiguration
:libvirt_uri: “‘esx://@HOST@/?no_verify=1&auto_answer=1’”

# Username and password of the VMware hypervisor
:username: “oneadmin”
:password: “myPassword”

# VMotion configuration attributes
:datacenter: “OpenNebula”
:vcenter: “192.168.xx.xx”

# true to instruct ESX to create vswp files with disk reservation
# for memory, false for the vice versa
:reserve_memory_in_disk: true

Regards,
Dmitry

Figured this one out.
It was oneadmin password, it has some special character that I guess libvirt could not parse.
I changed password on ESX hosts and in vmwarerc file and was able to instantiate VM.

Thank you for your help.

Thank you Juan for your link.
It was very helpful.

You’re welcome
I already installed some machines in a ESx enviroment, if you need help with this you can ask me.

regards