The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

Archive for the ‘Hyper-V’ Category

PowerShell is King – Simple resource Metering using PowerShell

Posted by Mikael Nystrom on March 25, 2014

This morning the Big Boss sent an email “There is something wrong, it’s slow, fix it.”

Yes, Sir, no problem Sir, absolutely Sir (you get the picture). Anyway, I know we could have problems, since we are moving around all VM’s to change basically everything from design to hardware, so I needed a fast way to find out on what server, what VM and why. The first thing that comes to mind is the most valuable thing you have in a virtualized platform and that is IOPS, so for a few servers that could be having issues I run this:

 

$ServerNames = "HOST01","HOST02","HOST03","HOST04"

foreach ($ServerName in $ServerNames)

{

Get-VM -ComputerName $ServerName -Verbose| Enable-VMResourceMetering -Verbose

Get-VM -ComputerName $ServerName | Measure-VM | select VMname,AggregatedAverageNormalizedIOPS,AggregatedAverageLatency,AggregatedDiskDataRead,AggregatedDiskDataWritten | ConvertTo-Html > "$ServerName.html" -Verbose

}

MeassureVMSimple

/mike

Posted in Hyper-V, PowerShell, Windows Server 2012 R2 | Tagged: | 1 Comment »

Recording–Windows Server 2012 Hyper-V

Posted by Mikael Nystrom on January 27, 2014

(In Swedish)

För Microsofts räkning så spelade jag in en serie korta filmer, varsågod.

“Mikael Nyström, expert inom setup & deployment och konsult på TrueSec, lär dig att konfigurera Hyper-V och upptäcka alla fördelar med att köra virtuella maskiner i Windows Server 2012. “

/mike

Posted in Hyper-V, Recording, Windows Server 2012 | Tagged: | Leave a Comment »

PowerShell is King – Convert WIM to VHD/VHDX with support for Gen 1 and Gen 2 (BIOS/UEFI) and then some…

Posted by Mikael Nystrom on December 19, 2013

In my line of work, automation is important, since time is the only thing I don’t have. Many years ago I created the WIM2VHD script and that was ok, so when R2 came out I needed to update it to support UEFI. That was easier said then done. The problem is that the UEFI boot process requires fat32, GPT and a bunch of partitions and when using PowerShell to create them the OS will immediately start protecting them after creation which makes it impossible to copy files to the boot partition since it is “protected”, but since I’m a very creative person I found the solution in diskpart. (read about it further down)

Mounting the ISO

I actually have to scripts in this case, one is to mount the ISO that will return the drive letter, kind of handy to have since I need to know the path to the wim file

image

The script to mount the ISO

image

The script to mount the ISO (Text)

————————————————-

# Mount ISO and get driveletter
Param(
[parameter(mandatory=$true,HelpMessage="Please, provide a path to ISO.")]
[ValidateNotNullOrEmpty()]
$ISO
)
Mount-DiskImage -ImagePath $ISO
Write-host (get-date -Format u)" – Mounting =" $ISO
$ISOImage = Get-DiskImage -ImagePath $ISO | Get-Volume
$ISODrive = [string]$ISOImage.DriveLetter+":"
Write-host (get-date -Format u)" – Driveletter is now =" $ISODrive

———————————————–

Getting the correct Index number in the WIM

After the ISO is mounted you can use the Get-WindowsImage commandlet to see what Indexes you have in the WIM file.
The Command Get-WindowsImage – Path d:\sources\install.wim will give me this list.

image

 

Converting the WIM file to the VHDX file

Besides converting the WIM to a VHDX file it also creates the UEFI style disk layout or the BIOS style disk layout. It also give you the opportunity to add the SXS folder to the drive (makes it a bit easier to add .Net framework without internet access or media access) and it will also ask you to add a Tools folder, if you do it will end up in c:\Tools, extremely handy, I usually put things in there that I need, NP++, Sysinternals, 7-Zip, and such.

If you open the script you will one thing that is a bit strange (actually two), when creating the UEFI style disk partition we create the first partition with the WRONG GUID number and that is the way we need to do it, otherwise windows will start protecting the drive, so we create the partition with the GUID for data drive, later on we create a text file and we let diskpart run against that text file that will then change the GUID number to the correct one. scary…

Sample command to create a BIOS based VHDX

.\Create-VHDX.ps1 -SourceFile d:\sources\install.wim -DestinationFile C:\Test\RWS2012R2BIOS.vhdx -Disklayout BIOS -Index 2 -PathtoSXSFolder d:\sources\sxs -PathtoExtraFolder C:\HYDV4\Tools –Verbose

Sample command to create a UEFI based VHDX

.\Create-VHDX.ps1 -SourceFile d:\sources\install.wim -DestinationFile C:\Test\RWS2012R2BIOS.vhdx -Disklayout UEFI -Index 2 -PathtoSXSFolder d:\sources\sxs -PathtoExtraFolder C:\HYDV4\Tools –Verbose

When running it looks like this

I have tested the script on WS2012R2/W8.1 with Hyper-V but it should work on WS2012/W8 as well, just that I don’t have any of those old systems running at home anymore…

image
Since the script is 255 lines of POSH, you better download it from here http://sdrv.ms/1foJ3Wg
/mike

Posted in BIOS, Deployment, Hyper-V, PowerShell, UEFI, Windows 8.1, Windows Server 2012 R2 | Tagged: , | 9 Comments »

Windows Server 2012 R2 Hyper-V – Hands On LAB

Posted by Mikael Nystrom on August 8, 2013

(In Swedish)

Har under våren och sommaren jobbat mycket med Windows Server 2012 R2 och väldigt mycket med Hyper-V vNext och därför ska det bli så förbaskat kul att köra första Hands-On LAB med fokus på Hyper-V baserat på Windows Server 2012 R2, principen är den samma som vi kört tidigare, du bygger en Hyper-V lösning under 3 dagar med i princip alla funktioner som finns, det blir en del UI saker, men framförallt blir det mycket PowerShell då det är det enda sättet att bygga Hyper-V lösningar numera. Då du har tillgång till mer än en server så bygger vi också upp kluster på rätt sätt. Vi snackar LAB på riktigt helt enkelt. Det är inte alltid som det blir fullt, men troligen så vill du vara först med R2 så får du boka upp dej på

http://labcenter.se/Labs#!lab=Mastering_Windows_Server_2012_Hyper_V

(English)

If you are English speaking and you would like to attend to a training on Windows Server 2012 R2 Hyper-V, check out http://www.truesec.com or send an email to per.kimblad@truesec.com

/mike

Posted in Hyper-V, Training, Windows Server 2012 R2 | Tagged: , , | Leave a Comment »

Running DC’s on Hyper-V? – Please read this – Keeping your Virtual Active Directory Domain Controllers Safe

Posted by Mikael Nystrom on July 23, 2013

At the Hyper-v.nu site Hans Vredevoort has written a very important post regarding running DC’s virtualized (which I do and many of our customers), but there are things that should be aware of, so I urge you to read this, like now

http://www.hyper-v.nu/archives/hvredevoort/2013/07/keeping-your-virtual-active-directory-domain-controllers-safe/

/mike

Posted in Hyper-V, Windows Server 2012, Windows Server 2012 R2 | Tagged: , , | 2 Comments »

Nice to Know – Video: Hybrid Cloud (Swedish)

Posted by Mikael Nystrom on July 3, 2013

FrontPage

Jag fick jobbet att spela in en packe filmer, vilket jag nu har gjort, det blev totalt 17 stycken om Windows Server 2012, Windows 8, Office 2013, System Center 2012, Private Cloud, Public Cloud, Partner Cloud kring saker JAG tycker är viktigt att förstå och kunna. Hur kan man ha roligare

Nionde filmen handlar om Hybrid Moln (vilket är skitballt)

/mike

Posted in Azure, Cloud, Hyper-V, SCVMM, System Center 2012, Windows Server 2012 | Tagged: | Leave a Comment »

Nice to Know – Video: Private Cloud med SCVMM 2012 (Swedish)

Posted by Mikael Nystrom on July 3, 2013

FrontPage

Jag fick jobbet att spela in en packe filmer, vilket jag nu har gjort, det blev totalt 17 stycken om Windows Server 2012, Windows 8, Office 2013, System Center 2012, Private Cloud, Public Cloud, Partner Cloud kring saker JAG tycker är viktigt att förstå och kunna. Hur kan man ha roligare

Åttonde filmen handlar om Private Cloud baserat på System Center 2012 SP1

Posted in Hyper-V, SCVMM, System Center 2012, Windows Server 2012 | Tagged: | Leave a Comment »

Nice to Know – Video: Windows Server 2012 – Hyper-V (Swedish)

Posted by Mikael Nystrom on July 3, 2013

FrontPage

Jag fick jobbet att spela in en packe filmer, vilket jag nu har gjort, det blev totalt 17 stycken om Windows Server 2012, Windows 8, Office 2013, System Center 2012, Private Cloud, Public Cloud, Partner Cloud kring saker JAG tycker är viktigt att förstå och kunna. Hur kan man ha roligare

Sjunde filmen handlar om Hyper-V

/mike

Posted in Hyper-V, Windows Server 2012 | Tagged: | Leave a Comment »

Sommarkollo 2013 – Hybrid Moln skapar förutsättningar för en elastisk infrastruktur

Posted by Mikael Nystrom on June 19, 2013

Under denna session kommer vi att visa hur du kan koppla ihop din egna lokala infrasctruture med Azure Virtual Machine för att på så sätt skapa möjligheten att enkelt kunna expandera vid formtoppar.

4/7 Anmäl dig till sessionen här >

22/8 Anmäl dig till sessionen här >

Posted in Azure, Hyper-V, SCVMM, System Center 2012, System Center 2012 R2, Virtual Machine Manager, Windows Server 2012, Windows Server 2012 R2 | Tagged: | Leave a Comment »

Sommarkollo 2013 – Hantera den nya generationens infrastruktur med System Center 2012

Posted by Mikael Nystrom on June 19, 2013

Du har just fått reda på att du har alla licenser för System Center 2012. Frågan är vad du kan göra med plattformen som förbättrar, förenklar för dig och verksamheten. En sak säker, du kommer att kunna säga ”Ja, absolut, inga problem” bra mycket oftare än du kan idag. I denna session går vi praktiskt igenom vilka funktioner och möjligheter du har i vissa givna scenarion, du kommer att lära dig att hantera klienter, så som Windows, Android, Ipad likaväl som Hyper-V, Virtual Machines, Automatisering och self service funktioner.

Notera att dessa seminarium är kostnadsfria

Anmäl dig till sessionen den 3/7 här >

Anmäl dig till sessionen den 14/8 här >

Posted in Hyper-V, MDM, System Center 2012, System Center 2012 R2, Windows 7, Windows 8, Windows 8.1, Windows Intune, Windows Server 2012, Windows Server 2012 R2 | Tagged: | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 2,339 other followers