$cred = New-Object “homedomainpowercli“, $pwd $pwd = Get-Content d:vspherescriptspowerclicred | ConvertTo-SecureString # Magnus Andersson, Real Time Services ABĪdd-PSSnapin -ErrorAction Silentl圜ontinue # PowerCLI script to send e-mail if the number of virtual machines per datastore exceeds 48 And if the admins mess up and then move the VM back before the script runs that's ok. Plus it only emails me when the potential that it has happened occurs. It doesn't really answer the question itself of when a VM moves to a particular non-SDRS datastore, but it is a workaround that gets me close enough to knowing. I have that set to run on our administrative server twice a day. I went where EEAA was heading and just ended up with a simple PowerCLI provided from here.Īnd set the "-ge" equal to 1 since the datastore in question should only house the one VM it is intended for. If the user ignores this warning then the VM will be marked as out of compliance. What this will do is ensure that the users will be warned if they try to migrate a VM to datastore that will not support the VM's policy. Associate the desired storage policy with the virtual machines.When creating the policy you will be able to see which datastores are compatible with the policy For example the performance policy is compatible with datastores with the performance tag. Create two storage policies (performance, non-performance) and use a tag based rule for the policy.Tag each datastores with one of the tags depending on the "type" of storage.
0 Comments
Leave a Reply. |