The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

Archive for the ‘SCVMM’ Category

Nice to Know–Deploying Applications using System Center Virtual Machine Manager 2012 (SP1/R2) in UI or in PowerShell

Posted by Mikael Nystrom on August 21, 2013

Yes, I know, there other methods to deploy applications, but sometimes it make sense to use SCVMM to deploy applications to the host machines that you manage. If we look on this from a new and more modern way, SCVMM will be the System Center member that does the deployment of the “only” needed physical machines, that is the Hyper-V hosts and the fileservers used to store the VHDx files over the the SMB network, maybe there is no Configuration Manager Server in this datacenter for any reason.

The App = HP Service Pack

In this case we are going to deploy the HP Service Pack to our hosts since we need that to be able to monitor correctly using OpsMgr (When using an Agent) amongst many things. The Application can be “pushed” from a central location but in this case we are going to run the application locally on each and every server and reboot it if needed. The Command to make a silent express install is HPSUM.exe /express_install and you download the Service Pack for the Proliant servers from HP.com (https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPICE#Download). After downloading the ISO, mount and extract and share the folder so it is accessible to all your hosts.

The GUI Method

Rater easy actually, we can use the “Run Script Command” that is available on every server in the SCVMM Console and then fill out all the parameters

image

Fill out the parameters like this:

-Executable program: \\vmm01\CD\hp\swpackages\hpsum.exe

-Parameters: /express_install

-Timeout: 1800

-Advanced:

–Standard Output: Do not match

–Standard error: Do not match

–Exit Code: Do not Match

–Action when matched: Warn and Continue

–Job restart action: Ignore Script

–Always restart after the script has finished running: Checked

–Restart the computer or virtual machines if the specified exit code is returned: Unchecked

image

Summary using the UI:

This will work, but not they way I wanted it to, the problem is that I cannot define my own values in the dialg boxes, as an example the application HPSUM.exe will return exit code 1,2 or 3 when it needs a reboot and that cannot be “picked” in the dropdown list, however, using PowerShell well be easier, better and faster since you can define all the applications in an XML file wit all the different settings. so lets drop the UI and switch over to what works and make sense, PowerShell :-)

The PowerShell Method

In this case we will use the same engine, but fire it of using PowerShell instead, it gives us more flexibility and more control

Step Number One – Create the Apps.XML

Here we create an XML file that contain all the settings for all the different application we would like to deploy and here it how it looks:

image

as you can see it contains the application, arguments, reboot settings and all the return codes this application could return when it “feels” that it needs a reboot

Step Number Two – Create the Deploy-Apps.ps1 script

The script uses the Parameter function to read in data from the command line and then it reads the XML file, we also need to make sure that some of the data from the XML file is parsed correctly as strings or as Boolean. Then we use all that data set some static settings and last we use the Invoke-SCScriptCommand to execute the command on the host, the script looks like this:

image

Step Number Three – Execute!

Execute the script like this:

image

And wait for the job in the log and after a while it will inform you that the job did finish with warnings, the reason for the warning is that is actually a real warning from the application that is picked up up by the output :-)

The hpsum.exe detects the version of windows as 6.2 (and that is correct), but even if HP claims that is supported, the HPSUM.exe does not have the same opinion :-). Hopefully HP will fix this later.

image

So in the Job log it will show up like this:

image

Summary using PowerShell:

This gives a more stable solution which can be extended and automated and that I like…

You can download the scripts from here:

Posted in Deployment, PowerShell, SCVMM, System Center 2012, System Center 2012 R2, System Center Virtual Machine Manager 2012, Virtual Machine Manager | Tagged: , , | 4 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 »

OS Deployment – Deploying Hyper-V hosts using System Center Virtual Machine Manager 2012 SP1 PowerShell Prompt – Part 1(2)

Posted by Mikael Nystrom on June 22, 2013

Working with OS deployment pretty much means that, I don’t really care if it is a client OS or a server OS, its still Windows from my perspective, there are small differences, but basically it is the same. One of the challenges you might have is to deploy Hyper-V host machines using System Center Virtual Machine Manager 2012 SP1 and with challenge I mean its is very opposite from MDT or SCCM, or even WDS since all of those belongs to “controlled my client/agent” but when it comes to SCVMM it is more of “controlled by SCVMM”. In this first part I will cover the Server Deployment, not the network configuration and reason is that I do this in a 2 –step process for many reasons, but the most obvious is:

  • If a customer would like to use any other method for the OS deployment part I can easily remove this part and replace it with the customer demands and still keep my script that does the network configuration easily
  • Using this method it pretty much work with any hardware in any configuration

Challenges?

Yes, there are some

  • You need to have a PXE environment and it cannot co-exists with Configuration Manager and it needs to be added to SCVMM
  • The server/compute/host needs to be configured to boot in PXE mode
  • The server needs to support IPMI or SMASH and you also need the password for that
  • SMBiosGuid mess: This is the bad and ugly, some vendors have ONE SMBiosGuid number when you ask IPMI and an other when the server boots and contacts WDS and therefore we need to know the “real” SMBiosGuid number (Easy, just boot the machine into PXE and check the WDS log

image

In the picture you can see the SMBiosGuid number that is used by the server when presenting it self to the PXE server, if that is correct it all works, otherwise we need to “cheat” just a bit and we do that by providing the real SMBiosGuid (can only be done using PowerShell)

The solution:

For this to work you need to have created the basic things in SCVVM, tings like logical network and such and now over to PowerShell :-) and here is how it looks:

Here is all the variables we use

  • $OSDComputername = “The name of the computer to be installed”
  • $BMCAddress “The IP address of the BMC”
  • $MGMMacAddress “The Mac Address that should be used as the management NIC”
  • $MGMIPAddress “The IP address the computer should have as the Management IP address”
  • $SMBIOSGUID “The REAL SMBIOSGUID Number”
  • $HOSTProfileName “The name of the Host Profile to be used”
  • $HostGroup “The host group in SCVMM to put it”
  • $IPv4Subnet “The subnet of the Management IP address”
  • $RunAsAccount “The IPMI RunAsAccount that has the correct permissions to perform IPMI operations”
Section 1 :

The Parameter section, this section is created so that you can either read all the information from an .csv file or provide it on command like like it was a CMDLet

image

Section 2 :

We have all data, now we just need to get the data from SCVMM so we can start deploying, we also add a DNS A record for the machine, now that should NOT be needed, but to increase the odds to success I have started to add it since I hate “almost”

image

Section 3:

Time to deploy

image

Section 4:

You also need the CSV file to put in all the data and here is an example

image

And the you need to kick of the deployment

Import-Csv SCVMMostDeploy.csv | Deploy-HostII.ps1

/mike

Download here

Posted in Deployment, SCVMM, System Center 2012, Virtual Machine Manager | Tagged: , | 3 Comments »

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 – Djupdykning i Nätverk och Storage i System Center Virtual Machine Manager och Windows Server 2012 – en magisk upptäcksfärd

Posted by Mikael Nystrom on June 19, 2013

Det finns två saker i nya Windows Server 2012 som man måste förstå och som har en flexibilitet som få har förstått. I denna session rätar vi ut alla frågetecken när vi dyker ner i detaljerna kring Virtual Switches, Virtual Network Adapters, Q o S, SMB3, Storage Spaces, FibreChannel, ISCSI, Cluster Shared Volumes och självklart blir det mycket PowerShell då det mesta av detta endast kan konfigureras med hjälp av PowerShell.

Notera att dessa seminarium är kostnadsfria

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

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

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

Nice to Know – Debug Logging SCVMM 2012 SP1

Posted by Mikael Nystrom on May 10, 2013

It happens that you need to find issues, yes, trust me it happens even for me… and here is how:

To enable VMM debug logging, use the following steps:

  • Create a folder called C:\vmmlogs.
  • Open an elevated PowerShell window on the VMM server or host computer and run the following commands (the second command may wrap in your display):
logman delete VMM
logman create trace VMM -v mmddhhmm -o $env:SystemDrive\VMMlogs\VMMLog_$env:computername.ETL -cnf 01:00:00 -p Microsoft-VirtualMachineManager-Debug -nb 10 250 -bs 16 -max 512 -a
  • Start the trace by typing the following command in the elevated PowerShell window:
logman start vmm
  • Reproduce your issue.
  • As soon as you reproduce your issue, stop the trace by typing:
logman stop vmm
  • Switch to C:\vmmlogs. 
  • To convert the trace, type the command:
Netsh trace convert <filename>
  • Read file, find issue, fix, have a nice day.

The original post from Microsoft is here

/mike

Posted in SCVMM, System Center 2012 | Tagged: | 1 Comment »

Service Providers, Hosters, SPLA partners in Sweden – It’s time for the gathering of the year!

Posted by Mikael Nystrom on April 26, 2013

Det är dags för årets stora turné! Jag kommer att åka till Malmö, Göteborg och Stockholm och köra ett en dags seminarie med fokus på hur man bygger en elastiskt och flexibel infrastruktur med självbetjäning och interna automatiserade funktioner. Hela lösningen baseras på System Center 2012 SP1 och Windows Server 2012. Med andra hur man bygger ett så kallat Partner Cloud! Vi kommer inte att visa samma sak som förra året, istället lägger mer fokus på att visa hur man automatiserar på ett ENKELT sätt å at man kan få mer tid över till sådant som faktiskt kräver det, samtidigt så får du lära dig hur man bygger detta så att det blir flexibelt, med lite tur kommer du knappt hitta till server hallen efter ett tag!

Då Microsoft står för hela kalaset så är priset för detta event extremt lågt, det är faktiskt helt gratis så jag tycker absolut att du ska komma!

Plats Datum Anmälan
Malmö 2013-05-06 https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032549479&Culture=sv-SE&community=0
Göteborg 2013-05-07 https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032549480&Culture=sv-SE&community=0
Stockholm 2013-05-13 https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032549476&Culture=sv-SE&community=0

/mike

Posted in Cloud, Hyper-V, SCVMM, System Center 2012, Virtual Machine Manager, Windows Server 2012 | 2 Comments »

Hydration Kit V3 is out

Posted by Mikael Nystrom on January 4, 2013

HYDV3This hydration kit is basically what we use internally to build labs, POC,s and demo environment. It does require Hyper-v on Windows 8 or Windows Server 2012. With this kit you can deploy ready made VMs in a very short time. The kit handles to deploy

Windows Server

Windows Server 2008 R2 and Windows Server 2012 in various readymade configurations like, Domain Controller, Fileservers, Print Server, Management Server, Remote Desktop Servers and some more

Windows Client

Windows 7 and Windows 8 with or without Office 2012 or Office 2013

System Center 2012 SP1

System Center 2012 SP1, Configuration Manager, Data Protection Manager, Virtual Machine Manager, Operations Manager, App Controller and Service Manager (In the SM case, you can chose between Windows Server 2012 or Windows Server 2008 R2, in the later it will also install SharePoint and the Self Service portal

SQL Server 2012

Windows Server 2012 with SQL Server 2012 installed

If you need support and help my best bet is the FB group we have http://www.facebook.com/groups/318384504933665/

the kit can be downloaded from http://sdrv.ms/YJNHJn

/mike

Posted in Deployment, Geek Week, Hyper-V, MDT, SCCM, SCM, SCVMM, System Center 2012, TechEd, Windows 7, Windows 8, Windows Server 2008 R2, Windows Server 2012 | Tagged: | 20 Comments »

Where to find all WinPE drivers for almost all HP Servers in one location?

Posted by Mikael Nystrom on October 24, 2012

As a part of my daily life I build deployment solutions for customers that supports both Server OS and for Client OS and one of the components need are drivers for WinPE. Normally not a problem on the client side, but for servers there are some things that could let you grow a bit more gray hair then needed.

32bit drivers for 64bit OS

Since I prefer to have only one single boot image I would like to have the 32 bit version since that handles both 32 and 64 bit OS images. There is no obvious way to find the 32 bit versions of the driver in the 64 bit edition of Windows Server webpage. When deploying using System Center 2012 Virtual Machine Manager you need the 64 bit drivers and you might want to use the HP Insight Control for System Center instead

Specialized WinPE drivers might be needed

Even if WinPE is a subset of Windows it should be able to use the normal drivers, but “should” is just a word. In many cases the dual bus architecture or other “inventions” might require monolithic drivers. Those drivers should not be used in the running OS, only in WinPE

The solution (if you have a HP Server)

HP have something called Scripting Toolkit and that just happens to contain all the drivers needed for storage and network for all ML/DL/BL HP ProLiant DL/ML/SL 300, 500, 700, 900 and HP ProLiant BL server series and HP ProLiant 100 G6 series and higher which basically covers “all” server from HP. The current version is 8.70 for x86 and can be downloaded and the x64bit version here

When you extract the archive into a folder it will look like this

image
Guess where the drivers are…

Getting the drivers in the correct location

For MDT 2012 Update 1

This is pretty straight forward. Open deployment workbench and add the drivers to the WinPEx86 folder (if you do not have one, you should create that)

image

Modify so that all drivers from that folder is imported into the boot image

image

For Windows Deployment Services for Windows Server 2012

Not that hard either, remember we only need these drivers for WinPE, not for the running OS so when we import them we need to flag them so that will never be installed, we just need to have them imported so that we can apply them to the WinPE image, it should look like this

image

For WinPE from ADK

The offline method:

Dism /Mount-WIM /WimFile:c:\winpe\winpe.wim /index:1 /MountDir:c:\winpe\mount\
Dism /image:c:\winpe\mount /Add-Driver /Driver:e:\drivers /Recurse
Dism /unmount-wim /Mountdir:c:\winpe\mount /commit

The online method:

drvload.exe <path>

For System Center 2012 Virtual Machine Manager:

Note: For System Center 2012 Virtual Machine Manager you can also download the HP Insight Control for System Center, that contains HP server drivers for network and storage, however, those are only 64 bit drivers. So for the SCVMM solution you can either download the scripting toolkit driver pack, but for SCVMM they need to be x64 bit drivers or you can download the HP Insight Control for System Center kit that is only x64 bit version. It will basically be the same driver, the HP Insight Control for System Center has one part that is rather nice, it has an installer that will install all the drivers and then tag them during the import so that you can use tags when injecting them into WinPE

If the drivers are imported into the SCVMM library and tagged method:

Use the following PowerShell command:

Import-Module "C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psModules\virtualmachinemanager\virtualmachinemanager.psd1"
Get-SCVMMServer localhost
$mountdir = "e:\mount"
$winpeimage = "e:\temp\boot.wim"
$winpeimagetemp = $winpeimage + ".tmp"
mkdir "e:\mount"
copy $winpeimage $winpeimagetemp
dism /mount-wim /wimfile:$winpeimagetemp /index:1 /mountdir:$mountdir
$drivers = get-scdriverpackage | where { $_.tags -match "WINPE" }
foreach ($driver in $drivers)
{
$path = $driver.sharepath
dism /image:$mountdir /add-driver /driver:$path
}
Dism /Unmount-Wim /MountDir:$mountdir /Commit
publish-scwindowspe -path $winpeimagetemp
del $winpeimagetemp

If the drivers are in folder and NOT imported into the SCVMM library:

Use the following PowerShell command:

Import-Module "C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psModules\virtualmachinemanager\virtualmachinemanager.psd1"
Get-SCVMMServer localhost
$mountdir = "e:\mount"
$winpeimage = "e:\temp\boot.wim"
$winpeimagetemp = $winpeimage + ".tmp"
mkdir "e:\mount"
copy $winpeimage $winpeimagetemp
dism /mount-wim /wimfile:$winpeimagetemp /index:1 /mountdir:$mountdir
$path = "e:\temp\drivers"
dism /image:$mountdir /add-driver /driver:$path /recourse
Dism /Unmount-Wim /MountDir:$mountdir /Commit
publish-scwindowspe -path $winpeimagetemp
del $winpeimagetemp

/mike

Posted in Deployment, MDT, SCVMM, System Center 2012, Virtual Machine Manager | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 2,339 other followers