The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • about.me

    Mikael Nystrom

    Mikael Nystrom

    OS Deployment Geek, Virtualization and System Center

    Mikael Nystrom is a Microsoft MVP and Principal Architect at TrueSec

  • Archives

  • Meta

Archive for the ‘SCVMM’ Category

Nice to Know – HP FlexFabric 10GB 2-port 534FLB Adapter can cause network issues using NVGRE

Posted by Mikael Nystrom on February 5, 2015

Today I was working at a customer site, setting up a NVGRE Gateway in a Fabric domain. Install, configuration, all went nice and smooth until we should test and verify that the VM’s could access the network, found a miss configuration and then, hey it was working, well TCP was working but NOT UDP, wtf??? Some troubleshooting (Google and Bing and some cursing) and it seems to be some various obscure things, some hotfixes but then we found something that actually worked…

The issue: Encapsulated Task Offloading

I’m pretty sure that the idea behind it is all good, but of course as all “great” things, it does not work in this combination.

imageimage
Here you can se the setting that needs to be disabled and you can also see the driver version and date that was in place.

The Solution: Disable it!

But, if you disable it on every hyper-v host (not only the hosts running the NVGRE gateway), it starts working. At the time we could not find any other solution then to disable it.

In this case the customer (and you know how you are) was kind enough to let me post the script that was used to disable this “amazing” technology.

image

or here in plain text form


$Nics = Get-NetAdapterAdvancedProperty -DisplayName “Encapsulated Task Offload”

foreach($Nic in $Nics)
{
Set-NetAdapterEncapsulatedPacketTaskOffload -Name $Nics.Name -EncapsulatedPacketTaskOffloadEnabled:$false
}


/Mike

Posted in Fabric, Hyper-V, SCVMM, System Center Configuration Manager 2012 R2 | Tagged: , , | Leave a Comment »

Nice to Know – Clean up the ISO name mess I SCVMM so that Windows Azure Pack looks nice

Posted by Mikael Nystrom on February 5, 2015

In System Center Virtual Machine Manager there is a library. The library stores resources used in the environment and one kind of resources is ISO images. The problem is that names on those ISO images is slightly “technical” and not so user-friendly. So who cares?

The Issue:

When you start using Windows Azure Pack to provide self-service, that is a very good reason to have nice names here is two samples

imageimage
In the first picture, all the names looks ok, in the second picture, it looks different…

The names of the these files comes from System Center Virtual Machine Manager and they are easy to change, just go in to the library, open each and everyone and change the name…

image
How to modify the name of the ISO resource in the SCVMMLibrary using the UI.

However, doing that for one or two files are ok, more then that, it kind of gets boring after a while.

The Solution:

So, you can export all the information in to a CSV file, modify the CSV file to suit your organization and then import it again.

Export CD/DVD meta data from SCVMM using PowerShell

Get-SCISO -All -VMMServer “clscvm01.cloud.truesec.com” | where HostType -EQ LibraryServer | Select LibraryServer,SharePath,Name,Description | ConvertTo-Csv -NoTypeInformation > “$env:TEMPISOInSCVMMLib.csv”

and that will give something like this:

image
A few of the ISO’s in the SCVMMLibrary.

So, open the file, modify name and description and run this


function Update-ISOForSCVMLib
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
$LibraryServer,

[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=1)]
$SharePath,

[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=2)]
$Name,

[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=3)]
$Description
)
$ISOToUpdate =  Get-SCISO -All | Where LibraryServer -EQ $LibraryServer | Where SharePath -EQ $SharePath
$ISOToUpdate | Set-SCISO -Description $Description -Name $Name
}


This will give you a new function and that new function can be used in the following way.

Import-Csv .\ISOInSCVMMLib.csv | foreach {Update-ISOForSCVMLib $_.LibraryServer -SharePath $_.SharePath -Name $_.Name -Description $_.Description}

The function is going trough the CSV file and search for the file, find the object and finally change the display name of the object.

/mike

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

Nice To Know – Generate the -JobGroup ID in SCVMM Scripts

Posted by Mikael Nystrom on January 28, 2015

When working with SCVMM it is common to perform administrative tasks using PowerShell. One very nice thing in SCVMM is that when using the UI it will create a script in the end and the idea is that you should be able to use that script and you can, one time…why?

…because you need to generate a new ID every time you run the script, so how do you do that?

Generate a GUID using PowerShell:

$JobGroupID1 = [Guid]::NewGuid().ToString()

image
The result when generating a GUID.

Using the generated GUID in a SCVMM PowerShell script

Here is a list of CMDlets that uses _JobGroup

https://social.technet.microsoft.com/Forums/systemcenter/en-US/ab1e7054-69c7-44ee-a475-229f9557b653/jobgroup-what-cmdlets?forum=virtualmachinemanager

/mike

Posted in PowerShell, SCVMM, System Center 2012 R2 | Tagged: , , | Leave a Comment »

Nice to Know – Azure Operational Insights -Data aggregation in progress”

Posted by Mikael Nystrom on January 27, 2015

I was troubleshooting Capacity planning Intelligence Pack stuck in “Data aggregation in progress” and found a blog post from the team, one of the best step-by-step’s for troubleshooting this problem I have seen. If you do have issues with this, just follow the guide

If this is your issue:

image

Follow this guide:

image

In this guide check out these procedures:

  • Validate if the right Management Packs get downloaded to your OpsMgr Environment
  • Validate if the right Intelligence Packs get downloaded to your Direct Agent
  • Validate if data is being sent up to the Advisor service (or at last attempted)
  • Check for Errors on the Management Server or Direct Agent Event Logs
  • Look for your agents to send their data and have it indexed in the Portal

Posted in OpsMgr, SCVMM, System Center 2012 R2 | Tagged: | Leave a Comment »

Nice to Know – Improve Bare Metal Deployment success rate in System Center Virtual Machine Manager

Posted by Mikael Nystrom on November 5, 2014

Bare Metal Deployment in SCVMM is a bit different compared to everything else, since it is using a push method. So instead of having some kind of client application controlling the deployment, the SCVMM server is controlling the OS Deployment. There could be issues, since SCVMM is building team and switches and there is a chance that SCVMM will loose connectivity to the host and the Bare Metal Deployment stops. In many case that is related to DNS and DNS cache, since that is the method used to be able to connect to the host during deployment. By decreasing the DNS cache timeout on the SCVMM server the success rate will improve very, very much.

How to fix it?

Logon to your SCVMM server and execute the following PowerShell commands to set the DNS Cache to a minimum and restart the DNS Cache services

New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name "MaxCacheTtl" -Value 5 -PropertyType "DWORD" -Force
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name "MaxNegativeCacheTtl" -Value 5 -PropertyType "DWORD" -Force
Restart-Service -Name Dnscache -Force -Verbose

/mike

Posted in Hyper-V, OS Deployment, SCVMM | Tagged: , , , | Leave a Comment »

Nice to Know–Microsoft Virtual Machine Converter 3.0 released to web

Posted by Mikael Nystrom on October 13, 2014

image

Now with P2V, yes!

New Features in MVMC 3.0
The 3.0 release of MVMC adds the ability to convert a physical computer running Windows Server 2008 or above server operating systems or Windows Vista or above client operating systems to a virtual machine running on Hyper-V host.

Standard stuff is:

  • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Microsoft Azure.
  • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
    Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
  • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
  • Supports conversion of offline virtual machines.
  • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
  • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion.
  • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts on any of the following operating systems:
  • Windows Server® 2012 R2
  • Windows Server® 2012
  • Windows Server 2008 R2 SP1
  • Converts VMware virtual machines, virtual disks, and configurations for memory, virtual processor, and other virtual computing resources from the source to Hyper-V.
  • Adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.0, and VMware vSphere 4.1 hosts to Hyper-V.
  • Has a wizard-driven GUI, which simplifies performing virtual machine conversions.
  • Uninstalls VMware Tools before online conversion (online only) to provide a clean way to migrate VMware-based virtual machines to Hyper-V.
    Important MVMC takes a snapshot of the virtual machine that you are converting before you uninstall VMware Tools, and then shuts down the source machine to preserve state during conversion. The virtual machine is restored to its previous state after the source disks that are attached to the virtual machine are successfully copied to the machine where the conversion process is run. At that point, the source machine in VMware can be turned on, if required.
    Important MVMC does not uninstall VMware Tools in an offline conversion. Instead, it disables VMware services, drivers, and programs only for Windows Server guest operating systems. For file conversions with Linux guest operating systems, VMware Tools are not disabled or uninstalled. We highly recommend that you manually uninstall VMware Tools when you convert an offline virtual machine.
  • Supports Windows Server and Linux guest operating system conversion. For more details, see the section “Supported Configurations for Virtual Machine Conversion” in this guide.
  • Includes Windows PowerShell capability for offline conversions of VMware-based virtual hard disks (VMDK) to a Hyper-V–based virtual hard disk file format (.vhd file).
    Note The offline disk conversion does not include driver fixes.

Posted in Hyper-V, SCVMM | Tagged: , | 1 Comment »

Issue (Hyper-V/SCVMM) – VMM cannot complete the host operation on the HOST server because of error:Storage for virtual machine ‘HOSTNAME’ failed with error ‘The device is not ready.’ (0x80070015)

Posted by Mikael Nystrom on August 28, 2014

Issue:

When trying to migrate a VM’s storage to a local device using SCVMM you could see this:

Error (12700)
VMM cannot complete the host operation on the HOST server because of the error: Storage migration for virtual machine ‘VM’ (GUID) failed with error ‘The device is not ready.’ (0x80070015).

Operation not allowed for virtual machine ‘VM’ because Hyper-V state is yet to be initialized from the virtual machine configuration. Try again in a few minutes.(Virtual machine ID )
Unknown error (0x800c)

When trying to migrate a VM’s storage to a local device using Hyper-V manager you could see this:

"Storage migration for virtual machine"HOST’ failed.
Operation not allowed because the replication state is not initialized.
Storage migration for virtual machine "HOST’ failed with error ‘The device is not ready’ (0x80070015)."

Solution:

So far the only solution I have found, tried (and it did work) is to restart the Hyper-V management service.

http://social.technet.microsoft.com/Forums/systemcenter/en-US/eb4511c5-23f9-4c1e-af32-88de0eeaaef1/vhdx-failed-to-migrate-to-local-storage?forum=virtualmachingmgrhyperv

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

TechEd NA 2014 – The Scripts from my session – DCIM-B309 – Bare Metal OS Deployment in Microsoft System Center 2012 R2 Virtual Machine Manager

Posted by Mikael Nystrom on May 15, 2014

Here is the sample scripts from my session at TechEd NA 2014 (DCIM-B309 – Bare Metal OS Deployment in Microsoft System Center 2012 R2 Virtual Machine Manager: This Is How It Is Done!)

SkyDrive: http://1drv.ms/1n0vTm2

Channel 9: http://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/DCIM-B309

/mike

Posted in Deployment, Hyper-V, SCVMM, System Center Virtual Machine Manager 2012, TechEd | Tagged: | Leave a Comment »

Nice to Know–Bare metal deployment in SCVMM using Custom script and Custom resources could fail

Posted by Mikael Nystrom on May 4, 2014

The bare metal OS deployment function in SCVMM has the ability to be customized by adding custom scripts (also know as GCE). Basically there is two ways to do this, you either make sure the  script is in the WinPE image or you add it using recourses in the SCVMM Library. There are two locations for those scripts, Pre and Post and the problem seems to be true when we are doing Pre OSD GCE’s. So how do I know it fails then?, well that is not that hard. It will give you a very informative message in the job log like this:

Error (2941)
VMM is unable to complete the request. The connection to the agent on machine SCVMM01.network.local has been lost.
Unknown error (0x80072efe)

Recommended Action
Ensure that the WS-Management service and the agent are installed and running and that a firewall is not blocking HTTPS traffic.

image

And if you open the vmmAgentPE.exe.log file on the host you are deploying you will se this:

058C.05C4::05/04-12:23:13.425#00:OSDDownloadFileFromUrl.cpp(88)[000000000306EB: ThrowOnWin32Failure : 80072efe. Operation attempted WinHttpReceiveResponse(m_hRequest, NULL)
058C.05C4::05/04-12:23:13.425#00:exceptions.cpp(97)[000000000306EB: CarmineException::CarmineException: CarmineError: 1051488,  hr: 0x80072efe

If you look at the last file it tries to download you will see that it is trying to download the SCVMMCRTag.cr file and if you check the size of the file you will se that the size is 0 bytes and “carmine” does not like to transfer 0 size files in WinPE.

Solution:

Modify the SCVMMCRTag.cr in notepad.exe and type whatever you like, close it, done. If you try once more it should work.

/mike

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

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 »

 
Follow

Get every new post delivered to your Inbox.

Join 5,292 other followers