Have not tried this, but it looks like a very cool project for provisioning a new Service Profile.
From the post below:
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.
- Generate Server from Cisco UCS Service Profile
- Gather WWNN, WWPN, and MAC of eth0
- Generate zoning configuration/push to MDS 9509
- Create boot LUN
- Create storage group
- Create initiator record for new server on boot hba/fabric
- Add initiator/server to storage group
- Add boot LUN to storage group
- Generate pxelinux.cfg and kickstart files
- 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:
- The $url needs to be the url to your fabric interconnect(s).
- 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.
- $zoneFileLocation is just the location where the zone configuration files will be outputted.
- The createZoning function is fairly strait forward, you will need to change this section to match your VSAN’s, naming standards, and storage processors.
- 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. http://developer.cisco.com/web/unifiedcomputing/start
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.