Automate Cisco UCS Server Provisioning part 1

This entry was posted by on Friday, 22 April, 2011 at

I was going to wait to post this script until it was 100% complete, but I realized that it might help people as is. I will continue to update this post (or make new ones) as I add the other sections to this script. Below is the final script algorithm I am going to implement.

Script Steps:

1.       Generate Server from Cisco UCS Service Profile

2.       Gather WWNN, WWPN, and MAC of eth0

3.       Generate zoning configuration/push to MDS 9509

4.       Create boot LUN

5.       Create storage group

6.       Create initiator record for new server on boot hba/fabric

7.       Add initiator/server to storage group

8.       Add boot LUN to storage group

9.       Generate pxelinux.cfg and kickstart files

10.   Boot Service Profile/Initiate PXE install

So now you kind of understand the process here is the pudding. Below this script generates the service profile from the service template and then generates the zoning configuration and puts it into text files.

A couple of notes around this script:

1.       The $url needs to be the url to your fabric interconnect(s).

2.       The number of servers is set to 1 because in my environment I will just run this script for each server I want to build. This can be adapted to build multiple servers at one time.

3.       $zoneFileLocation is just the location where the zone configuration files will be outputted.

4.       The createZoning function is fairly strait forward, you will need to change this section to match your VSAN’s, naming standards, and storage processors.

5.       The user input section is where you program in your actual service template names. In this script the name of the esx service template is site-esx.

I would also suggest installing the Cisco UCSM Emulator to refine the script for your needs.

You can download the script here. This script goes through step 3 of my steps. I am currently working on pushing the configuration to the MDS 9509 (I will post the script once I have that done). I will continue to post iterations of this script until it is complete. But please adapt this to your needs as you see fit.


Leave a Reply