VMware Cloud Community
goppi
Enthusiast
Enthusiast
Jump to solution

Backup ESXi configuration via PowerCLI

Hi.

Is it possible with PowerCLI (similar to RCLI) to backup and restore the configuration of an ESXi host and how is it done if possible?

Or do we have to use the ulgy pearl beast for that?

Thanks for your help.

Regards,

goppi

Reply
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Both Perl (esxcfg-cfgbackup.pl) and PowerCLI makes use of the vSphere API to issue a backup of ESXi configuration using BackupFirmwareConfiguration and RestoreFirmwareConfiguration

Here is a PowerCLI script that seems to do the job: http://waynes-world-it.blogspot.com/2009/08/vmware-powercli-backup-esxi-40-firmware.html (have not personally tested)

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

Twitter: @lamw

If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

Reply
0 Kudos
10 Replies
lamw
Community Manager
Community Manager
Jump to solution

Both Perl (esxcfg-cfgbackup.pl) and PowerCLI makes use of the vSphere API to issue a backup of ESXi configuration using BackupFirmwareConfiguration and RestoreFirmwareConfiguration

Here is a PowerCLI script that seems to do the job: http://waynes-world-it.blogspot.com/2009/08/vmware-powercli-backup-esxi-40-firmware.html (have not personally tested)

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

Twitter: @lamw

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
goppi
Enthusiast
Enthusiast
Jump to solution

Exactly what I was looking for.

Thank's a lot.

Reply
0 Kudos
AlbertWT
Virtuoso
Virtuoso
Jump to solution

OK, so this is the alternative / free version of host profile right ?

instead of setting the iSCSI and Netowrking stuff it can be exported and imported.

Kind Regards,

AWT

/* Please feel free to provide any comments or input you may have. */
Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

No, anytime you're are performing non-read operation against the vSphere API whether that is in Perl or in PowerCLI, you need to have the appropriate licenses. This will NOT work if you're using the free version of ESXi.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

Twitter: @lamw

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
goppi
Enthusiast
Enthusiast
Jump to solution

Is the following assumtion correct?

Backup the config via API is possibe with free ESXi.

Restoring the config via API after a crash to a newly setup ESXi server is possible as long as it operates in evaluation mode.

After restoring the free ESXi license key restoring the config is no longer possible.

Regards,

goppi.

Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

No, take a look at my previous comment. You CAN NOT use the free version of ESXi and expect to be able to use the vSphere API to backup your configurations at least using the methods provided in the API, you can always do read operations and copy down the config through some logic and than set that backup on an eval of ESXi

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

Twitter: @lamw

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
goppi
Enthusiast
Enthusiast
Jump to solution

Looking at your previous comment I did not see a contradiction to my post.

Is it possible to use the free version to backup (read) the current configuration via the API call (I would assume this to be a read operation)?

Is it possible to restore a configuration to a newly installed ESXi while in evaluation mode (IIRC the API is unlocked for write operations during this period)?

This is something that was posted previously in the ESXi 3.5 forum.

Thanks again for your help.

Regards,

goppi.

Reply
0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

With ESXi Free and the vCLI you can take a backup with vicfg-cfgbackup, but you would get a restricted version error if you tried to restore it back to the same host. You would be able restore it after doing a new or repair install (as these would wipe the config and put the host into 60 day eval mode), or you could change the host from free mode back to eval mode (I don't think it would matter even if the eval had expired).

Dave

VMware Communities User Moderator

New book in town - vSphere Quick Start Guide -http://www.yellow-bricks.com/2009/08/12/new-book-in-town-vsphere-quick-start-guide/.

Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL - http://www.vm-help.com/forum/viewforum.php?f=21.

Reply
0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

Is it possible to restore a configuration to a newly installed ESXi while in evaluation mode (IIRC the API is unlocked for write operations during this period)?

Yes because when you're in eval mode you're actually licensed at the enterprise plus level.

Dave

VMware Communities User Moderator

New book in town - vSphere Quick Start Guide -http://www.yellow-bricks.com/2009/08/12/new-book-in-town-vsphere-quick-start-guide/.

Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL - http://www.vm-help.com/forum/viewforum.php?f=21.

goppi
Enthusiast
Enthusiast
Jump to solution

Thanks for confirmation.

Regards,

grubi.

Reply
0 Kudos