cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5794
Views
12
Helpful
4
Comments
joemar
Level 4
Level 4

This script allows you to connect to a single or multiple UCS domains and it will take all 4 types of backups available in UCS for each domain.  The filenames will be descriptive of the UCS domain and the date/time of the backup.  The script supports interactive mode or supports the ability to run fully unattended to make it simple to use Windows Task Scheduler to take backups on a schedule.  The script is fully documented and has complete integrated help (get-help).

Change Log:

   v0.1.00 - Initially posted version

   v0.1.01 - Fixed issue when used with systems registered to UCS Central

As always, let me know if you have any questions, comments or concerns!

Joe

Comments
rafael.monteiro
Level 1
Level 1

Hello Joe,

Thank you for your scripts, they are verry usefull

I have a question and an issue, hope you can help

Question:

On the backup settings, are the "Preserve Identities" check?

Issue:

The Config-all is working fine

But all the others are not working and my knowledge level don't permit me to understand what is the problem

Output:

Script Running...

This script allows you to backup a single or multiple UCS domains.
It will create each type of backup available on UCS.

NOTE: UCS Platform Emulator cannot take a full-state backup

The files will be saved to folder: E:\PowerShell\UCS\BackupAll

Checking for proper PowerShell version
        Your version of PowerShell is valid for this script.
                You are running version 3.0

Checking Cisco PowerTool
        PowerTool version 0.9.11.0 is already Loaded
Enter UCS system IP or Hostname or a list of systems separated by commas: <POD Name>

Testing PING access to UCSM
        Successful access to <POD Name> by Ping

Logging into UCS
        Enter your UCSM credentials
                Logging into: <POD Name>
                        Login Successful

Removing any previous UCSM Backup configurations from UCS: <POD Name>(IP)
        Complete

Backing up UCS: <POD Name>(IP), Backup Type: config-all
Removing backup job from UCS: <POD Name>(IP)
        Complete

Removing any previous UCSM Backup configurations from UCS: <POD Name>(IP)
        Complete

Backing up UCS: <POD Name>(IP), Backup Type: config-logical
        ***WARNING*** Error creating backup: E:\PowerShell\UCS\BackupAll\UCSMBackup_<POD Name>_config-logical_9-23-2015_11-58-57.xml
                NOTE: This is normal behavior for a full-state backup on a UCS Emulator

Removing backup job from UCS: <POD Name>(IP)
        Complete

Removing any previous UCSM Backup configurations from UCS: <POD Name>(IP)
        Complete

Backing up UCS: <POD Name>(IP), Backup Type: config-system
        ***WARNING*** Error creating backup: E:\PowerShell\UCS\BackupAll\UCSMBackup_<POD Name>_config-system_9-23-2015_11-58-57.xml
                NOTE: This is normal behavior for a full-state backup on a UCS Emulator

Removing backup job from UCS: <POD Name>(IP)
        Complete

Removing any previous UCSM Backup configurations from UCS: <POD Name>(IP)
        Complete

Backing up UCS: <POD Name>(IP), Backup Type: full-state
        ***WARNING*** Error creating backup: E:\PowerShell\UCS\BackupAll\UCSMBackup_<POD Name>_full-state_9-23-2015_11-58-58.xml
                NOTE: This is normal behavior for a full-state backup on a UCS Emulator

Removing backup job from UCS: <POD Name>(IP)
        Complete

joemar
Level 4
Level 4

Rafael, sorry for my late reply but I'm just back from a 3 month leave.  Did you get this working?  Do you need assistance?

vmadalik
Cisco Employee
Cisco Employee

Hello,

Does this Script have a way of saying - if the backup operations being performed is a success or failure at any point in time?

I have a customer with 4000 servers spread across 60+ domains and no way of finding out if the backup operation was successful/failure unless we manually access the domains.

Please advise.

Regards,

VM

joemar
Level 4
Level 4

It does in that it reports to the display success or failure of each backup as seen below in this snip of the script:

    Try
   {
   $DontShow = Backup-Ucs -PreservePooledValues -Type $UCSbackupType -Ucs $UcsName -PathPattern $BackupFile -ErrorAction Stop
   }
   Catch
   {
   Write-Output "    ***WARNING*** Error creating backup: $BackupFile"
   Write-Output "   NOTE: This is normal behavior for a full-state backup on a UCS Emulator"
   Write-Output ""
   }
   Finally
   {
   if (Test-Path $BackupFile -eq $true)
   {
   Write-Output "    Complete - $BackupFile"
   Write-Output ""
   }
   }

It would be fairly simple to take the success or error and write that to a log file for each backup or do something else with it depending on your needs.  These scripts are samples/examples so feel free to take it and modify it for your needs.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links