upload files to vmware datastore command line

VMware released the first patch to ESXi 5.0 this calendar week and so I figured I'd make today "patch Friday".  Now I normally install all my ESXi updates using Update Director but this fourth dimension I decided to use the vCLI in order to check out some of the new 5.0 ESXCLI capabilities.  All-in-all information technology went very well.

First, a quick review of my surround.  I have my vCenter 5.0 server running on Windows managing a four-node ESXi v.0 cluster hosting a number of VMs.  To install the patch I'm using vMA five.0 to connect directly to each host one at a time to install the update.

Step 1:  Backups

Before doing any updates it's always a good thought to backup the host configuration.  To practice this form the vCLI use the "vicfg-cfgbackup" command:

Img-k18a-bkup

The "vicfg-cfgbackup" control creates a tarball of all the host'southward configuration files.  I ran a divide backup for all iv hosts.

Step 2:  Stage the update

Next I needed to stage the update file that I downloaded from http://www.vmware.com/back up onto a datastore that was attainable by all the hosts in my cluster.  I did this using the "browse datastore" feature in the vSphere client.  I browsed to the shared datastore where I wanted to stage the update, created a directory, and uploaded the ZIP file onto the datastore:

Img3-upload-patch

Pace 3:  Identify the update contour name

Next I needed to decide the names of the image profiles that are included with the update.  To practise this I ran the "esxcli <conn_options> software sources profile list <path to Zip>" command.

Aa1

As I desire the profile that includes VMware Tools I volition use the "ESXi-five.0.0-20110904001-standard" contour.

Step iv:  Place host into maintenance way

With the update staged and with the name of the new profile I'm ready to do the upgrade.  First I put the host into maintenance way using the "vicfg-hostops <conn_options> –operations enter" control.  Because I run DRS in fully automatic mode whatever running VMs volition exist vMotioned off the host when it is put into maintenance mode.

Img5-enter-maint-mode

Footstep 5:  Update the host

Next, I had to chose how to do the update.  It looks like the update file that I downloaded contains a full ISO prototype so I was tempted to merely practise a total install, replacing the entire image.  I noticed there is a "dry run" option to the "esxcli <conn_options> software contour install" command so I ran it.

Img9-dry-run

As you can see the dry out run came back with a warning virtually the "vmware-fdm-5.0.0-380461" package and how it will exist removed when I install the new profile.  I'm not really concerned nigh this bundle because I know when I take the host out of maintenance mode vCenter will install it onto the host.  However, the bulletin did raise a expert bespeak.  If I did have any tertiary party VIBs installed, using the install selection and overwriting the image would result in them being removed.  This got me thinking peradventure I should exercise an update instead, then I did a 2d dry-run using the "esxcli <conn_options> software profile update" command.

Img10-update-dry-run

The screen shot above is but the get-go part of the output from the "esxcli <conn_options> software profile update" control.  There was a lot of output as the command listed all the VIBs that would exist installed followed past all the VIBs that would be removed.  Every bit the patch includes VIBs for pretty much the entire image this was a lot of VIBs.  With an understanding of the difference between doing an "install" vs. an "update" I decided it would be all-time to do an update because I don't want to inadvertently remove any packages that aren't being updated, and besides the update seems a footling less intrusive.

At this point I was ready to keep with the upgrade so I ran he update command again without the "dry-run" selection.  At outset I wasn't sure if it was doing anything as my command prompt seemed to hang, but after approximately ~15 seconds the update results came dorsum showing that the update completed successfuly and that I needed to reboot the host.

Img11-post-upgrade

Footstep vi:  Reboot

I rebooted the host by running "vicfg-hostops <conn_options> –operations reboot".  The host rebooted using the updated epitome and reconnected to vCenter where I was able to verify the host was running of the new build.

Img12-post-install

Step 7:  Exit maintenance mode

I then took the host out of maintenance mode by running "vicfg-hostops –server 10.91.243.171 –operation go out"  and proceeded to upgrade the remaining three hosts.

Determination

All-in-all, pretty quick and painless.  Below is a summary of the ESXCLI commands I used.  The more I work with the ESXCLI command the more I find that I'm really liking it.  At first the commands tin can expect a bit long and intimating, but I've learned that I don't need to memorize any crazy syntax as once I got my head around the nested namespace convention used by the ESXCLI control it'due south very intuitive and really easy to use.

Summary of vCLI commands used do do the upgrade:

Fill-in the host configuration:
# vicfg-cfgbackup –server esx18a.vmworld.com –salve –username root esx18a-09162011.tgz

List image profiles in the patch:
# esxcli -southward x.91.243.171 –username root software sources contour list –depot=<path-to-zip>/ESXi500-201109001.null

Place host into maintenance mode:
# vicfg-hostops –server 10.91.243.171 –username root –operation enter

Install with dry-run pick:
# esxcli -south 10.91.243.171 –username root software profile install –depot=<path-to-nix>/ESXi500-201109001.null –dry out-run –profile=ESXi-5.0.0-20110904001-standard

Update with dry-run choice:
# esxcli -s x.91.243.171 –username root  software profile update –depot=<path-to-zip>/ESXi500-201109001.nothing –dry-run –contour=ESXi-5.0.0-20110904001-standard

Perform the update:
# esxcli -south 10.91.243.171 –username root  software profile update –depot=<path-to-naught>/ESXi500-201109001.goose egg –profile=ESXi-five.0.0-20110904001-standard

Reboot the host:
# vicfg-hostops –server ten.91.243.171 –operation reboot

Take host out of maintenance mode:
# vicfg-hostops –server 10.91.243.171 –functioning exit

teedstarountor65.blogspot.com

Source: https://blogs.vmware.com/vsphere/2011/09/patching-esxi-from-the-command-line.html

0 Response to "upload files to vmware datastore command line"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel