Hello. Can anyone please help with a powershell script which will trigger an email when the snapshot size of a particular VM crosses 3TB.
The catch here is we have vCenter alarms configured for snapshot size for all the VM's to trigger email when size exceeds 2TB but I need to configure alarm for this particular VM to send email when the snapshot crosses 3TB and it should override the 2Tb alarm from the vCenter. please help if there is any possibility.
What code do you already have?
What code did you use to create the current alarm?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello. I am currently using the default alarm from vCenter to send emails when snapshot exceeds 2Tb size.
So you don't have any code at all?
Did you already search in this community?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Currently I do not have a code for the snapshot size. I have it for snapshot age. I am looking out for snapshot size for particular VM
Currently I do not have a code for the snapshot size. I have it for snapshot age. I am looking out for snapshot size for particular VM and also need help to override the vCenter alarm and apply this script. Thanks
I'm curious to see your code for an alarm based on snapshot age.
Afaik there are no metrics, no events, and no states that could be a trigger for an alarm.
The same goes for snapshot size.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I got it from VMware communities
That doesn't create an alarm
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Apologies, I schedule this script to run on daily basis and receive an email. I have edited the script in such a way to pull the data and only send email when there is some data available, if the pulled data has no aged snapshots for the day it does not send emails.
Currently looking out for an option in similar way for snapshot size as well.
Current Scenario:
I have a VM which generates a snapshot of more than 2TB on daily basis which is natural and no need any alarms\emails for this. But needs an alarm\email only when it crosses 3TB of size. But for the rest of the Vms in the vCenter the snapshot size above 2TB is an issue and needs an alarm\email for that . So we have an alarm set from vCenter level to send email when any VM in the vCenter has a snapshot beyond 2TB of size.. But since this particular VM in question grows above 2Tb snapshot on daily basis which is normal I dont want an email to be triggered for that but need an alarm\email triggered only when it reached above 3TB.
Expected scenario:
I need some sought of indication\warning\alarm\email that this VM has crossed 3TB of the snapshot size for me to act immediately and also it should override the alarm configured from vCenter level for all the other VM's in the vCenter for a maximum size of 2TB.. This is because I receive a 2TB alarm\email from vCenter on daily basis for this VM which is not necessary. Hope this makes sense. Thanks