{"id":5309,"date":"2017-12-20T20:57:35","date_gmt":"2017-12-21T02:57:35","guid":{"rendered":"http:\/\/neosmart.net\/wiki\/?p=5309"},"modified":"2017-12-20T20:57:35","modified_gmt":"2017-12-21T02:57:35","slug":"upgrading-vsphere-esxi-from-the-command-line-automatically","status":"publish","type":"post","link":"https:\/\/neosmart.net\/wiki\/upgrading-vsphere-esxi-from-the-command-line-automatically\/","title":{"rendered":"Upgrading ESXi 6.5 automatically from the command line without vSphere"},"content":{"rendered":"<p>The traditional approach to upgrading vSphere and VMware ESXi involves manually downloading the VIB (short for &#8220;vSphere Installation Bundle&#8221;) and executing the ESXi <code>esxcli<\/code>\u00a0command line VIB installer from an ESXi console or SSH session. However, not many realize that <code>esxcli<\/code>\u00a0is actually a full-fledged package manager, and can be used to automatically check for updated packages and install them accordingly, in a similar vein to <code>apt<\/code>\u00a0or <code>yum<\/code>.<\/p>\n<p><!--more--><\/p>\n<p>Using <code>esxcli<\/code>\u00a0in this fashion is actually surprisingly easy, but it does entail typing out the &#8220;depot&#8221; URL and providing it to <code>esxcli<\/code>\u00a0as a command line argument each time. VMware ESXi and vSphere use this XML file to provide an index of the latest available packages and their version numbers, and can compare the contents against what&#8217;s installed locally to upgrade packages as needed.<\/p>\n<p>The first step is to make sure that the VMware ESXi SSH service is up and running, so that you can log in remotely to run the <code>esxcli<\/code>\u00a0update\/upgrade commands. This can be done from the &#8220;Services&#8221; menu in the vSphere client, or from the &#8220;Security Profile&#8221; section of the &#8220;Configuration&#8221; tab in vSphere Client:<\/p>\n<div id=\"attachment_5312\" style=\"width: 990px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5312\" class=\"wp-image-5312 size-large colorbox-5309\" src=\"https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?resize=980%2C818&#038;ssl=1\" alt=\"\" width=\"980\" height=\"818\" srcset=\"https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?resize=1024%2C855&amp;ssl=1 1024w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?resize=768%2C641&amp;ssl=1 768w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?resize=300%2C250&amp;ssl=1 300w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?resize=60%2C50&amp;ssl=1 60w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?resize=150%2C125&amp;ssl=1 150w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/vsphere-client-start-ssh.png?w=1311&amp;ssl=1 1311w\" sizes=\"auto, (max-width: 980px) 100vw, 980px\" \/><\/a><\/p>\n<p id=\"caption-attachment-5312\" class=\"wp-caption-text\">Starting the vSphere\/ESXi SSH service via vSphere Client. <em>Click on the image to zoom in.<\/em><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_5311\" style=\"width: 990px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5311\" class=\"wp-image-5311 size-large colorbox-5309\" src=\"https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?resize=980%2C574&#038;ssl=1\" alt=\"\" width=\"980\" height=\"574\" srcset=\"https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?resize=1024%2C600&amp;ssl=1 1024w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?resize=768%2C450&amp;ssl=1 768w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?resize=300%2C176&amp;ssl=1 300w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?resize=60%2C35&amp;ssl=1 60w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?resize=150%2C88&amp;ssl=1 150w, https:\/\/i0.wp.com\/neosmart.net\/wiki\/wp-content\/uploads\/sites\/5\/2017\/12\/web-start-ssh.png?w=1143&amp;ssl=1 1143w\" sizes=\"auto, (max-width: 980px) 100vw, 980px\" \/><\/a><\/p>\n<p id=\"caption-attachment-5311\" class=\"wp-caption-text\">Starting the SSH service via the vSphere\/ESXi web management interface.<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"float: clear;\">Once the SSH service has been enabled, log on to the ESXi server in question over SSH, typically by running <code>ssh root@IPADDR<\/code>\u00a0where <code>IPADDR<\/code>\u00a0is the address of the vSphere\/ESXi host you would like to upgrade. Windows users will likely use <a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\">putty<\/a> to establish the SSH connection instead.<\/p>\n<p>When you&#8217;ve logged in to the ESXi machine securely over SSH, enter the following at the terminal prompt. We recommend copy-and-pasting from below to make sure everything is typed in correctly:<\/p>\n<pre><code class=\"language-bash\">esxcli software vib update -d https:\/\/hostupdate.vmware.com\/software\/VUM\/PRODUCTION\/main\/vmw-depot-index.xml\r\n<\/code><\/pre>\n<p>Note that running this command may take awhile, during which the process will appear to be hung.\u00a0<strong>Do not close the SSH connection or attempt to stop the upgrade!<\/strong> <code>esxcli<\/code>\u00a0will connect to the URL we provided and use that to obtain a list of the latest versions of all packages, then upgrade all outdated packages in the process.<\/p>\n<p>Once the upgrade has finished, <code>esxcli<\/code>\u00a0will print information about all the updates installed to the terminal. At this point, it&#8217;s necessary to reboot the ESXi server to use the updated version of the software. If all guests have already been safely shutdown and the server is in maintenance mode (if needed), the vSphere\/ESXi server may be rebooted from the SSH session by typing in<\/p>\n<pre><code class=\"language-bash\">reboot\r\n<\/code><\/pre>\n<p>followed by the Enter key.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The traditional approach to upgrading vSphere and VMware ESXi involves manually downloading the VIB (short for &#8220;vSphere Installation Bundle&#8221;) and executing the ESXi esxcli\u00a0command line VIB installer from an ESXi console or SSH session. However, not many realize that esxcli\u00a0is actually a full-fledged package manager, and can be used to automatically check for updated packages [&hellip;]<\/p>\n","protected":false},"author":505,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"class_list":["post-5309","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3SlTq-1nD","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/posts\/5309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/users\/505"}],"replies":[{"embeddable":true,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/comments?post=5309"}],"version-history":[{"count":9,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/posts\/5309\/revisions"}],"predecessor-version":[{"id":5320,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/posts\/5309\/revisions\/5320"}],"wp:attachment":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/media?parent=5309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}