Hello evryone,
I have ESXI 5.0 and I have a problem when I try to install a patch :
When I want execute the CLI esxcli :
~ # esxcli software vib install --depot=/tmp/ESXi500-201207001.zip
'import site' failed; use -v for traceback
I have also tried execute esxcli from my computer :
./esxcli -s xxx -u root software vib install -d --depot=/tmp/ESXi500-201207001.zip
Enter password:
Error: Unknown command or namespace software vib install
And the /var/log/esxupdate.log is empty...
Thanks for your help !
Hi Cruncho,
try this (without symbol =):
# esxcli software vib install -d /tmp/ESXi500-201207001.zip
Hi vlho, thanks for your answer !
But same error :
'import site' failed; use -v for traceback
esxcli software vib install -d /tmp/ESXi500-201207001.zip --dry-run
"You can use the --dry-run option to preview the results of an installation or upgrade operation. A dry run of the installation or update procedure does not make any changes, but reports the VIB-level operations that will be performed if you run the command without the --dry-run option." -- VMware Docs
Hey Cruncho,
Here is a few things you can try.
First off the -d or --depot is if you have a .zip file aka an offline bundle. the -v or --viburl is if you have a .vib unpacked. Seeing as you are using a .zip you will want to use the -d
1.) Try going directly into the path where the zip file is and just running the esxcli software vib install -d esx234234234.zip file without the path
2.) Try using this: esxcli software vib install -d "/tmp/ESXi500-201207001.zip"
3) Try moving the zip file to a datastore and try it like this: esxcli software vib install -d "/vmfs/volumes/a2bb3e7c-ca10571c-cec6-e5a60cc0e7d0/patch-directory/ESXi500-201111001.zip"
Also make sure you have the right permissions on the zip file, do a ls -la to see the permissions if you are lacking any do a chmod 664
VMware KB: Installing patches on an ESXi 5.x host from the command line
Hi everyone,
Thanks everybody for your help 🙂
Unfortunately, when I want launch just 'esxcli' I have the same error " 'import site' failed; use -v for traceback"
Maybe I have a problem whith the binary or the python libraries ... ?
Thanks again for your help !
Hey Cruncho,
Are you running esxcli from the command console either via SSH or logged directly in via ILO or something? You need to be at the CLI command console on a local host to run this or run it through Vmwares vMA. Let us know as esxcli is a standard command on all ESXi 5.x builds and should be working natively.
Hi,
I access to the server only via SSH (my server is hosted)
That is wierd. Do you login as root? or do you have root level permissions?
What error do you get if you just run esxcli and hit enter?
I'm logged in root.
If I execute esxcli : 'import site' failed; use -v for traceback
And I have the same error when I want a python prompt :
# python
'import site' failed; use -v for traceback
Python 2.6.7 (r267:88850, Dec 28 2011, 00:28:55)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Yeah im not sure whats up with that host. You could call your provider and get them to look into it or log a call with VMware support. You should always be able to run esxcli as its a major command in the CLI.
Hum, ok
However, thank you for your help 🙂
Np, once you can run esxcli you have the command that will work and get your hosts patched up for you.
I have found the solution !
The problem was in the environment variables. The PYTHONPATH was not defined...
So just with an export, it works 🙂 (export PYTHONPATH=/lib/python2.6/ )
Thanks everybody
I just tried to reproduce the issue on an ESXi 5.1 host.
Please check whether a /lib/python26-visor.zip as well as a python26 sub-directory (name may be slightly different in 5.0) exist.
André
So you just ran export PYTHONPATH=/lib/python2.6/ and it worked after?
I don't understand why the python was empty...
I will check my shell.log to find the origin....