Good stuff. I had written a very similar workflow to call a diskpart script in guest (Windows only) to format/letter/label the drives. Any idea if this functionality will be included in a later rel...
See more...
Good stuff. I had written a very similar workflow to call a diskpart script in guest (Windows only) to format/letter/label the drives. Any idea if this functionality will be included in a later release of 8.x or should we plan to continue using these work-around methods?
Thank you so much for this post. I've been running into so many weird errors before I found this post about the out of memory condition and now my vRO powershell actions work as expected after incre...
See more...
Thank you so much for this post. I've been running into so many weird errors before I found this post about the out of memory condition and now my vRO powershell actions work as expected after increasing the memory limit to 512. Yes, I had to go to 512 because things were still failing intermittently set at 256. For context, I am not doing anything crazy; connecting to vcenter (connect-viserver), adding disks (New-HardDisk) and then passing in a diskpart script to format/label/letter the new disks with Invoke-VMScript.
Like the title says, I'm wondering if there is any documentation out there on how pull out credentials from the LCM locker for use in either an ABX action or possibly vRO workflow.
Thank you so much LucD After incorporating this method into the script it's now working as I want it. function Move-Alarm { param($Alarm, $To, [switch]$DeleteOriginal = $false) $alar...
See more...
Thank you so much LucD After incorporating this method into the script it's now working as I want it. function Move-Alarm { param($Alarm, $To, [switch]$DeleteOriginal = $false) $alarm = Get-AlarmDefinition $Alarm $alarmMgr = Get-View AlarmManager $spec = New-Object -TypeName VMware.Vim.AlarmSpec $spec.Name = $alarm.Name + " (" + $To + ")" $spec.Action = $alarm.ExtensionData.Info.Action $spec.ActionFrequency = $alarm.ExtensionData.Info.ActionFrequency $spec.Description = $alarm.ExtensionData.Info.Description $spec.Enabled = $alarm.ExtensionData.Info.Enabled $spec.Expression = $alarm.ExtensionData.Info.Expression $spec.Setting = $alarm.ExtensionData.Info.Setting $alarmMgr.CreateAlarm($to.ExtensionData.MoRef,$spec) } $to = Get-DataCenter #### $tgtAlarm = "Datastore usage on disk","Host connection and power state" $alarms = Get-AlarmDefinition -name $tgtAlarm $alarms | % { Move-Alarm -Alarm $_ -To $to -DeleteOriginal:$false }
First off, thanks for the quick reply. It's definitely changing how it works because the trigger is getting set on both rules so where the original alarm would only trigger the alarm action if b...
See more...
First off, thanks for the quick reply. It's definitely changing how it works because the trigger is getting set on both rules so where the original alarm would only trigger the alarm action if both conditions were true, the new alarm is triggering an action if either condition is true. It's behaving more like an OR rather than an AND in this regard. I inadvertently triggered a flood of emails when this new alarm triggered for every host that was NOT in standby
I'm basing this off of some code I found written by LucD and some other sources. It's working for the most part, but the problem I'm having is it's taking the original 1 rule and splitting the ...
See more...
I'm basing this off of some code I found written by LucD and some other sources. It's working for the most part, but the problem I'm having is it's taking the original 1 rule and splitting the AND into 2 separate rules. Can someone tell me what I'm doing wrong? like so: function Move-Alarm { param($Alarm, $To, [switch]$DeleteOriginal = $false) $alarmDef = Get-AlarmDefinition $Alarm $alarmTrigger = Get-AlarmTrigger $Alarm $alarmAction = Get-AlarmAction $Alarm $email = $alarmAction.To $newAlarmName = $alarmDef.Name + " (" + $To + ")" $newAlarmAction = @{ Email = $true Subject = $alarmAction.Subject To = $email.trim(";") } #$action = New-AlarmAction @newAlarmAction $alarmDefInput = @{ Name = $newAlarmName Description = $alarmDef.description AlarmTrigger = $alarmTrigger AlarmAction = $action Entity = $To } New-AlarmDefinition @alarmDefInput } $to = Get-DataCenter #### $tgtAlarm = "Datastore usage on disk","Host connection and power state" $alarms = Get-AlarmDefinition -name $tgtAlarm $alarms | % { Move-Alarm -Alarm $_ -To $to -DeleteOriginal:$false }