VMware Cloud Community
cn41
Enthusiast
Enthusiast

patching esxi using CLI

hello, I have been trying to patch my ESXi 5.1 server using Cli I keep getting errors.

here is my command..

c:\program files (x86)\VMWAre\VMWare vSphere CLI>esxcli --server=xxx.xxx.xxx --username=root software vib sources list--depot=/vmfs/volumes/datastore1/

I receive the following output.

<

[MetadataDownloadError]

Could not download from depot at zip:/vmfs/volumes/4ba918b6-9a1e601f-1671-001

75207c/UPDATE/ESXI510-20142001.zip?index.xml, skipping (('zip:/vmfs/volumes/4

18b6-9a1e601f-1671-0018fe75207c/UPDATE/ESXI510-20142001.zip?index.xml', '', "

or extracting index.xml from /vmfs/volumes/4ba918b6-9a1e601f-1671-0018fe75207

PDATE/ESXI510-20142001.zip: [Errno 2] No such file or directory: '/vmfs/volum

4ba918b6-9a1e601f-1671-0018fe75207c/UPDATE/ESXI510-20142001.zip'"))

       url = zip:/vmfs/volumes/4ba918b6-9a1e601f-1671-0018fe75207c/UPDATE/ESX

0-20142001.zip?index.xml

Please refer to the log file for more details.

I was trying to get a list of VIBs first.  So that wasn't working, so I tried to update the thing with this command. 

c:\program files (x86)\VMWAre\VMWare vSphere CLI>esxcli --server=xxx.xxx.xxx --username=root software vib update --depot=/vmfs/volumes/datastore1/patches/patch.zip

I receive this output,

C:\Program Files (x86)\VMware\VMware vSphere CLI>esxcli --server=xxx.xxx.xxx -

-username=root software vib update --depot=/vmfs/volumes/VMs Datastore Partition

/UPDATE/ESXi510-20142001.zip

Enter password:

Error: Invalid option Datastore

not sure what to do...I have tried using the short name of the datastore and full ID of the datastore...please help..:smileycry:

18 Replies
JPM300
Commander
Commander

Try using this syntax

esxcli --server=xxx.xxx.xxx --username=root software vib update --depot=/vmfs/3948bee6-2c7e85c6/patches/patch.zip  or whatever the acutaly path is instead of the friendly symlink name.

See if that helps at all.  Another issue is it could be you don't have an update for a current vib and require an install?

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

thanks, JPM300, although, I have done that as well, and receive the same error...I have even tried uploading to a different data store, because there is apparently an error in the path...

so if I dont need an update, I should still be able to list the VIBs..

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>esxcli --server=1xxx.xxx.xx --username=root software vib update --depot=/vmfs/4ba918b6-9a1e601f-0018fe752

07c/UPDATE/ESXi510-20142001.zip

Enter password:

[MetadataDownloadError]

Could not download from depot at zip:/vmfs/4ba918b6-9a1e601f-0018fe75207c/UPDAT

E/ESXi510-20142001.zip?index.xml, skipping (('zip:/vmfs/4ba918b6-9a1e601f-0018fe

75207c/UPDATE/ESXi510-20142001.zip?index.xml', '', "Error extracting index.xml f

rom /vmfs/4ba918b6-9a1e601f-0018fe75207c/UPDATE/ESXi510-20142001.zip: [Errno 2]

No such file or directory: '/vmfs/4ba918b6-9a1e601f-0018fe75207c/UPDATE/ESXi510-

20142001.zip'"))

        url = zip:/vmfs/4ba918b6-9a1e601f-0018fe75207c/UPDATE/ESXi510-20142001.z

ip?index.xml

Please refer to the log file for more details.

does it have anything to do with profiles..?

Reply
0 Kudos
JPM300
Commander
Commander

Do you get the same error if you just use -d=/vmfs/volumes/ect/ect  instead of --depot?

Profiles shouldn't interfear with it.  At the worse it would just make the host non-complient

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

yep...I even tried uploading to a different datastore..same two errors...?  because the host is in a dmz, I cant use http...i dont know what to do...I was able to update using CLI before upgrading to 5.1...

thanks for your help JPM..if you think of anything, please fire away..i'm gonna keep searching the internet...

Reply
0 Kudos
JPM300
Commander
Commander

What if you try the -v switch like this:

esxcli software vib update -v /tmp/Fusion-io_bootbank_block-iomemory-vsl_2

you can try pointing to the datastore if that doesn't work and the update is small you can move it to your /tmp directory and try it from there.

the -v states it can do a file as well

esxcli.PNG

Looking more into the syntax it looks like you have two methods you can use for both the v and the d / depot

It would appear you can use -v path name or --viburl=path.

The same seems to apply to the depot syntax as well

-d /path or --depot=/path/ect/update.zip

Try some of this as well, it could be a syntax issue.  Its been awhile since I have had to do it via CLI as I use Update Manager whenever possible and find its a great product, however stand alone hosts you do unforantly have to go through this process still.

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

thanks JPM, its definately a syntax issue...this is what happens now..

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>esxcli --server=xxx.xxx.xx  --username=root software vib install -v --depot=/vmfs/volumes/4ba918b6-9a1e6

1f-1671-0018fe75207c/UPDATES/ESXi510-20142001.zip

Enter password:

Error: -v must have value

Usage: esxcli software vib install [cmd options]

Reply
0 Kudos
JPM300
Commander
Commander

Sorry my bad I should of been more clear

try running just this:

esxcli software vib update -v /tmp/Fusion-io_bootbank_block-iomemory-vsl_2

you -d or --depot

What I was trying to get at is it seems the syntax has two modes and you can use either or

if esxcli software vib update -v /vmfs/volumes/4ba918b6-9a1e61f-1671-0018fe75207c/UPDATES/ESXi510-20142001.zip

esxcli software vib update -d /vmfs/volumes/4ba918b6-9a1e61f-1671-0018fe75207c/UPDATES/ESXi510-20142001.zip

putting a -v and a --depot is why it is asking for a command for the -v as your passing the depot into it which it doesn't understand.

Let me know if that works.  Also if the update is small you could try and put it in the /tmp directory and run it from there but I don't think its a pathing issue.  I think its more of a syntax issue.

To be honest in the past I don't think I ever used -v or -d I just did esxcli software vib update vmfs/volumes/4ba918b6-9a1e61f-1671-0018fe75207c/UPDATES/ESXi510-20142001.zip  but that was awhile go

Let me know how it goes

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

okay, because this is not starting to mess with my mind...esxi.JPG the error seems to indicate that I am not inputting the correct path to the patch...

[MetadataDownloadError]

Could not download from depot at zip:/vmfs/volumes/4ba918b6-9a1e61f-1671-0018fe

5207c/UPDATES/ESXi510-20142001.zip?index.xml, skipping (('zip:/vmfs/volumes/4ba

18b6-9a1e61f-1671-0018fe75207c/UPDATES/ESXi510-20142001.zip?index.xml', '', "Er

or extracting index.xml from /vmfs/volumes/4ba918b6-9a1e61f-1671-0018fe75207c/U

DATES/ESXi510-20142001.zip: [Errno 2] No such file or directory: '/vmfs/volumes

4ba918b6-9a1e61f-1671-0018fe75207c/UPDATES/ESXi510-20142001.zip'"))

       url = zip:/vmfs/volumes/4ba918b6-9a1e61f-1671-0018fe75207c/UPDATES/ESXi5

so after using the simple path name of VMS Datastore Partition and using the ID...I get the same error above...?  *Scratching my head*

Reply
0 Kudos
JPM300
Commander
Commander

Which command did you run this time?  My last post had a few.  Also do you have another datastore without spaces?  spaces can get kinda messy with command line, however since you used the ID spaces shouldn't matter...???

Also give this a whirl

esxcli software vib update -d "/vmfs/volumes/Datastore/DirectoryName/PatchName.zip"



http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=200893...

You could also try and just CD into the path where the zip file sits so you don't have to put the path into the string.

so:

cd vmfs/volumes/datastore/DirectoryName

Then do a quick ls to make sure the file is there

Then you should just be able to do a esxcli software vib update -d patchname.zip as you are sitting in the local directory

Its very strange as you are doing everything right

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

I have run all of them.  I get the same error.

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

I tried cd into the datastore directory and it doesn't let me do that either...its so ridiculous..

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

so I cd into the directory and ran the -d option, I think this worked.  I have no blinking cursor..isnt' that the behavior ?   I totally have forgotten..

Reply
0 Kudos
cn41
Enthusiast
Enthusiast

okay...look at this attachment.  I clearly cd into the directory, verified that the ESXi510 patch was there...and recieved the same ERROR!!!!!!!

the full path to the patch is /vmfs/volumes/4ba918b6-9a1e601f-1671-0018fe75207c/UPDATE...

still get the error..

Reply
0 Kudos
JPM300
Commander
Commander

even if you are in the directory try this:

esxcli software vib update -d /vmfs/volumes/4ba918b6-9a1e601f-1671-0018fe75207c/UPDATE/ESXi510-201404001.zip

Make sure I got the zip file correct.  Also is this the proper zip file, or do the instruction from where you downloaded the zip tell you to unzip it and upload the offline bundle inside the zip?

cn41
Enthusiast
Enthusiast

that worked...JPM300..it had to be my syntax...what is confusing to me is the depot..I have two more servers to go...

I TRULY APPRECIATE YOUR HELP..

Reply
0 Kudos
JPM300
Commander
Commander

NP, I figured we would get there Smiley Happy

Glad it worked.  Just think of the depot as a directory, we are essentially just telling the updater which directory to look in.  As to the reason why they call it a Depot its probably because you can have more then 1 update in there if you want to upgrade a few things.  When I looked at your log you had the ESXIPATCH.ZIP in the Datastore\Update directory, once we got the pathing right it looks like it finally fired Smiley Happy

People think where out of the command line days, but we all know better :smileysilly:

Reply
0 Kudos
jjgunn
Enthusiast
Enthusiast

Old thread but received this error today & noticed a syntax issue myself.

correct syntax.... must use full path even if you reside in the proper directory

esxcli software vib update -d=/vmfs/volumes/{Your Local Datastore}/ESXi600-xxxxxxxxx.zip

mhdganji
Enthusiast
Enthusiast

You should put the host in maintenance mode first

Reply
0 Kudos