So for the slightly OCD folks out there who have installed SCVMM, added the hosts to be managed and noticed that some names are in lower case and some are in uppercase. Functionally not a big deal but doesn't look consistent.
I came across this great little tid bit by Larry Rayl: http://blogs.catapultsystems.com/lrayl/archive/2013/05/14/tips-amp-tricks-for-sc-2012-sp1-vmm-fix-for-the-upper-and-lower-case-host-listings.aspx
Simply follow the below steps:
1. Backup the SCVMM Database (SCVMM console or in SQL Management Studio). I need to stress this is a must for any DB level changes required for SCVMM!
2. Log on to SQL Management Studio and apply the following script:
SELECT [ComputerName], UPPER(LEFT([ComputerName], CHARINDEX('.', [ComputerName], 1) -1)) +
RIGHT([ComputerName], LEN([ComputerName]) - CHARINDEX('.', [ComputerName], 1) + 1)
FROM [VirtualManagerDB].[dbo].[tbl_ADHC_Host]
UPDATE [VirtualManagerDB].[dbo].[tbl_ADHC_Host]
SET [ComputerName] = UPPER(LEFT([ComputerName], CHARINDEX('.', [ComputerName], 1) -1)) +
RIGHT([ComputerName], LEN([ComputerName]) - CHARINDEX('.', [ComputerName], 1) + 1)
3. After running the script, restart “System Center Virtual Machine Manager Agent Service” on the VMM Server.
4. After this all hosts will appear in uppercase.
So all those OCD folks out there...can rest at ease!
Thanks Larry!
All things System Center, Private Cloud & Hybrid Cloud etc.
Showing posts with label Virtual Machine Manager 2012. Show all posts
Showing posts with label Virtual Machine Manager 2012. Show all posts
Monday, October 7, 2013
Friday, May 17, 2013
V2V or P2V failed state and cannot remove VM
Recently I was working with a customer on a VMware to Hyper-V migration. We were leveraging the great inbuilt V2V tool that is part of Virtual Machine Manager 2012. At some point during the virtual-to-virtual conversion the process failed.
After the conversion failed the VM was listed in Virtual Machine as 'Virtual-to-virtual conversion failed'. I decided to clean up the vm and restart the process.
- I tried to delete the VM with no luck.
- I then tried to repair the VM and this also failed as well.
Repairing in the past generally resolves a "stuck" VM. As a result I had to follow the below procedure to clear the error message and allow the VM to be deleted.
Please note this procedure is not a Microsoft official supported procedure and should be carried out with caution (make sure you take a backup of the VMM Datbase):
Backup the VMM 2012 Database:
1. Launch the Virtual Machine Manager Console and go to the 'Settings' view. In the settings view click 'Backup'.
Edit the relevant table in the VMM Database:
1. Launch SQL Management Studio. Expand the 'VirtualManagerDB' database.
2. Expand 'Tables' and scroll down and find 'dbo.tbl_WLC_VObject'.
3. Edit the table and search for the "stuck" VM.
4. We then want to find the 'ObjectState' column for that VM and change the value to '1' and press Enter.
5. In Virtual Machine Manage refresh the Cluster.
6. After the Cluster refreshes the VM can now be deleted.
After the conversion failed the VM was listed in Virtual Machine as 'Virtual-to-virtual conversion failed'. I decided to clean up the vm and restart the process.
- I tried to delete the VM with no luck.
- I then tried to repair the VM and this also failed as well.
Repairing in the past generally resolves a "stuck" VM. As a result I had to follow the below procedure to clear the error message and allow the VM to be deleted.
Please note this procedure is not a Microsoft official supported procedure and should be carried out with caution (make sure you take a backup of the VMM Datbase):
Backup the VMM 2012 Database:
1. Launch the Virtual Machine Manager Console and go to the 'Settings' view. In the settings view click 'Backup'.
Edit the relevant table in the VMM Database:
1. Launch SQL Management Studio. Expand the 'VirtualManagerDB' database.
2. Expand 'Tables' and scroll down and find 'dbo.tbl_WLC_VObject'.
3. Edit the table and search for the "stuck" VM.
4. We then want to find the 'ObjectState' column for that VM and change the value to '1' and press Enter.
5. In Virtual Machine Manage refresh the Cluster.
6. After the Cluster refreshes the VM can now be deleted.
Wednesday, May 8, 2013
VMM 2012 SP1 VM Template - Region Settings revert back to en-US
I thought I would share a common problem that is experienced when configuring Regional Settings on a VM template.
Here is the scenario:
You build your VM with your required OS and make the required customisations for your environment. In most cases (unless you are in the US) this would require changing the Regional Settings. Once you are happy you run the sysprep oobe - generalize and shutdown the VM ready to be moved to the library.
You generate the VMM template from the VM in your library. You run your first test a realise that all the Regional setting have been changed back to English US.
During the above process the regional settings is reverted back to 'en-US'. This functionality is acknowledged in this MS KB article: http://support.microsoft.com/kb/2709539
To configure the proper regional settings for your template you can run a number of PowerShell cmdlets that will update the unattend settings (specifically oobeSystem/Microsoft-Windows-International-Core/UserLocale).
For Australia I generally need to configure the User Locale to 'en-AU' (English-Australia) and the keyboard to 'en-AU' also.
To do this I run the following PowerShell cmdlets (no need to change SystemLocale or UILanguage for Australia region settings):
$template = Get-SCVMtemplate | where {$_.Name -eq "Template - Windows Server 2008 R2 SP1 Enterprise"}
$settings = $template.UnattendSettings;
$settings.add("oobeSystem/Microsoft-Windows-International-Core/UserLocale","en-AU");
$settings.add("oobeSystem/Microsoft-Windows-International-Core/SystemLocale","en-US");
$settings.add("oobeSystem/Microsoft-Windows-International-Core/UILanguage","en-US");
$settings.add("oobeSystem/Microsoft-Windows-International-Core/InputLocale","0c09:00000409");
Set-SCVMTemplate -VMTemplate $template -UnattendSettings $settings
The above PowerShell commands can be modified for your region.
Here is the scenario:
You build your VM with your required OS and make the required customisations for your environment. In most cases (unless you are in the US) this would require changing the Regional Settings. Once you are happy you run the sysprep oobe - generalize and shutdown the VM ready to be moved to the library.
You generate the VMM template from the VM in your library. You run your first test a realise that all the Regional setting have been changed back to English US.
During the above process the regional settings is reverted back to 'en-US'. This functionality is acknowledged in this MS KB article: http://support.microsoft.com/kb/2709539
To configure the proper regional settings for your template you can run a number of PowerShell cmdlets that will update the unattend settings (specifically oobeSystem/Microsoft-Windows-International-Core/UserLocale).
For Australia I generally need to configure the User Locale to 'en-AU' (English-Australia) and the keyboard to 'en-AU' also.
To do this I run the following PowerShell cmdlets (no need to change SystemLocale or UILanguage for Australia region settings):
$template = Get-SCVMtemplate | where {$_.Name -eq "Template - Windows Server 2008 R2 SP1 Enterprise"}
$settings = $template.UnattendSettings;
$settings.add("oobeSystem/Microsoft-Windows-International-Core/UserLocale","en-AU");
$settings.add("oobeSystem/Microsoft-Windows-International-Core/SystemLocale","en-US");
$settings.add("oobeSystem/Microsoft-Windows-International-Core/UILanguage","en-US");
$settings.add("oobeSystem/Microsoft-Windows-International-Core/InputLocale","0c09:00000409");
Set-SCVMTemplate -VMTemplate $template -UnattendSettings $settings
The above PowerShell commands can be modified for your region.
VMM VM Template - AutoLogonCount and AutoLogonCredential for RunOnce
Recently I created a VM template in VMM 2012 SP1 for a customer. A number customization scripts were created and added to RunOnce. The customer wanted the VM template to automatically logon with the local Admin account so all the RunOnce scripts would run automatically.
This is a pretty standard request and when configuring any unattend Windows install this is generally achieved by modifying the unnattend.xml file. However in VMM the Set-SCVMTemplate PowerShell cmdlet can be leveraged to configure this setting.
The 'Get-SCVMTemplate' cmdlet will show the current AutoLogon configuration. The AutoLogonCount and AutoLogonCredentialproperties must both be configured to achieve the Auto Logon functionality:
Get-SCVMTemplate -Name "VM Template Name"
When using AutoLogon in your VM Template it is also important to have a VMM 'Run As' account configured that has the local Admin credentials stored. Once the local Admin 'Run As' account is created, add it to the VM Template OS Properties for the local admin account.
The following PowerShell cmdlets can be used to configure AutoLogonCount and AutoLogonCredential properties:
#Get Template by name
($template = Get-SCVMtemplate | where {$_.Name -eq "VM Template Name"}) | fl Name, OperatingSystem, VirtualizationPlatform
#Get local admin account
($raa = Get-SCRunAsAccount -Name "VM Local Admin Run As") | fl Name, Username, Domain
#Set auto logon
(Set-SCVMTemplate -VMTemplate $template -AutoLogonCredential $raa -AutoLogonCount 1) | fl Name, AutoLogonCredential, AutoLogonCount
By using Run As account for the local admin account for the OS Properties and the AutoLogonCredential this allows the local admin account to be changed without needing to rerun the above PowerShell scripts.
Happy Templating!
This is a pretty standard request and when configuring any unattend Windows install this is generally achieved by modifying the unnattend.xml file. However in VMM the Set-SCVMTemplate PowerShell cmdlet can be leveraged to configure this setting.
The 'Get-SCVMTemplate' cmdlet will show the current AutoLogon configuration. The AutoLogonCount and AutoLogonCredentialproperties must both be configured to achieve the Auto Logon functionality:
Get-SCVMTemplate -Name "VM Template Name"
When using AutoLogon in your VM Template it is also important to have a VMM 'Run As' account configured that has the local Admin credentials stored. Once the local Admin 'Run As' account is created, add it to the VM Template OS Properties for the local admin account.
The following PowerShell cmdlets can be used to configure AutoLogonCount and AutoLogonCredential properties:
#Get Template by name
($template = Get-SCVMtemplate | where {$_.Name -eq "VM Template Name"}) | fl Name, OperatingSystem, VirtualizationPlatform
#Get local admin account
($raa = Get-SCRunAsAccount -Name "VM Local Admin Run As") | fl Name, Username, Domain
#Set auto logon
(Set-SCVMTemplate -VMTemplate $template -AutoLogonCredential $raa -AutoLogonCount 1) | fl Name, AutoLogonCredential, AutoLogonCount
By using Run As account for the local admin account for the OS Properties and the AutoLogonCredential this allows the local admin account to be changed without needing to rerun the above PowerShell scripts.
Happy Templating!
Subscribe to:
Posts (Atom)



