Select Page

Sample PowerShell Scripts for Starting and Stopping Azure ARM VMs in a Resource Group

I was recently working on a proof of concept in Azure for a client that needed a couple of VMs to test if Azure is a viable candidate for their on-premise workloads. The client only needed those VMs at certain hours on weekdays and that meant that I needed to implement a method to remove any unnecessary run-time costs and that’s where Azure Automation and PowerShell comes in 🙂

Kernel panic after upgrading CentOs 6.5 to 6.7 and LIS from 4.07 to 4.0.11

For those that you don’t know, Linux Integration Services or LIS in short, are a set of drivers that enable synthetic device support in Linux VMs that are running on Hyper-V. Plainly speaking, these drivers allow you have almost all the nice stuff you take for granted when you use Windows under Hyper-V and that’s mouse support (remember the days when you had to press CTRL + Left/Right arrow? Not anymore), dynamic memory, synthetic network adapters (not the legacy Intel 1000 which only works in 10mbps mode) and lots more feature where you can read about HERE

Now recently I got a chance to update LIS from 4.07 to 4.0.11 on some production CentOS servers that were updated to 6.7 a while back that were still running version 4.0.7 without any issues, even if CentOS 6.7 wasn’t officially supported by Microsoft.
So I did all the necessary steps for roll-back purposes and started the upgrade process which worked just fine until I rebooted the VMs and got a very nice cup of kernel panic.

Deploy multiple Azure VMs in a Load Balanced set

In the last couple of weeks I have been working with a client that needed to deploy a two-tier web application that would act as a web store and they predicted that on the launch day about 1500-3000 users would hit the store. Now with that amount of client connections hitting one server would have been a complete failure so we needed to set up multiple web servers and configure Azure’s load balancer to balance the incoming traffic to multiple VMs. Now with the theory in place we just needed to find out how many frontend VMs were needed and after analyzing the facts we settled on the magic number of 10 front facing VMs with one beefy VM on the backend.

After having all the details now comes the hard part. How do I NOT deploy that many VMs manually? I chose not to go with the Azure Resource Manager for this project because I’m not yet convinced that ARM is ready for production deployments so ARM templates were off the plate. Now I didn’t have anything that came even remotely close to help me deploy the much needed VMs so I started PowerShell ISE and wrote a simple script that would create the VMs, create the needed endpoints and add a data disk, set the provisioned IP as static and so on. After an two hours or so I finished the script and ran it to see what happens and the result was OK but the script wasn’t modular enough and it served only one specific deployment and that didn’t help me at all in the long run. So after deploying and configuring all the VMs I started working on turning the script into a function that would help me cover more that one scenario.

PowerTip – Get a nicely formatted endpoint list for your Azure VMs

I was working on an Azure deployment recently and I needed a very quick way to get all the endpoints and local IP from the Azure VMs, rather than clicking threw the portal and copying the endpoints one by one so I opened up the PowerShell ISE, struggled a bit with the Azure cmdlets and presto, got a nice one liner that gives me all the information I need.

SCVMM 2012 R2 – Service Template Deployment fails on “Installing VM Components”

Picture this, you install a brand new Virtual Machine Manager to manage your Hyper-V cluster and after everything works just fine for a month or so, then you get a request to provision a couple of VMs. You say no problem, because you invested a lot of time in creating a couple of service templates coupled with some PowerShell scripts for post deployment configuration so you can just press a button and do something else right?


Pin It on Pinterest