The use cases for PowerCLI and automation continue to amaze me, a couple of nice use cases I have seen recently involve automating the deployment of VM’s for various reasons.
The first reason, performance, what happens when a VM which is sat there for most of the year suddenly becomes busy and doesn’t have enough resources to satisfy whatever service it is trying to provide, do you add more ram, more CPU, what happens when you get to the maximum 8 CPU’s and the maximum vSphere VM memory of 255GB, do you then deploy a second VM and a third etc etc
Take this scenario into consideration:
You work in the UK for a county wide radio station, most of the time your virtualised cluster of web servers is sat there doing nothing, serving the odd hit now and again…but then it snows !
As we know, the UK can not handle snow at the best of times, the country grinds to a halt, the only means of knowing if your children’s school is closed is to check the local radio station’s website….enter our problem.
As you are also snowed in and unable to make it to the office you are unable to build the VM’s and add them to the cluster to allow the existing VMs which are now stuck on 100% CPU usage whilst you dig your car out.
Wouldn’t it be nice if we could have an automated response to this ? I held aloft my sword and said “With the power of CLI” (He-Man fans will get this).
I have two methods for this, the first one is a great script and the second is a bit of fun to show exactly how powerful PowerShell and PowerCLI can be. Continue reading
