{"id":3026,"date":"2011-06-01T07:40:58","date_gmt":"2011-06-01T15:40:58","guid":{"rendered":"https:\/\/www.zubairalexander.com\/stage\/?p=3026"},"modified":"2011-05-26T18:20:51","modified_gmt":"2011-05-27T02:20:51","slug":"how-to-back-restore-vmware-esxi-4-1-configuration-using-vcli","status":"publish","type":"post","link":"https:\/\/www.zubairalexander.com\/blog\/how-to-back-restore-vmware-esxi-4-1-configuration-using-vcli\/","title":{"rendered":"How to Back &#038; Restore VMware ESXi Configuration Using vSphere CLI"},"content":{"rendered":"<p>The vSphere Command-Line Interface (vSphere CLI) command set allows you  to run common system administration commands against  ESX\/ESXi systems  from any machine with network access to those systems. vSphere CLI commands are especially useful for ESXi hosts because ESXi does not include a service console. You can use <strong>vicfg-cfgbackup.pl<\/strong> within vSphere CLI to backup or restore your VMware ESXi 4.1 server configuration or to reset the host to factory settings.<\/p>\n<p><strong>vicfg-cfgbackup<\/strong><\/p>\n<p>The vicfg-cfgbackup command backs up and restores ESXi configuration data. You can  back up the host configuration, restore the configuration to the host, force the restore of  the configuration, and reset the host to factory settings.<\/p>\n<p><span style=\"color: #ff0000;\"><strong>WARNING!<\/strong><\/span> <strong> <\/strong><em>This command is supported for ESXi hosts but not for ESX hosts.<\/em><\/p>\n<blockquote><p>vicfg-cfgbackup<br \/>\n&lt;conn_options&gt;<br \/>\n[&#8211;force |<br \/>\n&#8211;help |<br \/>\n&#8211;load &lt;backupfile&gt; |<br \/>\n&#8211;reset |<br \/>\n&#8211;save &lt;backupfile&gt;]<\/p><\/blockquote>\n<p>You can use the following options with vicfg-cfgbackup.<\/p>\n<blockquote><p><strong>conn_options<br \/>\n<\/strong>Specifies the target server and authentication information if required. Run vicfg-cfgbackup &#8211;help for a list of all connection options.<\/p>\n<p><strong>&#8211;force | -f<\/strong><br \/>\nForces the restore of the configuration.<\/p>\n<p><strong>&#8211;help<\/strong><br \/>\nPrints a help message for each command-specific and each connection option. Calling the script with no arguments or with &#8211;help has the same effect.<\/p>\n<p><strong>&#8211;load | -l &lt;backupfile&gt;<\/strong><br \/>\nRestores configuration from &lt;backupfile&gt; onto the host.<\/p>\n<p><strong>&#8211;save | -s &lt;backupfile&gt;<\/strong><br \/>\nBacks up the host configuration.<\/p>\n<p>Include the number of the build that is running on the host that you are backing up in the backup filename. If you are running the vSphere CLI from vMA, the backup file is saved locally on vMA. Local storage for backup files is safe because vMA is stored in the \/vmfs\/volumes\/&lt;datastore&gt; directory, which is separate from the ESXi image and configuration files.<\/p>\n<p>&#8211;<strong>-reset | -r<\/strong><br \/>\nResets the host to factory settings.<\/p>\n<p><strong>&#8211;quiet | -q<\/strong><br \/>\nPerforms all operations without prompting for confirmation.<\/p><\/blockquote>\n<h3><strong>Step-by-Step Instructions <\/strong><\/h3>\n<p>Follow the instructions below for backing up and restoring your ESXi 4.1 server configuration from your Windows computer.<\/p>\n<p><strong>Backing Up the Configuration<\/strong><\/p>\n<ol>\n<li>Install vSphere CLI on your Windows computer. I like to install it on Windows 7 and manage my ESXi server using vSphere Client GUI and vSphere CLI. You can download vSphere CLI <a href=\"http:\/\/www.vmware.com\/support\/developer\/vcli\/\">here<\/a>.<\/li>\n<li>Go to Start -&gt; All Programs -&gt; VMware -&gt; VMware vSphere Client -&gt; Command Prompt.<\/li>\n<li>Change directory to the folder where the vicfg-cfgbackup.pl is located. This will typically be in the C:\\Program Files (x86)\\VMware\\VMware vSphere CLI\\bin folder. Obviously, if you add the path to your system path you can run the command from any folder.<\/li>\n<li>Use the following syntax at the vCLI prompt:<br \/>\n<em>vicfg-cfgbackup.pl &#8211;server ip-address &#8211;username root &#8211;password your-password &#8211;save filename<\/em><br \/>\nFor example, type the following command and press Enter:<br \/>\n<strong><span style=\"color: #008000;\">vicfg-cfgbackup.pl &#8211;server 192.168.1.200 &#8211;username root &#8211;password MySecretPassword &#8211;save esxi41.bak<\/span><\/strong><br \/>\nWhere 192.1681.200 is your ESXi server&#8217;s IP address, MySecretPassword is your password, and esxi41.bak is the name of the backup file that will contain the server configuration settings. Note that there is a space after each double dash (&#8211;) but not after the double dash.<\/li>\n<li>After you run the command you should see the following notification and your file will be backed in the folder where you ran the command, e.g. in the VMware vSphere Client\\bin folder.<br \/>\n<em>Saving firmware configuration to esxi4.1.bak &#8230;<br \/>\n<\/em>Make sure you verify that the file exists by running the <em>dir *.bak<\/em> command at the command prompt.<\/li>\n<\/ol>\n<p><strong>Restoring the Configuration<\/strong><\/p>\n<p>To restore your VMware ESXi 4.1 server configuration use the same vicfg-cfgbackup.pl command.<\/p>\n<ol>\n<li>Go to Start -&gt; All Programs -&gt; VMware -&gt; VMware vSphere Client -&gt; Command Prompt.<\/li>\n<li>Change directory to the folder where the vicfg-cfgbackup.pl is located. This will typically be in the C:\\Program Files (x86)\\VMware\\VMware vSphere CLI\\bin folder.<\/li>\n<li>Use the following syntax at the vCLI prompt:<br \/>\n<em> vicfg-cfgbackup.pl &#8211;server ip-address\u00a0 &#8211;username root &#8211;password your-password &#8211;load esxi41.bak -f -q<\/em><br \/>\nFor example, type the following command and press Enter:<br \/>\n<strong><span style=\"color: #008000;\"> <em>vicfg-cfgbackup.pl &#8211;server 192.168.1.200 &#8211;username root &#8211;password MySecretPassword &#8211;load esxi41.bak -f -q<\/em><\/span><\/strong><br \/>\nWhere 192.1681.200 is your ESXi server&#8217;s IP address, MySecretPassword is  your password, and esxi41.bak was the name of the backup file that contains the server configuration settings. Note that there is a space  after each double dash (&#8211;) but not after the double dashes.<\/li>\n<\/ol>\n<p>In order to restore your configuration, you need to place your new ESXi 4.1 server into evaluation mode.  This may not be necessary if you have recently installed your server and have not added your license key. If  you have already added your license key then simply use the vSphere Client and set the server to evaluation  mode. Another thing to keep in mind if your restore fails is to use the -f option, which forces a restore.<\/p>\n<p><strong>Helpful Links<\/strong><\/p>\n<ol>\n<li> More information and documentation for vSphere CLI is available <a href=\"http:\/\/www.vmware.com\/support\/developer\/vcli\/\">here<\/a>.<\/li>\n<li>A complete reference for vSphere CLI is available <a href=\"http:\/\/www.vmware.com\/support\/developer\/vcli\/vcli41\/doc\/reference\/index.html\">here<\/a>.<\/li>\n<li>vSphere CLI is available for download <a href=\"http:\/\/www.vmware.com\/support\/developer\/vcli\/\">here<\/a>.<\/li>\n<\/ol>\n<ul><\/ul>\n<hr \/>\n<p><span style=\"font-size: xx-small; font-family: Verdana;\">Copyright \u00a92011 Zubair Alexander. All rights reserved.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The vSphere Command-Line Interface (vSphere CLI) command set allows you to run common system administration commands against ESX\/ESXi systems from any machine with network access to those systems. vSphere CLI commands are especially useful for ESXi hosts because ESXi does not include a service console. You can use vicfg-cfgbackup.pl within vSphere CLI to backup or [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[11,45,46,58],"tags":[],"class_list":["post-3026","post","type-post","status-publish","format-standard","hentry","category-tips-tricks","category-toolsutils","category-virtualization","category-windows-7"],"aioseo_notices":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/posts\/3026","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/comments?post=3026"}],"version-history":[{"count":0,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/posts\/3026\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/media?parent=3026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/categories?post=3026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/tags?post=3026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}