Question from chat yesterday (what vars available)
I had a question in the 1.0.1 release chat yesterday that was suggested I post in the forum here to get some input. I've got about 150 DRAC5 and iDRAC6 servers that I'd like to reconfigure using RACADM in OME. I'm working on my template configs to apply to the servers, and I wanted to set the DRAC/iDRAC name to match the hostname on the server (instead of 9k4gg1, it would be server1). I can run the racadm command for a single host successfully, but does anyone have a suggestion on how to use a variable to apply the hostname in the RACADM task in OME? I know there are a couple like $ip and $n listed in the documentation, but $n didn't work.
Thanks for your post and joining the chat yesterday.
$IP and $NAME are substitution parameters which get replaced with the target IP address or target hostname when the command is run.
For your specific use case since hostname is going to be different for each iDrac you will have to run the command separately for each one.
Also setting the hostname of the server and iDrac to be the same might cause problems for discovery if you are using hostname based discovery.
Having said this, if you want to automate the renaming operation, you could try using generic command line task coupled with a batch file.
The batch file would be something like:
Racadm setniccfg –s %1 ( This is not the command to change the hostname but an example where %1 is the IP address of the iDRAC)
For the command you will specify batch file name and in arguments you would use $IP and that would pass the IP of the target to the %1 in the batch file
Thanks Abhijit, I've dug around it some more and let me see if I can clear up a few things. I've got the correct fields now, so what I'm looking to do is take the ManagedNodeOS hostname from the DRAC config, for example:
[ifcRacManagedNodeOs]
# ifcRacMnOsHostname=server1
# ifcRacMnOsOsName=Microsoft Windows Server 2008 R2, Standard x64 Edition
And set it to be the DNS name for the DRAC so that it registers in DNS properly.
[cfgLanNetworking]
cfgDNSRacName=DRACserialnumber
cfgDNSDomainName=drac.company.com
The RACADM task only accepts 1 line of input, and I don't think I can chain RACADM commands together. I could do the batch file, but I can only target that at Servers and not DRACs, so it doesn't pull in the arguments properly...
By default the command line tasks are applicable to the servers and custom groups. If you have a batch file with racadm commands, you can still use the generic command line task.
First thing you would do is create a custom group which includes all the DRACs. You can do this by right clicking all devices and selecting New Group and go through the wizard which opens up. You can either choose individual RAC devices or use a query to narrow down you devices. Once you have a custom group for your DRACs, it will show up as available target for commandline task.
Thanks for the advice, I decided to cobble together a larger PowerShell script to configure the DRACs from the Leveraging Powershell OME document published by Ben Villaneuva from Dell and a function borrowed from Ben Short's Dell DRAC Powershell Library (practicaladmin.wordpress.com) to parse some output. The script can now target the DRAC group, and within the script grab the hostname from the DRAC, then turnaround and use it to configure the name the DRAC registers in DNS along with all the AD authentication stuff. It's not pretty, but it appears to work so far. Others are welcome to build on this and share their work as well.
Agreed Ben, it's a great set of functions you built, and a good building block for further RACADM scripting. Maybe even worth the Dell folks putting up a scripting library similar to what's on Microsoft TechNet so we can post scripts?
DELL-Abhijit P
Community Manager
•
711 Posts
1404
0
Posted February 29th, 2012 11:00
Hi,
Thanks for your post and joining the chat yesterday.
$IP and $NAME are substitution parameters which get replaced with the target IP address or target hostname when the command is run.
For your specific use case since hostname is going to be different for each iDrac you will have to run the command separately for each one.
Also setting the hostname of the server and iDrac to be the same might cause problems for discovery if you are using hostname based discovery.
Having said this, if you want to automate the renaming operation, you could try using generic command line task coupled with a batch file.
The batch file would be something like:
Racadm setniccfg –s %1 ( This is not the command to change the hostname but an example where %1 is the IP address of the iDRAC)
For the command you will specify batch file name and in arguments you would use $IP and that would pass the IP of the target to the %1 in the batch file
Regards
Abhijit