Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Saturday, August 27, 2016

Backup and Restore ESXi Host Configuration

Backup and Restore ESXi Host Configuration


Todays post involves something I havent done before which is backing up and then restoring an ESXi hostss configuration.  

In my examples today I am going to use the tools directly built into ESXi and vSphere to get this done.  Im going to use PowerCLI 5.5 (latest version as of this writing) to get this done.

PowerCLI is one of the many tools that are bundled for free with the vSphere environment.  I highly recommend you have it installed on your management server or workstation and if youre running vCenter on Windows its even better to place it there.  You can download PowerCLI from the VMware website.

The process of backing up and restoring the configuration is pretty simple so here we go.

Before running any of these commands you should run this command in PowerShell on Windows to make sure PowerCLI has the ability to execute the commands needed for this process to work.

Set-ExecutionPolicy RemoteSigned

Open PowerCLI and use the Connect-VIServer IPAddress command to connect to the server.

Next run the command below to backup your hosts configuration.  Make sure you create the backup location folder before you run the command.

Get-VMHostFirmware -VMHost ESXi_host_IP_Address -BackupConfiguration -DestinationPath “Output_Directory”

When the process completes youll have files that look like this:


Thats all there is to backing up the configuration of your ESXi host.  Now for the really cool part.  
If youre upgrading hosts to new hardware there a couple of things Ive done and the restore has went off without a hitch.  Make sure you have the VMware install on the new host at the exact same version as the host you backed up.  If not this isnt a supported process but you can use the "-force" command at the end of the restore to make it do it anyway.  The next thing is to ensure you have the network cables in the exact same port numbers as the old host.  In other words port 0 on the old host should get the cable for port 0 on the new.
If youre unsure which cables correspond to which port, once youve migrated all VMs off of the old host you can look at the network configuration in the vSphere client and pull the cables one at a time.  From there just label each one so you know where to put it in the new server.
Once youve got the new box cabled up, on the same build of VMware as the old server, and powered on heres all you need to do.
First put the host into maintenance mode.  This is required or the next step will not work.  You can use the hostname, IP address, or FQDN if you want.
Set-VMHost -VMHost esx1 -State “Maintenance”
Next enter the restore command.
Set-VMHostFirmware -VMHost -Restore -Force -SourcePath
Once you do this the host will immediately restart.  During the restart it will import the backed up configuration prior to completing the loading process.
After the host has fully restarted you will be able to see that all of your prior settings have been restored including those many times complicated network, VLAN, and MTU settings.
On the hosts I have performed this on if they have local storage I have had to configure the large datastore again but given how much time this saves thats a minor thing to get the new server online much, much quicker.
Good luck with your upgrades!







Get

Read more »

Sunday, August 14, 2016

Backup Cisco WLC Configuration Without Cisco Prime

Backup Cisco WLC Configuration Without Cisco Prime


This article is part of a new mini-series here on my blog as I work toward obtaining my Cisco Wireless 640-722 CCNA certification.

The official way Cisco wants you to do this is to buy and implement Cisco Prime.

One way you can get around this is to use SolarWinds CatTools to send commands to your devices.

Using this I configured a job to connect to the WLC via SSH and push a backup of the config to my TFTP server.  Heres how:


>transfer upload mode tftp
>transfer upload datatype config
>transfer upload filename WLC-Config-Backup_%DateISO%.txt
>transfer upload path .
>transfer upload serverip 192.168.1.5
>transfer upload start

Once you select "Y" to begin the backup youll see in the text a warning that file encryption is disabled.  Solarwinds CatTools can answer this Y or Yes if needed.  After this the config will push to your TFTP directory.

The variable in the command %DateISO% will automaticaly fill out the date of the file for you.  As of now the freeware version is limited to 5 devices and 5 activities only.

If you need more it can scale up from there.

Get

Read more »

Wednesday, August 10, 2016

Archive Cisco Switch and Router Configs Using TFTP and Configuration Archive

Archive Cisco Switch and Router Configs Using TFTP and Configuration Archive


The worst time to realize you dont have a current backup of your switch or router is when that device is having issues or worst case dies and it is actually needed.  For a great comprehensive list of Cisco IOS commands I recommend THIS BOOK.  Its for Amazon Kindle.

Administrators have the ability to run a manual backup of the configs or you can set it to do this automatically or every time you do a "write memory" to save a config change.

Given how easy this is to setup theres no reason for you not to have this on your switches.

Lets dive into how easy this is to setup.

First youll need a good TFTP server program.  Personally I like the free Solarwinds TFTP Server.  This like is for the Windows version.  You can run it on a server or a workstation if needed.  The price is right, setup is simple, and youll have this going in a couple of minutes.

Next its time to setup the switch or router to do the automatic backups for you.

Lets look at a couple of way to set this up.

The first way is to just backup each time you do a "write memory".  This is my favorite setup as it does not generate unnecessary network traffic and I know that the files on my TFTP server are the latest config as long as they were saved.



R1(config)#archive
R1(config-archive)#path tftp://192.168.1.10/R1-config
R1(config-archive)#write-memory
R1(config-archive)#exit

Now one of the details I add after the IP address and forward slash is the name of the device so when it creates the automatic backup file I know which device it came from based on the devices host name.

Another way to set this up is to do backups daily for you automatically without the need to a manual update.  This setup will archive every day or if you do a "write memory" command on the switch.


R1(config)#archive
R1(config-archive)#path tftp://192.168.1.10/R1-config
R1(config-archive)#write-memory
R1(config-archive)#time-period 1440

Now these two methods ensure your switch configs are backed up either as you do a change and save it or automatically each day.

Finally the great thing about these auto backups is you can also restore them using the same functions.  One thing to note is that this command does not merge the settings with what is currently running, it fully replaces it so use caution.


R1# configure replace tftp://192.168.1.10/R1-config-3
This will Get

Read more »