Hi all,
im trying to copy a default alarm to a datacenter folder but seams i get an error every time i try. im using the LucD copy alarm script as my base and it has worked well in the past but after i upgraded vcenter to version 5.0 it seams to fail. can anyone give this a couple of seconds and check whats up.
the error is :
Exception calling "CreateAlarm" with "2" argument(s): "A specified parameter was not correct.
"
At C:\Users\Allans\Documents\WindowsPowerShell\CopyAlarms.ps1:72 char:24
+ $alarmMgr.CreateAlarm <<<< ($destination.MoRef,$newAlarm)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
im running powershell 2.0/ powercli 5.0 and the http://www.lucd.info/2010/02/20/alarms-moving-them-around/ Move/copy alarm script.
in the past this has been a succes setting up env for a new customer aka datacenter so they could get their own alarms to fidle with.
/regards
Allan
Just tried the script with PowerCLI 5 against a vCenter 4.1U1 without a problem.
I don't have a vCenter 5 available right now to test.
But I noticed in the vSphere 5 SDK Reference that the AlarmSpec object has a new property called systemName.
Although the Reference indicates that this property is optional, this could perhaps be the cause of the error.
Where you perhaps trying to copy a predefined, or system, alarm ?
If yes, could you perhaps try to copy a user-defined alarm and check if you also get the error ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
I was trying to copy a system created alarm so that new costumers get all the default alarms assigned to their area.
i will see if i can get it to work with a user-defined alarm
/Regards
Allan
Hi,
I had this problem, too: http://communities.vmware.com/thread/284908?start=30&tstart=0
Did you manage to import System Alarms exactly as they were created?
Thanks.