System Center Universe 2016 @ APAC

One of the best System Center summit happening around the world. As a Infront employee I’m happy to announce our company did host the event for the third time in APAC region. This time in Malaysia soon after that in Australia. All the well known System Center experts in one room sharing their knowledge. I’m glad that I got the opportunity to be among those experts and carry out two sessions.

Azure becoming key topic for developers and IT Professionals. How we can save time be leveraging templates. This is where we can leverage Azure Resource Manager Templates. Carried out a session to show how ARM really can help for IT Professionals in their journey.

Disaster recovery can be taken to next level by leveraging the Azure cloud. Delviered another session covering how Microsoft extend their love to protect VMWare customers as well Smile In this session we covered about Azure Site Recovery for HYPER-V, VMWare & Physical servers. We also demo what is “Enhanced mode for VMWare” and what that is so cool.

123SCU-2016-002SCU-2016-004SCU-2016-005SCU-2016-007SCU-2016-018SCU-2016-021SCU-2016-027SCU-2016-031SCU-2016-034SCU-2016-067SCU-2016-071SCU-2016-077SCU-2016-088SCU-2016-099SCU-2016-112SCU-2016-272

Hyper-V PowerShell Script Cookbook

In my public speaking and in user groups I always highlight the IT Professional the importance and the value of PowerShell. It’s THE future for Microsoft and non Microsoft techies along the way. In Windows Server 2012 we have more than 2400 PowerShell cmdlets to show how serious Microsoft about the PowerShell.

For HYPER-V fans we have been taken whole new level by “Gershon Levitz” By introducing TechNet Wiki article in HYPER-V PowerShell script book page. This is a collection of PowerShell samples which we can use for our day to day task on HYPER-V related work. Most of the PS scripts has been categorize as,

  • Virtual Machine
  • Virtual Hard Disk
  • Network Virtualization
  • Virtual Switch
  • Additional Scripts

My 2 cents suggestion is keep this site in your favorite bookmarks and refer it and also share your sample scripts to the community. If you want to know all the HYPER-V related PS commands and usage you can refer to this link.

Creating Resource Pools in HYPER-V 3.0

In Private cloud environments, Enterprise networks in’s a common necessity to aggregate resources and allocate them and meter them rather than assigning them individually. With the aggregation comes the easiness of resource monitoring. In HYPER-V 3.0 hyper-v team offers this capability as resource pools.

The simple idea is to aggregate resources and provide them to virtual machines or tenants if it is service provider (This can be large organization who provide tenants level resource allocation to each departments as well) There are various resources types we can allocate under the HYPER-V 3.0,

  • Memory
  • Disks (VHD)
  • Processor
  • Ethernet
  • ISO
  • Virtual Fibber Channel Ports
  • Virtual Floppy Disk

I think over the time this list will grow Smile

We’ll have a look at an example for this. At this stage creating resource pools has been limited to PowerShell cmdlets instead of GUI. But you don’t mind that right Smile For the demonstration I’ll create Storage pool consist of several VHD files. I’ve created a folder called “ResourcePool” and copied 3 VHD files into that,

image

Now we’ll go ahead and create the resource pool in hyper-v by typing the relevant PS command, but wait before that I want to show my current machine status of resource types,

image

Ok now we’ll move ahead with the PS command,

image

image

Now we’ve created the resource pool (whew isn’t that so simple Smile ) ok now we’ll move to the HYPER-V MMC and try to create a new VM and select the VHD from the resource pool,

image  image  image  image

image  image 

image 

As you can see we’ve skipped the allocation of disk in the initial steps and arrive to the settings page on that particular VM. After that from the disk pool we’ve selected pre created VHD file. Once you enable resource pool (in this example VHD) you can enable resource metering as well. This will help hosting companies or large enterprise companies to monitor and track the resource usage of that allocated resources and carry out the billing. Some of the metrics that can be monitored using resource metering are,

Average, minimum and maximum VM memory usage, VM processor usage, Total VM Disk allocation…..etc.

In the above example I’ve created a VM named as “Test-VM1”. To monitor this VM we can go ahead and enable the PS command “Enable-VMResourceMetering”

image

After that you can monitor the resource usage of that VM by typing the following command,

image

Output will be as follows,

image

After making the VM little bit busy the output is as follows,

image

We can measure the resource usage of the VM’s or particular VM by using PowerShell as well. to see the resource usage of the “Test-VM1” we can use the PS command as well,

image

if you want to see the resource usage on individual components (Eg: memory, VHD, CPU) you can do that with PowerShell as well. Below picture demonstrate some of these commands and the output results.

image

Now if you want to disable the resource metering for the “Test-VM1” all you have to do is type
Disable-VMResourceMetering –Vmname Test-VM1

PowerShell in windows has been become very strong and Microsoft always encourage to use them. In Datacenter and Hosting environment you prefer to carry our many task automated as much as possible or with minimum time. PowerShell is the answer for that. In case you have not updated PowerShell Help section you can do that by typing “update-help” from PowerShell itself. In case if you want to see an example of hoe to type for a particular command you can type “Eg: Get-help get-vm –examples” when you get to know more into PowerShell you’ll enjoy spending less time with GUI Smile

PowerShell module for hyper-v

PowerShell is a very powerful tool you can use across Microsoft technologies. Microsoft will keep on adopting and improving this technology every time. Right now PowerShell module ver 2 for HYPER-V has been released. This article will discuss how can you install the modules correctly into your Windows 2008 R2 server. Please note this is for Windows 2008 R2 only!

First get the PS modules from the codeplex web site. Url is here

image

Download the zip file to a root drive or any preferred area and unzip. Once that complete locate the “install.bat” file and execute it with administrator privilege.

image

[install hyper-v module13[4].png]

[install hyper-v module15[4].png]

Once the installation completed, we’ll move the unzip folder in the PS module folder located in the root drive, (I’ve rename the folder as HyperV and copied to the modules folder)

image

Now we can import this to the system by executing through PowerShell. Open the PowerShell and try to run “import-module HyperV” you’ll grant with a error messageSmile

image

We need to enable the execution permissions to import the module, please follow the instruction mention in below screenshot,

image

After that import the Hyper-V modules,

image

Now when that complete we can run the command “Get-Command –Module hyperv” to list down the available commands,

image

Now we have plethora of task can be automated combing these commands, it’s all about your imagination Smile

image

Overcome phobia for PowerShell

Microsoft introduced PowerShell with Windows 2008 as a central method to manage the Windows platform. If you look at the history of PowerShell it has been around in various method (Eg: Scripts, WMI…etc) Actually PowerShell has been there with the introduction with Exchange 2007. But most of the administrators stayed away from the CLI and wanted to stick with GUI. In the Linux world this is one humor factor for the Windows Administrators. If you loose the GUI you can’t do anything despite with limited commands available in the dos.

In Microsoft roadmap PowerShell is a key technology. They wanted to have it as a central de facto for managing Windows software. So if you’re a system administrator who is overlooking Windows servers you better ready for this. So what makes system administrators skip away from PowerShell? The main answer is it is CLI! and they hate for typing lengthy commands plus they need to have the script knowledge. Most of the surveys carried out by MS and third party reviewers proved this.

Microsoft has been taking every step to overcome but as a fundamental rule “Changes are not accepted happily” Microsoft is trying to improve the PowerShell by introducing GUI to that in certain level. But today my attention goes to totally different third party software called ‘”PowerGUI” offered by Quest software.

Quest company is Microsoft Gold Certified ISV partner providing solutions for MS software. They have introduced PowerGUI as a free software along with various PowerShell command packs develop by their staff members and forum users.

To be honest I’m also little bit reluctant to PowerShell but with this software it makes us really easy to embrace the new technology with less hassle. As a new user to PowerShell and PowerGUI software you will find lot of resources to get up and running. The interface is very simple to understand. As long as you know AD, Exchange console this software will be not that difficult to understand. One cool feature I found out is filtering has been carried out to extend level. In my customer visit I get lot of inquires about how to get report like this, that filter in various methods, well answer is PowerGUI.

Apart from that you’ll also find a PowerShell Editor as well. One nifty feature is whatever the command you tried to create using GUI in the background you’ll find the relevant PowerShell command. So you can cut and paste it and then do slice and dice and adjust it, optimize it and experiment it.

1

2

Apart from that creating your own PowerShell commands will be a breeze with the embedded technologies.  So my two cents recommendation is go for it, use it, taste it and be ready for the future Smile