Archive

Archive for the ‘Automation’ Category

Automation the future of IT Operations or prepare to die

September 19th, 2014 No comments

So you are an IT Pro or maybe an CIO or CTO and have been sleeping under your desk the latest years or so? But the IT Operations departments are under a lot of stress these days coping in being able to deliver the services to the business in the pace that they demand! Do you recognize this? For example your development division request 50 VM´s and wanted them yesterday, Your response is that come back in a week or two….

Many IT departments are seeing their internal customers such as Dev or Business going outside of the organisation and buying their services directly from Azure or another public cloud provider delivered instantly and that also cheaper than you could produce internally..

Here the Hybrid way of thinking becomes important and why, well you will not be able to compete with all the services that the public cloud can give you in a cheaper and more reliable way so IT Operations of tomorrow will utilize the public cloud as their own and be able to use it for their needs where their private cloud lacks functionality or capacity and in that way respond to the requests from the departments.

Giving the users an self service portal where they can order and see the cost of their engagements is an important part of this and when you implement this you have to have  automation as a key part because the users want things to happen when they press the build button!

51075482-98cb-11e3-82f1-12313b12ccaf-large

Taking Microsofts Azure data centers as an example, they have automated enormously and that from the physical layer all the way into the virtual machines and networks. How does this automation gain you with your environment and becoming more agile and not just run around putting out fires but being able to address the needs of the company IT challenges today and also tomorrow!

Some say that we are in the second machine age and that the IT will have to change big time. Just look at the public cloud Company’s and their services, if they would have done things in a traditional way they would have to charge xx times the amount the charge for their services and also be xx more manpower on the data centers to cope with the day to day operation.

In the latest year Microsoft have released several automation solutions that have been developed and gives you the tools for this must-have automation platform. First of is the Service Management Automation (SMA) which is a robust orchestration engine based on PowerShell workflows and this has also been released as Azure Automation. Secondly we have Microsofts investment in Desired State Configuration and here this also utilize PowerShell. The DSC have some development left but it is so powerful and really large web services utilize this today and keeping their massive services compliant and up to date! DSC can be used for provisioning different things including third party software solutions and for example, Microsoft Azure offers different web services (jomla, wordpress etc) deployed in an automated way probably with some DSC technology behind the curtains.

Of course this gigantic automation project will not be done over a night and will cost quite a bit of money in initial investment but the winning and surviving IT Department is the one successful in their automation processes!

9 years ago I started an onboarding automation process and on that time I had VB script to work with but that manual labor every time a new employee was hired was painful and so boring and already at that time I found the will and inspiration to learn techniques to automate. Still today there are several processes in companies that are perfect candidates for automation but for some reason still being done manually…

Let me help you get Strategic in your IT (automation) delivery!

Categories: Automation, General Tags:

Adding more external IP´s to your WAP NVGRE VM´s

June 3rd, 2014 No comments

So I have been during these two last days been in deep waters to find out a customers demands and the possibility to add more than one external IP to the same NVGRE enabled VM network within WAP and VMM and the Hyper-V Network Virtualization Gateway this as the ports from the external application the customer has cannot be altered and they need to access several different VM´s simultaneously.

Described in this visio diagram the customer wish is:

Drawing1

 

As you maybe know, within the VMM when you have configured the HNV there is no possibility to add more external addresses in the GUI and configure port forwarding.

networknatvmm

So how to do this then, well there is a way and that is called PowerShell on the HNV Gateway and first you add the external address and then add the NAT rules

Here is a screendump of an addition of a port rule:

newnetnatbinding

To get the NatName I added the first external IP and Port rules through VMM and then I could use that information when creating the rest config from within the HNV gateway.

The following cmdlets are available on the HNV GW

Screen Shot 2014-06-03 at 19.01.09

Observe though that when adding these things directly in the HNV GW you cannot manage these rules and IP addresses in Windows Azure Pack portal or VMM!

 

Channel 9 videos available from TechEd US 2014

May 23rd, 2014 No comments

Recordings and code from SMA and Powershell webinar with Veeam

March 29th, 2014 No comments

Last week I had two webinars together with Veeam in the subject of “Automating daunting virtualization tasks”. Now these have been uploaded and shared on Veeams web. One is in swedish and one in english. during the webinar I show some different tasks that can be managed and handled with the Service Management Automation (SMA) and utilizing PowerShell.

51075482-98cb-11e3-82f1-12313b12ccaf-large

here is the english version: http://www.veeam.com/videos/webinar-replay-service-management-automation-akerlund-en-3932.html

and here is the swedish version: http://www.veeam.com/videos/webinar-replay-service-management-automation-akerlund-sw-3649.html

Here are some of the tasks and the PowerShell code,

First one of the tasks was adding VM´s to cluster where I utilize the function in this link

Next task that can be automated that you always will have a percentage free on the C drive for the VM´s (it both shrinks and expands), I am utilizing the generation 2 VM´s so for this to work your VM´s have to be configured with this latest virtual hardware version on Hyper-V 2012 R2

As you can see when I extend the size I make the VHDx about 230 MB larger to be able to set the partition to the size calculated regarding the overhead of the virtual disk, so if I would have tried to make both the VHDx and partition 15GB it would fail..

The rest of the scripts will be uploaded later in a follow up post. Of course there can be improvements in the ways to do things and if you have any comments or ideas please share :-)

 

Veeam webinar 19/3: Automate daunting virtualization tasks with SMA

March 5th, 2014 No comments

On wednesday the 19th of March I will together with Veeam have a web seminar with the topic:

Screen Shot 2014-03-05 at 21.54.12

Automate daunting virtualization tasks  with SMA

Now that you have set up your virtualization environment, you’ll want to automate it. In this webinar, you will learn how to do this with Service Management Automation(SMA) and how to integrate automated tasks into the Hyper-V virtualization environment. You will use different runbooks to automate some boring but necessary tasks that IT admins have to do.

This webinar will show you how to:

  • Automate patching of virtualization hosts
  • Expand virtual hard disks based on usage
  • Automatically update integrational components on VMs
  • Automatically update virtual hard disk templates
  • Clean old snapshots that have been forgotten
  • And more…

If you want to register and be part of this crazy one hour with the Swedish Chef you can do it on the following link

And guess what, It comes in a swedish version also! Check out in the following link and if you understand Swedish, register here!

Nordic System Center Summit – Migrate to Hyper-V

December 6th, 2013 No comments

logo

The last two days I was on the road and presented my session on migrate to Hyper-V and that on the Nordic System Center Summit that was hosted by my company Lumagate. We visited both Stockholm and Oslo.

Both Travis Wright and Chris Ross from Cireson was with us and had some really interesting sessions!

In my presentation I described the different ways to migrate and how to prepare for a large migration and that in different ways of automation.

Here is the presentation:

Migrate-TO-HyperV

And if you have a PC/MAC you can view the presentation directly here with PowerPoint Webapp

Categories: Automation, Hyper-V, SCVMM, Virtualization, VMware Tags:

When to select SC Orchestrator over vCenter Orchestrator

September 25th, 2013 No comments

vsorch

I got a question from a customer why they should choose System Center Orchestrator instead of vCenter Orchestrator.

Both products work in the automation field and can do quite much, as they both are extendable and you can develop add-ons, the possibilities are almost endless!

In the case of the System Center Orchestrator, it is included in the System Center suite so if you already use some of the components  and have the licenses in place then you can start automating a lot more.

In the case of vCenter Orchestrator, it is included in the vCenter license that you buy in your vSphere suite.

Both orchestrators are very easy to start working with as they are gui based. the vCenter Orchestrator integrates into the vSphere client and from there you can easily start the wanted workflow. With both you can create workflows/runbooks and let users connect to a web console to kick of the action.

Example of a runbook from SCO

exempeluseradd

Example of a workflow from vCO

Screen Shot 2013-09-26 at 09.53.23

In both there are possibilities to automate for example Active Directory and users. Onboarding processes when new employees start is an example of an process that often involves quite some manual intervention and benefits from automation. Giving end users and system owners the possibility to create and manage their own virtual machines through a web portal is another example that would offload the IT departments technicians busy day. The list of examples goes on and on…

System Center Orchestrator Architectural overview:

Screen Shot 2013-09-25 at 21.49.06

vCenter Orchestrator Architectural overview:

Screen Shot 2013-09-25 at 21.39.22

Comparison table:

SCO VCO
Licensing License required only for endpoints being managed.
No additional System Center licenses are needed for management servers or SQL Server technology.
vCenter standard license, no extra cost
Web console Yes Yes
Third Party Plugin/IP Yes Yes
Custom Plugin/IP development Yes Yes
Manage VMware vSphere Yes Yes
Manage System Center Yes No (not out of the box,requires quite a bit of customization)
Workflow/Runbook templates No Yes
Import/Export Workflow/Runbooks Yes Yes

 Conclusion

 So what orchestrator should you go with? Well it depends of course and here is my opinions,

If you have a VMware environment but run mostly Windows Servers and Microsoft applications and already have one or more System Center roles deployed the favor is in the SCO hand as SCO integrates so well with the Microsoft software using the supported Integration Packs and you also can with the VMware IP manage the vSphere environment. The rich amount of activities that the Integration Packs consists of makes it easy to start automating and quickly expand the scope and get some serious automation results in the whole stack! The SCO community helps you a lot when creating runbooks and that with the possibility to import a whole set of runbooks from other IT Pro´s can get your automation goal to be achieved quickly.

If you have a VMware environment and do not use any System Center roles and also have a more diverse load of VM´s with different operating systems, but still want to start automating your environment I would recommend the vCO. One big advantage that the vCO has is that it comes with a wide range of workflows already created and ready to be customized which helps you in the speed to automate.

From a licensing perspective it should be noted that as described in the table, you must have a System Center license on every physical device you plan to automate with System Center Orchestrator. On the virtualization hosts you would use the Windows Datacenter and System Center Datacenter licenses that gives you unlimited VM´s that you can manage. On single physical hosts you must use a System Center Standard license, but as I said above, if you already have another System Center Role you probably have the licensing in place :-). vCenter Orchestrator comes with the vCenter license and there is no extra licensing cost for managing single hosts or Active Directory.

Categories: Automation, SCO Tags:

Adding multiple Windows hotfixes with wusa and PowerShell

September 13th, 2013 No comments

Today I have been exploring a bit in patching  hyper-v hosts with windows updates and hotfixes and when we have a cluster we can use the CAU ( Cluster Aware Updating) that can help you in the process of getting those hotfixes on in a automated fashion but that does not work on single hosts..

In my blog post about checking the hosts for updates and hotfixes I also have added the functionality to download the hotfixes from Microsoft´s servers..

An easy way to add several hotfixes to a host is to use PowerShell with wusa (windows update standalone installer) and it eats .msu files gladly.

But wait, the hotfixes is in a self-extractor exe with at least for some no command-line way to automate, BAD!! So PowerShell to the rescue again, and here on this blog post I found a guy making a PS function to unzip an archive file and it works on the hotfix.EXE also!

Screen Shot 2013-09-13 at 20.18.45

Get-Item .\* | %{Expand-ZipFile -FilePath $_.FullName -OutputPath c:\hotfixes}

And then we can use the WUSA and that wrapped in a foreach with a little while loop to handle that not a  new wusa starts before the preceding one is done as it cannot be run several instances simultaneously (maybe there is a better way to do this of course but this works ;-) )

Screen Shot 2013-09-13 at 14.38.17

Get-Item c:\hotfixes\* | foreach {WUSA ""$_.FullName /quiet /norestart"";while(get-process wusa){Write-Host "Installing $_.Name"}}

And to see if your hotfixes has been installed you can use the following command

check-hotfixesinstalled

Get-HotFix | Where Description -match hotfix

(Get-HotFix | Where Description -match hotfix).count

and of course after installing the hotfixes we need to reboot :-)

Importance to set Dynamic Memory Maximum in Hyper-V 2012

July 25th, 2013 No comments

In my little lab it was quite the time to do an rearm of the servers licenses as I had installed them with the evaluation version. This can be done with the slmgr.vbs /rearm command and a reboot.

Screen Shot 2013-07-23 at 11.08.23

And when I came to the second server where the domain controller resides I noticed that it consumed a lot of memory for just having the DC role.

Screen Shot 2013-07-23 at 11.14.26

When looking a bit closer I noticed sessions where me and a colleague that have been logged in but in disconnected mode and consumed both CPU and memory. In almost every server this is not optimal where Admins can stay logged in forever and this can be handled with a GPO setting to restrict the time for a disconnected session on servers residing in a specific OU.

 Screen Shot 2013-07-23 at 11.18.52

 Another problem was that when I created the DC VM I just activated the Dynamic memory without setting any limits and this could cause a host with no physical memory left and VM´s going crazy with allocated memory. Setting the Startup memory is important but also setting the Maximum RAM, I have as a best practice to set the startup and Maximum to the same values.

Screen Shot 2013-07-23 at 11.21.41

With PowerShell I easily could change the settings of the VM to have a more reasonable maximum value than 1TB. And as you can see with the -PassThrough parameter I can do it in one line.

Screen Shot 2013-07-25 at 11.18.34

PS C:\> get-vm dc01 | Stop-VM -Passthru | Set-VM -MemoryMaximumBytes 2GB -Passthru | Start-VM

And after the DC restarted you can see that it only consumes 624 MB RAM.

Screen Shot 2013-07-23 at 11.34.37

Resizing VHDX´s on running VM´s in Windows 2012 R2 Hyper-V

June 30th, 2013 1 comment

As I described in an earlier post about why you should think about creating VM´s with Windows 2012 now when the Windows 2012 R2 have arrived I have now tested the online VHDX resize function.

And as I already have emphasized is that you can only online resize VHDX´s that are connected to a SCSI controller, and it is only on Generation 2 VM that your Hyper-V VM´s can have the boot disk connected to the SCSI and also that limits the number of OS´s (Windows 2012/2012R2 and Win 8/8.1)

I have not yet successfully migrated a Gen 1 VM´s system disk to a Gen 2 but I am working on it :-P (the Gen 2 uses UEFTI and GPT) and some kind of backup/restore will probably be required..  I will post updates in my pursue of this task.

Screen Shot 2013-06-28 at 22.56.20

In the following part of this post I want to show you how I resize both a VHDX with the system and boot partition on it and an additional VHDX with data on the VM running on the Generation 2.

As you can see with this PowerShell I can easily extend the VHDX and also with the following command I can get the minimum size that I can shrink it to, this depends on the volume inside and that can also be shrunk online of course, that has been possible since Windows 2008. I have also gone through this case in an earlier post, the main difference here with R2 is that it can be done online.

When checking the help for the Hyper-V PowerShell module in R2 it can be noted that the help information has not been updated as it says still that it is an offline operation :-P

Screen Shot 2013-06-30 at 16.55.16

So to resize during the VM is running is shown here in the following screendump, and as you can see, both the system drive and the L-drive are extended.

Screen Shot 2013-06-30 at 19.58.34

And here you can see how we can shrink the VHDX also, note that I have extended the system volume with 3 GB inside the VM also so the minimum have gone up all this when the VM was running!

Screen Shot 2013-06-30 at 19.59.50

Here is the Powershell

Get-VHD (Get-VM winshrink | Get-VMHardDiskDrive).path | Select @{Label="SizeGB";Expression={"{0:N0}" -f ($_.Size/1GB)}},@{Label="MinSizeGB";Expression={"{0:N0}" -f ($_.MinimumSize/1GB)}}

Get-VHD (Get-VM winshrink | Get-VMHardDiskDrive).path | where Path -match winshrink.vhdx | Resize-VHD -SizeBytes 30GB

Get-VHD (Get-VM winshrink | Get-VMHardDiskDrive).path | where Path -match L.vhdx | Resize-VHD -SizeBytes 60GB

Get-VHD (Get-VM winshrink | Get-VMHardDiskDrive).path | where Path -match winshrink.vhdx | Resize-VHD -ToMinimumSize

Get-VHD (Get-VM winshrink | Get-VMHardDiskDrive).path | where Path -match L.vhdx | Resize-VHD -ToMinimumSize

Happy extending and shrinking your SCSI attached VHDX hdd