Wednesday, January 25, 2012

Backup/Restore ESXi 5.x using vicfg-cfgbackup

To backup your esxi server you need to install vCLI (on windows or linux) or you can also use vMA Appliance from vmware, which include the vCLI.
syntax:-
vicfg-cfgbackup.pl --server <name/ip> --username <username> --password <password> -s <path to save the backupfile>
Example:-
Server Name:-   esxi111.vlab.net     username:- root   pasword:- vmware
vCLI install on windows, I made folder under c:\backup

vicfg-cfgbackup.pl --server esxi111.vlab.net --username root --pasword vmware -s c:\backup\esxi111

To restore your esxi server you need to install vCLI (on windows or linux) or you can also use vMA Appliance from vmware, which include the vCLI. you need to make sure no Virtual Machine is running on hotst which you are planning to restore. ideally it is fresh installed server after crash and only configured for IP and root password.

syntax:-
vicfg-cfgbackup.pl --server <name/ip> --username <username> --password <password> -l <path to save the backupfile>
Example:-
Server Name:- esxi111.vlab.net username:- root pasword:- vmware
vCLI install on windows, backup path  c:\backup\esxi111

vicfg-cfgbackup.pl --server esxi111.vlab.net --username root --pasword vmware -l c:\backup\esxi111

Work Done

Backup and Restore esxi using PowerCLI follow link below
http://www.virtualizationguru.org/2013/06/backuprestore-esxi-5x-host.html

7 comments:

Unknown said...

Will it restore the Standard vSwitch configurations ???

Unknown said...

Will it restore the Standard vSwitch configurations and other NW configurations ???

RavinderK said...

Yes.

RavinderK said...

Yes..

Unknown said...

Maybe i´m a bit stupid, sorry about that, but what is this??? any Idea?:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-cfgbackup.pl --server
192.168.2.199 --username root --password ????? -s c:\backup\esxi111
Can't load 'C:/Program Files (x86)/VMware/VMware vSphere CLI/Perl/site/lib/auto/
XML/LibXML/Common/Common.dll' for module XML::LibXML::Common: load_file:The spec
ified module could not be found at C:/Program Files (x86)/VMware/VMware vSphere
CLI/Perl/lib/DynaLoader.pm line 230.
at C:/Program Files (x86)/VMware/VMware vSphere CLI/Perl/site/lib/XML/LibXML.pm
line 12
Compilation failed in require at C:/Program Files (x86)/VMware/VMware vSphere CL
I/Perl/site/lib/XML/LibXML.pm line 12.
BEGIN failed--compilation aborted at C:/Program Files (x86)/VMware/VMware vSpher
e CLI/Perl/site/lib/XML/LibXML.pm line 12.
Compilation failed in require at C:/Program Files (x86)/VMware/VMware vSphere CL
I/Perl/lib/VMware/VICommon.pm line 11.
BEGIN failed--compilation aborted at C:/Program Files (x86)/VMware/VMware vSpher
e CLI/Perl/lib/VMware/VICommon.pm line 11.
Compilation failed in require at C:/Program Files (x86)/VMware/VMware vSphere CL
I/Perl/lib/VMware/VIRuntime.pm line 15.
Compilation failed in require at C:\Program Files (x86)\VMware\VMware vSphere CL
I\bin\vicfg-cfgbackup.pl line 6.
BEGIN failed--compilation aborted at C:\Program Files (x86)\VMware\VMware vSpher
e CLI\bin\vicfg-cfgbackup.pl line 6.

RavinderK said...

sometime installation of vCLI have some issue. You can either uninstall and install back the vCLI. If still not work search for that specific dll file in your system and then copy and paste them in the same bin directory from where you are running for backup script.
Like in you error details this is showing not able to find Common.dll file, but if you search this file is there in the system installed with vCLI, you need to copy and paste under bin directory and then you can try again for same.

Unknown said...

I have an ESXi host with a Hypervisor license on it, so I cannot add it to a vCenter Server Evaluation trial (vSphere 5.5), so I want to save the configuration and reinstall the ESX host without license. Will this vicfg-cfgbackup.pl script save everything except for the license information and then restore everything except the license information?