Our first guest post (http://blogs.technet.com/tonyso/archive/2008/10/07/your-hyper-v-blog-post-here.aspx) comes from Jeremy Hagan. Thanks Jeremy!
Background:
One problem I have had when trying to do my first round of P2Vs for my Hyper-V implementation that I didn’t notice in testing is that you can’t size the VHD of the VM smaller than the corresponding physical disk of the original machine. Since it is best practice to have one LUN per VM and it is also best practice to have fixed VHDs, this can cause a lot of wasted SAN space. In my planning for the P2V process I monitored the target servers for 1 month so that I could get an idea of the CPU and memory use, but also the data growth. I decided to plot the percentage of data growth, extrapolate this for 3 years and then add a 15% premium on top of this then rounded up to the nearest 5 GB. This ended up being the SAN LUN size for each VM. The problem I then had was that I didn’t have enough SAN space available to P2V my machines.
What I decided I needed to do was to P2V each machine to a sufficiently large scratch LUN, then shrink down the VHDs to be the size I wanted then migrate the VM off the scratch LUN to the desired LUN. Easy right? Well maybe not. After much searching I have managed to come up with a recipe for doing this. See the example below. In this case it was a Windows XP machine with a 40 GB hard disk, but only 9.5 GB of data. If you want to play with this I recommend making a copy of the VHD file as a backup rather than taking a snapshot. Snapshots will interfere with final step using VHDResizer to create the final fixed VHD file.
Steps (assumes a single disk with a single partition):
Now if you think that is laborious and annoying, you’d be right. Hopefully Microsoft will come up with a better way to do this in the future. Now before I get a million comments about this, I did try to just use WinPE and DISKPART SHRINK, but no matter how many times I defragmented, precompacted and compacted I couldn’t get the partition to shrink down to less than about 24 GB.
If you need to produce diagrams as part of your Hyper-V deployment planning, you can download Hyper-V stencils for Visio and simultaneously using the free Microsoft Office Visio 2007 Professional Add-In for Rack Server Virtualization (Virtual Rack). Installing this add-In adds a new template called “Rack Server Virtualization“ under the “Connectors” Templates category. You can use this template without running the tool.
NOTE: this tool requires local admin privileges on every server you run it on, as well as:
1. .NET Framework 2.0
2. Microsoft Office Visio 2007
3. Microsoft VSTO 2005 SE Runtime
Running the inventory and analysis tool (if your datacenter allows it) gives you a visual picture of Power Drop and Rack space saved according the target virtualization consolication factor you entered (by default 3:1):
You can set the consolidation criteria based on several factors:
1. Power Rating: The server with higher Power Rating is considered to be a better candidate than server with lower Power Rating.
2. Rack Space Used: A Server that occupies more space is merged into the Server that occupies less space to minimize the space occupied by the Servers within a Rack.
3. CPU Utilization: A Server with lower CPU Utilization is merged into the Server with higher CPU Utilization.
4. Physical Memory: Server with lower Physical Memory will be merged into the Server with higher Physical Memory.
Symptoms and error messages for corrupted Hyper-V VHD files are numerous, from the VM refusing to start, to failures to attach the VHD with messages like
"Failed to open attachment 'C:\ directory \MyVHD.vhd'. Error: 'The file or directory is corrupted and unreadable.'”
There are many possible causes why your VHD may become corrupted. It is not necessary to figure out the exact cause if you need it back fast: just restore the VHD from your latest backup, or as Ben Armstrong puts it in his blogpost“Run data recovery tools inside the virtual machine."” As with all things in IT “fast” is a relative term – restoring a 500 GB disk from backup can take hours. Plan accordingly.
If you are going to take the time to investigate the cause, or do not have a backup, then you must “go all forensic”.
No mater what the VHD type, most common causes of data corruption in the VHD (whether fixed or dynamic) are from:
If you can trace back the chain of events leading to the corruption, you will usually find a failure either by disconnecting storage while the virtual drive was being created or moved over the network Note that switching the disk-type from one to the other or expanding the disk may cause the problem, and, for some people, it has solved the problem. Sometimes this failure is not hardware, but caused by 3rd party encryption and anti-virus programs that have been installed on the host.
This Core Team blog post shows one way to begin your analysis.
Fixes to try:
A reader sent me an e-mail asking how to copy/paste between VMs. It depends on how much material you are trying to copy/paste. Seems like most people connect the VM to a virtual network that has external access and establish a network mapping. Then copy the file to the shared network folder, and access it from the other VM. You can also install a MS Loopback adapter in the host, create a new virtual network, assign static addresses on both sides, then establish a network mapping that way. If it is a large number of files, or a small number of large files, you may want to create an ISO image from the files you want to copy and mount the ISO in the new VM (only works from host to guest.) Of course, if you are using VMM, you can save the ISO to the library, and then use it on as many VMs and templates for creating VMs as you like :-)
The Hyper-V Health Model is live on TechNet. The Health Model contains troubleshooting content to help you manage Hyper-V, and covers:
For example, some of you have been searching for error ID 14050 with the string ‘Failed to register service principal name" in your error log.
The Virtual Machine Management Service (Vmms.exe) is the service that uses WMI to perform Virtual System Management related operations in Hyper-V and the Hyper-V Manager.
Event ID: 14050
Source: Microsoft-Windows-Hyper-V-VMMS
Symbolic Name: MSVM_VMMS_REGISTER_SPN_ERROR
Message: Failed to register service principal name.
Vmms.exe (by default in the %windows%\system32 directory) is the service that uses the Msvm_VirtualSystemManagementService WMI object to perform Virtual System Management related operations in Hyper-V and the Hyper-V Manager. A number of different settings and actions on virtual machines may cause the VMMS to timeout or shutdown.
Ensure a connection to a Domain Controler, and then restart the Virtual Machine Management Service (VMMS).
To restart VMMS using the Service Manager:
1. In the Hyper-V Manager click the server on which you want to stop the service, then click Action, then click Stop Service.
2. Click Action, and then click Start Service.
To restart the VMMS service using the command prompt:
1. On the computer that has the stopped service, open a command prompt as local administrator and type the following:
net stop nvpswmi
If the service is not running, you will see the error "The Hyper-V Networking Management service is not started."
3. On the command prompt type the following command to start the nvpswmi service
net start nvspwmi
If the service start starts you will see the message "The Hyper-V Networking Management service was start successfully."
To restart VMMS using PowerShell:
C:\PS>restart-service vmms
If this error occurs only with Windows Server 2008 x86 virtual machines that were created in Virtual Server or Virtual PC, then the HAL may not be set as ACPI.
To check this:
1. On the virtual machine, open an elevated Command Prompt window.
2. Type devmgmt.msc to open the Device Manager
3. Click the computer node. If you see “Advanced Configuration and Power Interface (ACPI) PC” you must change the HAL.
To change the HAL on the virtual machine:
2. Type msconfig. exe
3. Click the Boot tab
4. Click the Detect HAL checkbox
5. Click OK twice to close and restart the virtual machine.
6. After the virtual machine is restarted, open device manager and the computer node listing should be "“ACPI x86-based PC.”
Note: If you see performance issues when starting this virtual machine in the future, you should turn off the "Detect HAL" setting, since it is not longer required.
Check that the VMMS service is in the running state in the Service Control Manager and that the failed operation now succeeds.
We’d like to hear from you how we can improve this content, leave comments, and thanks in advance.
My team has access to a Windows Server 2003 server in the test organization that is built daily/weekly by script with the new product bits. In order to meet our content deadlines, we need to run the GUI as it changes during product development and try to stay current. Well, as deadlines get closer, more writers try to remote into the server to do stuff. Often they are getting the error: "The terminal server has exceeded the maximum number of allowed connections". Typing this phrase into live search gives you this. Too-typical technical content- accurate, yet at the same time not remotely useful.
When you get this message while logging on remotely to a Windows Server 2003 server, it means that two RDP sessions are running on the server. This means that either two people are logged in and doing work, or one or more are not doing work, but still logged in. By default, you can have only two remote sessions and one console session. To solve this:Preventive: Get everyone in the habit of "log off" (not just close the remote window) when done working on the server. Play nice.Reactive: If you need to get on right now you can force a logoff of the current user using the following command:
mstsc /v: yourservername /console
using credentials for a member of the local Administrators group or the Domain Admins Group To delete existing connections:Start > Administrative Tools > Terminal Services Manager. Expand the This Computer node. Click on your server name. Click on the Users tab and you should see all existing connections. Right- Click on any session with a greyed-out icon (indicates that the session has expired) and select "Log Off" to kill that user/session and free up the connection. To change the default behavior (limit of 2 sessions, no time out):Start > Administrative Tools > Terminal Services ConfigurationSelect the Connections folder. Right-Click RDP-Tcp (Microsoft RDP 5.2) and select Properties. Select the Sessions tab and check the ‘Override user settings‘ option and set ‘End a disconnected session’ and ‘Idle session limit’ to 15 minutes. Set the ‘Active session limit’ to Never.
To avoid this problem in the first place and limit to one user at a time connecting to a Microsoft Windows Server 2003 terminal server in Remote Administration Mode remotely or at the console:-)
In the Permissions for Everyone area, click to select the Deny check box to deny permission for Guest Access, and then click OK.
Note This setting permits only one remote connection and only through the console, also known as session 0. To make a Remote Desktop connection to the server, use the mstsc.exe /console command to connect to the console session of a terminal server on a Windows XP-based computer or on a Windows Server 2003-based computer.
In the 12 minute video “Getting to Know Hyper-V” Windows Server UA Technical Writer Felipe Ayora shares his experiences getting to know Hyper-V while setting up HPC clusters for his technical writing assignments.
I install and uninstall a lot of software on my laptop in the course of my work. Sometimes, stuff happens, and I can't be sure what the problem might be. Standard advice from support in these case is "pave it" meaning uninstall and reinstall the app to see if that fixes the problem.
Recently, IE7 has been throwning the same Onfolio error message at me every 15 mins or so.
In case you need it, here are the instructions for uninstalling IE7 from Windows XP SP2 from kb 917964:
If Windows XP SP2 is installed on the computer, uninstall Internet Explorer 7. To do this, follow these steps:
Microsoft IT recently published a paper detailing their early-adopter experience with TS in Windows Server 2008. They share some server sizing best practice recommendations, viz:
By deploying Terminal Services 2008 in both small and large environments worldwide, the deployment team developed the following best practices that it considers important to the successful deployment of a Terminal Services environment:
Installing Hyper-V on a Server Core installation of Windows Server 2008 makes sense from a supportability and improving security perspective. It can be a challenge, here are some procedures, tips and resources to help you.
You can use unattended setup to configure a server running a Server Core installation and Hyper-V. For more information about unattended setup settings, see the Windows Automated Installation Kit (AIK). You can find more information and a sample unattend.xml file in the Server Core Installation Option of Windows Server 2008 Step-By-Step Guide.
NOTE: There is no way to upgrade from a full installation of Windows Server 2008 or a previous version of Windows Server to a Server Core installation. Only a clean installation is supported. There is no way to upgrade from a Server Core installation to a full installation of Windows Server 2008. If you need the Windows user interface or a server role that is not supported in a Server Core installation, you should install a full installation of Windows Server 2008.
If you close all local command prompts while installing the Hyper-V role, you will have no way to manage the Server Core installation. If this happens, press CTRL+ALT+DELETE, click Start Task Manager, click File, click Run, and type cmd.exe. Alternatively, you can log off and log on again.
You must perform a Server Core installation before you install the Hyper-V role. For instructions, see the Server Core Installation Option of Windows Server 2008 Step-By-Step Guide, and complete the following tasks:
You cannot activate a Server Core installation through a firewall that requires users to log on because there is no Web browser on a Server Core installation. Instead, you can activate by phone, using a Key Management Service (KMS) server, or remotely by typing the following command at a command prompt of a computer that is running Windows Vista or Windows Server 2008:
cscript windows\system32\slmgr.vbs <ServerName> <UserName> <password>:-ato
If you are going to join a server running a Server Core installation to an existing Windows domain, you need a user name and password for an account that has the administrative credentials to join a computer to the domain.
After you have installed Windows Server 2008, you must apply the Hyper-V update packages for Windows Server 2008 (KB950050). NOTE: Once you install these server updates, you will not be able to remove them. You should also apply any other require updates before you install the Hyper-V role.
To view the list of software updates and see if any are missing, at the command prompt, type:
wmic qfe list
If you do not see “kbid=950050”, download the Hyper-V updates and then type the following command at a command prompt:
wusa.exe Windows6.0-KB950050-x64.msu /quiet
There are three update packages. The Update for Windows Server 2008 x64 editions (KB 950050), and Language pack for Hyper-V (KB951636) must be installed on the parent partition of the Server Core installation. After you install the server update you must restart the server.
The Update for Windows Server 2008 (KB952627) is for remote management of the Server Core installation if you are managing the server from a computer running Windows Vista Service Pack 1 (SP1), and must be installed on the computer running Windows Vista SP1.
Before you enable the Hyper-V role, ensure that you have enabled the required hardware-assisted virtualization and data execution prevention BIOS settings. Checks for these settings are performed before you enable the Hyper-V role on a full installation, but not on a Server Core installation.
After you make the BIOS configuration changes to enable the required hardware features, you must complete a full power-cycle before proceeding. If you enable the Hyper-V role without modifying the BIOS settings, the Windows hypervisor may not work as expected. If this happens, check the event log for details, modify the BIOS settings according to the server hardware manufacturer instructions, complete a full power-cycle to restart the Server Core installation, and then install Hyper-V again.
To check if your server hardware is compatible, see http://windowsservercatalog.com/. Click on the list of Certified Servers, and then click By additional qualifications – Hyper-V. For instructions about how to enable the BIOS settings, check with your hardware manufacturer.
The syntax for Ocsetup.exe is case sensitive. To install the Hyper-V role, at a command prompt, type:
start /w ocsetup Microsoft-Hyper-V
Rename the server, if required. If your computer is joined to a domain, at a command prompt, type:
netdom renamecomputer %computername% /NewName:<newname> /UserD:<domainusername> /PasswordD
If your computer is not joined to a domain, at a command prompt, type:
netdom renamecomputer %computername% /NewName:<newname>
You must supply a value for placeholder text in angle brackets (<>)—do not type the brackets.
Enable Remote Desktop for Administration if you want to manage the server running a Server Core installation remotely. At a command prompt, type:
cscript c:\windows\system32\scregedit.wsf /ar 0.
If you are running the Terminal Services client on a previous version of Windows, you must turn off the higher security level that is set by default in Windows Server 2008. To do this, at a command prompt, type:
cscript C:\Windows\System32\Scregedit.wsf /cs.
Add a user or group to the local Administrators group so that they can manage the Server Core installation remotely. To add a user to the local Administrators group, you must first add the user. At a command prompt type:
net user <username> * /add
To add a user to the local Administrators group, at a command prompt, type:
net localgroup administrators /add <user>
You cannot perform all management and configuration tasks at a command prompt or remotely through an MMC snap-in. A server that is running a Server Core installation does not generate any notifications for activation, new updates, or password expiration because these notifications require the Windows Explorer shell, which is not part of the Server Core installation. You can use the Scregedit.wsf script included with the Server Core installation to configure the following settings:
The script is located in the \Windows\System32 folder of a server running a Server Core installation. At a command prompt, open the folder, and then use the following command to display the usage instructions for these options:
cscript scregedit.wsf /?
You can use this command with the /cli option to display a list of common command-line tools and their usage. To view your current Remote Desktop for Administration Settings, use the /v option. A "1" in the script output (without the quotes) means that remote connections are denied. A "0" means that remote connections are allowed.
If you wish to improve security by using BitLocker Drive Encryption to protext the server and VMs running on it, you should install the BitLocker feature before running any VMs. To install the BitLocker feature, at a command prompt type:
start /w ocsetup BitLocker
The BitLocker Drive Encryption feature requires additional hardware and BIOS configuration. For more information about using BitLocker with Hyper-V see Windows Server 2008 Hyper-V and BitLocker Drive Encryption.
Reboot the server by to make the changes take effect. At a command prompt type:
shutdown /r /t 0
The remote management tools are designed to manage one server running the Hyper-V role and the virtual machines on that server. To manage multiple servers running Hyper-V you can use System Center Virtual Machine Manager (SCVMM).
You can use the Manage-bde.wsf script to encrypt data volumes. To view more detailed Help for this script, type the following command:
cscript.exe %windir%\system32\manage-bde.wsf -h
If your server is domain-joined implement the guidelines in Configuring Active Directory to Back up Windows BitLocker Drive Encryption and Trusted Platform Module Recovery Information, so that BitLocker recovery information (such as recovery passwords) will be automatically backed up to Active Directory whenever this information is created and changed.
The following is an excerpt from the cmdlet reference for VMM Beta 2 (requires registration and Windows Live ID log on):
SYNOPSIS
Converts a virtual machine created in VMware(R) to a Virtual Server-based v
irtual machine managed by Virtual Machine Manager.
SYNTAX
New-V2V -Path <String> -SourceComputerName -VMHost -VMXPath [-DelayStart] [
-Description <String>] [-JobVariable <String>] [-MemoryMB <Int32>] [-Name <
String>] [-Owner <String>] [-ProcessorCount] [-ProcessorSpeed] [-ProcessorT
ype] [-RunAsSystem] [-RunAsUserCredential] [-RunAsynchronously <Boolean>] [
-StartAction] [-StopAction] [-UseHardwareAssistedVirtualization] [-VMMServe
r] [<CommonParameters>]
New-V2V -MachineConfig <MachineConfiguration> -Path <String> -VMHost -VMXPa
th [-DelayStart] [-Description <String>] [-JobVariable <String>] [-MemoryMB
<Int32>] [-Name <String>] [-Owner <String>] [-ProcessorCount] [-ProcessorS
peed] [-ProcessorType] [-RunAsSystem] [-RunAsUserCredential] [-RunAsynchron
ously <Boolean>] [-StartAction] [-StopAction] [-UseHardwareAssistedVirtuali
zation] [-VMMServer] [<CommonParameters>]
DETAILED DESCRIPTION
Converts a VMware Server-based virtual machine to a Virtual Server-based virtual machine managed by Virtual Machine Manager. The source for a V2V conversion of a VMware virtual machine is a set of files that are stored in the Virtual Machine Manager library:
* A .vmx file, which is a VMware virtual machine configuration file.
* Several .vmdk files, which are VMware virtual hard disks that contain
the virtual machine's guest operating system.
During the conversion process, the New-V2V cmdlet converts the .vmdk files
to .vhd files and modifies the guest operating system.
New-V2V supports the conversion of VMware virtual machines with any of the
following guest operating systems: Microsoft Windows 2000 Server with Servi
ce Pack 4 (SP4) or later, Windows Server 2003 SP1 or later, or Windows Serv
er 2003 R2. A V2V conversion requires that the host on which the new virtua
l machine will be deployed is a computer running Virtual Server R2 SP1 or l
ater.
Some conversions might require that additional files be added to the intern
al cache. You can use the Add-Patch cmdlet to add the required files to the
cache.
PARAMETERS
-Path <String>
Specifies the destination path for the operation. Examples formats incl
ude:
- Path "<DriveLetter>:\"
- Path "<DriveLetter>:\<FolderName>
- Path "\\Library\Templates
- Path "\\MyLibrary1\MyVMs" | where {$_.Path -eq "Managed Computers\MyG
roup\"}
-VMHost
Specifies a virtual machine host object or an array of host objects. A
host is a computer managed by Virtual Machine Manager on which you can
deploy one or more virtual machines.
-VMXPath
Specifies the full path to the .vmx file of the VMware virtual machine.
-DelayStart
Specifies the number of seconds to wait after the Virtual Server servic
e is started before automatically starting a virtual machine. This sett
ing is useful when multiple virtual machines are configured to start au
tomatically because you can stagger the startup to help reduce the dema
nd on the physical computer’s resources when multiple virtual machines
start simultaneously. The amount of time that you should specify depend
s on your hardware; however, a typical setting would be in the range of
30 to 60 seconds. The maximum amount of time you can specify is 86,400
seconds, which is 24 hours.
-Description <String>
Specifies a description for a Virtual Machine Manager object.
-JobVariable <String>
Specifies that job progress is tracked and stored in the variable named
by this parameter. This parameter is often used in conjunction with th
e RunAsynchronously parameter.
-MemoryMB <Int32>
Specifies, in megabytes (MB), the total amount memory on the host that
is assigned to a virtual machine. You can specify values in the range f
rom 4 MB up to 3712 MB. The maximum recommended value is 3340 MB.
-Name <String>
Specifies the name of a Virtual Machine Manager object.
-Owner <String>
Specifies the owner of a Virtual Machine Manager object.
-ProcessorCount
Specifies the number of CPUs on a virtual machine, on a hardware profil
e, or on a template in a Virtual Machine Manager environment. In the cu
rrent release, the value is 1 because Virtual Machine Manager supports
only one CPU in a virtual machine.
-ProcessorSpeed
Specifies, in gigahertz (GHz), the amount of processing speed on the ho
st that this virtual machine requires.
-ProcessorType
Specifies the type of processor on the host that can be used by a virtu
al machine. You can use the Get-ProcessorType cmdlet to see a list of t
he available types of processor.
-RunAsSystem
Specifies that a virtual machine will run under the local system accoun
t. Setting this account means that Virtual Server will not automaticall
y start the virtual machine when the Virtual Server service starts. (Al
ternatively, you can use the RunAsUserCredential parameter to specify t
hat the virtual machine run under a guest account and that the virtual
machine start when the Virtual Server service starts.)
-RunAsUserCredential
Specifies the guest account (domain\account) that the virtual machine r
uns under. If you do not specify a user account, the virtual machine ru
ns under the account of the user who starts the virtual machine. Runnin
g a virtual machine under a user account enables Virtual Server to auto
matically start a virtual machine when the Virtual Server service start
s.
For enhanced security, you can create a special account for this purpos
e that has a low level of permissions. The minimum permissions required
for this account are as follows:
* On the .vmc file: Read Data, Write Data and Execute File
* On the .vhd file: Read Data, Read Attributes, Read Extended
Attributes, and Write Data
* On the .vnc file if a virtual machine is connected to a virtual
network: Execute File, Read Data, Read Attributes and Read
permissions
* On the folder that contains the .vmc file, for a virtual machine to
have the ability to save state: List Folder and Write/Create File
Alternatively, if you do not want Virtual Server to start the virtual m
achine automatically when the Virtual Server service starts, you can us
e the RunAsSystem parameter to run the virtual machine under the local
system account.
-RunAsynchronously <Boolean>
Specifies that the job created by a command will run asynchronously so
that control returns to the shell immediately. This parameter is often
used in conjunction with the JobVariable parameter.
-StartAction
Specifies the behavior of a virtual machine when Virtual Server starts.
The options are:
-StartAction AlwaysAutoTurnOnVM
-StartAction NeverAutoTurnOnVM
-StartAction TurnOnVMIfRunningWhenVSStopped
IMPORTANT: If you want to specify that the virtual machine starts autom
atically when Virtual Server starts, you must also use the -RunAsUserCr
edential to specify an account with appropriate permissions. If you do
not specify a user account, the StartAction reverts to NeverAutoTurnOnV
M.
-StopAction
Specifies the behavior of the virtual machine when Virtual Server stops
. The options are:
-StopAction SaveVM
-StopAction TurnOffVM
-StopAction ShutdownGuestOS
-UseHardwareAssistedVirtualization
Specifies that hardware-assisted virtualization is used if it is availa
ble (when set to TRUE) or not used (when set to OFF). Hardware-assisted
virtualization is a feature introduced with Microsoft Virtual Server 2
005 R2 SP1.
-VMMServer
Specifies the object that represents a Virtual Machine Manager server.
A Virtual Machine Manager server provides the Virtual Machine Manager d
atabase and enables you to manage host servers (which host virtual mach
ines) as well as library servers (which store Virtual Machine Manager l
ibrary resources). The Virtual Machine Manager database is stored eithe
r in Microsoft SQL Server on the Virtual Machine Manager itself or on a
nother server running Microsoft SQL Server.
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug,
-ErrorAction, -ErrorVariable, and -OutVariable. For more information,
type, "get-help about_commonparameters".
EXAMPLE 1: Convert a VMware-based virtual machine to a Virtual Server-based
virtual machine.
PS C:\> Get-VMMServer -ComputerName "VMMServer1.Contoso.com"
PS C:\> $VMHost = Get-VMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> New-V2V -VMXPath "C:\VMware\SourceVM.vmx" -VMHost $VMHost -Name "VM
01" -Path "C:\MyVMs" -MemoryMB 256 -RunAsynchronously
The first command connects to VMMServer1 in the Contoso.com domain and retr
ieves the server object from the Virtual Machine Manager database. The foll
owing commands use this server by default.
The second command gets from the Virtual Machine Manager database the objec
t that represents the virtual machine host named VMHost01 (in the Contoso.c
om domain) and stores the host object in variable $VMHost.
The last command creates a Virtual Server-based virtual machine named VM01
from the source VMware virtual machine whose .vmx file is located at C:\VMw
are\SourceVM.vmx and deploys the new virtual machine on the C: drive of VMH
ost01 in the MyVMs folder. The command assigns 256 MB of memory on the host
for use by the new virtual machine. The -RunAsynchronously parameter retur
ns control to the shell immediately (before the command completes). In this
example, all of the virtual disks on the source virtual machine will be co
nverted and attached to the new virtual machine.
REMARKS
For more information, type: "get-help New-V2V -detailed".
For technical information, type: "get-help New-V2V -full”.
Chapter 11 of the Windows Server 2008 Security Guide: Hardening Terminal Services is now live on TechNet.
The details of the attack surface for the Terminal Services role(s) are included in the Windows Server 2008 Attack Surface Reference workbook included in the Guide. The Terminal Services role has the greatest attack surface and requires more configuration settings than the other role services discussed in the Guide. However, only the TS Gateway role service has specific security configuration changes. There are no additional steps to secure the TS Licensing, TS Session Broker, and TS Web Access role services.
Table 11.1 summarizes the recommended security configuration tasks for hardening servers performing the Terminal Services role, including:
The Windows Server 2008 Security Guide is designed to further enhance the security of the servers in your organization by taking full advantage of the new and improved security technologies and features in Windows Server 2008. Use the guidance to create, test, and deploy your security baseline quickly and reliably, harden your server workloads, and evaluate security setting recommendations to meet the requirements of your environment.
Along with the online version above, the Windows Server 2008 Security Guide is also available as a download and includes the following components:
The updated Windows Vista Service Pack 1 management tools for the Hyper-V Release Candidate 1 are now available from the Microsoft Download Center, including:
Download the Windows Vista x64 Edition (KB949587) package now. (http://www.microsoft.com/downloads/details.aspx?FamilyId=C420D8A3-F0A7-415A-B748-3726D66BF0C3)
In Virtual Server (and VPC) it was fairly easy to create a share and place resources on it that you want to share between Host and VM. Easy, not secure for enterprise use. You can;t do this anymore in Hyper-V.
Splogbane: If you are reading this on a blog other than http://blogs.technet.com/tonyso, why not stop patronizing a splog and come over to the original?
To move/copy.share files/resources between host and VM you should use the library in SCVMM. If you aren't using SCVMM, then you must use regular ol' networking to transfer files between the host (sometimes also called parent partition) and VMs, or VM to VM.
To Share Files Between Host and VM
According to the instructions in the Hyper-V Getting Started Guide:
To create a virtual network
Open Hyper-V Manager.
From the Actions menu, click Virtual Network Manager.
Under Create virtual network, select the type of network you want to create. The types of network are External, Internal, and Private. If the network you want to create is an external network, see “Additional considerations” below.
Click Add. The New Virtual Network page appears.
Type a name for the new network. Review the other properties and modify them if necessary.
Note
You can use virtual LAN identification as a way to isolate network traffic. However, this type of configuration must be supported by the physical network adapter. For information about configuring virtual LAN identification, see the Hyper-V deployment content at the Windows Server 2008 TechCenter (http://go.microsoft.com/fwlink/?LinkID=108560).
Click OK to create the virtual network and close Virtual Network Manager, or click Apply to create the virtual network and continue using Virtual Network Manager.
Alternatively, you can use ISO images that you mount in the VM DVD drive, on a Server Core install you might want to consider having your ISOs on an iSCSI disk that you can mount to the host to build your VMsor, or, use the SCVMM library.
The Performance Tuning Guidelines for Windows Server 2008 has been updated to include perf guidelines for virtualization servers. To calculate the host RAM = (VMRamRequirementMB x #ofVMs) + (#of VMs x 32MBVMOverhead ) + (512MBHost),
The guide says:
...the root partition must have sufficient memory (leave at least 512 MB available) to provide services such as I/O virtualization, snapshot, and management to support the child partitions.
A good standard for the memory overhead of each VM is 32 MB for the first 1 GB of virtual RAM plus another 8 MB for each additional GB of virtual RAM. This should be factored in the calculations of how many VMs to host on a physical server. The memory overhead varies depending on the actual load and amount of memory that is assigned to each VM.
The TechNet Webcast: Hardening Windows Server 2008 Deployments with the Windows Server 2008 Security Guide (Level 200) is one of the top-rated webcasts last month. Also available as podcasts (audio only): WMA | MP3
splogscreen: if you are reading this on some site other than http://blogs.technet.com/tonyso, why not come on over to the original site?
Download the Security guide here. You may also find the security survival guide post useful, as well as the Learning Paths for Security.
Free-as-in-beer Codeplex help for Hyper-V admins.
PowerShell Management Library for Hyper-V
A project to provide a PowerShell management library for Hyper-V
Hyper-V Web Manager
Hyper-V Web Manager (HVWM) is a web-based management utility for Microsoft Windows Server 2008 with Hyper-V role. The web manager will eventually give you most of the functionality that is available in the Microsoft Management Console for Hyper-V. The project is not an official Microsoft project and is not developed by Microsoft employees.
Hyper-V Server 2008 Local Management scripts / UI
Hyper-V Server 2008 is based on Server Core and has no local management possible. One must have a second machine (either Windows Vista SP1 or Windows Server 2008). This project intends to develop various scripts and put them together in to a small user interface for easier / local management of hyper-v server. Most of the functionality (except VM console access / Guest Install) achieved using Hyper-V Management MMC will be mimiced here.
Hyper-V Powershell Snap in
A Powershell snap-in to access and manager Hyper-V Servers (locally or remotely)
Hyper-V Machine Recovery Tool
Small tool to recover/import Hyper-V machines which were not exported. This will include snapshots related to the Hyper-V machine.
Meet the team behind codeplex in this C9 vid: http://channel9.msdn.com/posts/Glucose/Hanselminutes-on-9-Inside-CodePlexcom/
Many of you have been looking for help on the Hyper-V setup error “Hyper-V launch failed; No-execute (NX) or DEP not enabled on processor %1 (check BIOS settings).”
Hypervisor Availability: Event ID 52
Event Details
Event ID: 52
Source: Microsoft-Windows-Hyper-V-Hypervisor
Symbolic Name: HV_EVENTLOG_BAL_NOEXECUTE_NOT_ENABLED
Message: Hyper-V launch failed; No-execute (NX) or DEP not enabled on processor %1 (check BIOS settings).
Hyper-V requires hardware support, including: an x64 CPU; VT (Intel) or AMD-V (AMD) hardware extensions; No eXecute (NX)/eXecute Disable (XD) and full BIOS support for hardware virtualization.
Check your physical computer's BIOS settings to ensure that the No Execute BIOS setting is enabled, then turn off the power to your physical computer. Restart the physical computer. NOTE: resetting the physical computer is not sufficient.
You can use the Virtualization Detect (DetectVp.EXE) tool to check if the physical machine meets the requirements for Microsoft Virtualization Software. This test checks virtualization support for both Intel and AMD processors.
To download the WDK .iso file:
1 - Go to the Microsoft Connect Web site at http://go.microsoft.com/fwlink/?LinkID=100623 and sign in with your Windows Live ID.
2 - Enter the Microsoft Connect Web site. Click Connection Directory.
3 - Click Developer Tools, and then click "Windows Driver Kit (WDK), Windows Logo Kit (WLK) and Windows Driver Framework (WDF)."
4 - Click the Download link to download 6.1.6001.18002.081017-1400_wdksp-WDK18002SP_EN_DVD.iso
Hypervisor successfully starts.
Fabrice has a great post detailing R2 interop features you want to check out first. Here is the interop detail:
R2 also comes with three components designed to simplify Unix/Linux interoperability by letting a Windows system pretend to be a *nix system by donning a variety of masks:
All these features are present in Services for Unix, but their capabilities have been enhanced, the interfaces simplified and the underlying system changes brought in line with commonly accepted industry practices.
Microsoft Hyper-V Server 2008 is out. Read about Hyper-V Server here: http://www.microsoft.com/servers/hyper-v-server/default.mspx.
One of the differences between Hyper-V on Windows Server 2008 core, and Microsoft Hyper-V Server 2008 is that Hyper-V Server comes with a set of scripts that make setup easier from the command line. These scripts are collectively called HVCONFIG and makes the setup experience look like this:
as opposed to this:
which some people find easier for that first POC/I-want-to-kick-the-tires install. Most enterprises will use automated installs, but still, for getting to know this FREE (as in beer) new virtualization product, HVCONFIG is helpful.
There is no supported way to take the scripts from the free download of Microsoft Hyper-V Server, and use it on a server core installation of Windows Server 2008 to install and configure Hyper-V, but I have heard it works just fine. Of course, if your purpose is to test/proof-of-concept - why wouldn't you use the Microsoft Hyper-V Sever instead of server core? I did mention it is FREE-as-in-beer, right? And there is no activation step in setup - not required - because Microsoft Hyper-V Server is FREE:-)
Microsoft Hyper-V Server 2008 Configuration Guide will provide you with all the information you need to setup and configure Hyper-V Server 2008. It covers setup up local administrator passwords, the new Hyper-V configuration tool (HVCONFIG) and remote management: http://www.microsoft.com/downloads/details.aspx?FamilyId=E1E111C9-FA69-4B4D-8963-1DD87804C04F
To learn more about the FREE Microsoft Hyper-V Server take a look at the Edge video: First Look: Hyper-V Server.
VHD proliferation or other disk-bloat make it necessary for you to move something? Need to check free disk space on the remote server before you move? Here's a couple of ways to do it.
The WMI Command-line (WMIC) tool provides a simple command-line interface to WMI. This allows you to use WMI to manage computers running Microsoft Windows. You can use WMIC from any computer running Windows XP Professional or an operating system in the Windows Server 2003 family to remotely manage any computer with WMI installed. WMIC does not have to be available on the remotely managed computer for WMIC to manage it. You can use it to get device data like this:
WMIC /Node:<SERVERNAME> LogicalDisk Where DriveType="3" Get DeviceID,FreeSpace,Size /format:list > %SystemDrive%\DiskInfo.txt
There is a Vista gadget available at: http://prestonhunt.com/story/107
You can download a free VBscript from the Script Center:
VB: List Free Disk Space Information for a Set of Computers
VB: List Available Disk Space
VB: Log Disk Information to an Excel Spreadsheet
VB: Show Disk Usage for All Hard Disks
VB: Write Disk Space Information to a Text File
You can ask someone on the scripting forum.
Or you can use Srvinfo.exe: Remote Server Information - available in the Windows Server 2003 Resource Kit Tools, will give you something like this:
C:\>srvinfo \\servername
The command line
(for /f %1 in (names.txt) do srvinfo \\ %1) >> serverinfo.txt
does a srvinfo.exe on all the server names in a file called names.txt then dumps the output to another text file called serverinfo.txt
Update 11_20_09: Not everyone will need to reinstall the Guest OS, if you are confident the OS in your VM is supported (probably most of you) , skip to install integration services.
Also, because we have more than 1 releases version of Hyper-V now, it is possible for the integration services on the VM to be out of sync with the Hyper-V version. This article on TechNet discusses the various combinations and outlines what the support story is for each.
OP:
Some customers seem to be having trouble when they open up device manager in a VM and see that some devices are listed as “unknown device.” From the Troubleshooting Hyper-V topic on TechNet:
Cause: Device Manager does not recognize devices that are optimized for use in virtual machines and run using Hyper-V until integration services are installed. The unknown devices that are identified in Device Manager differ depending on the guest operating system and may include: VMBus, Microsoft VMBus HID Miniport, Microsoft VMBus Network Adapter, and storvsc miniport.
Some optimized devices are not available for certain guest operating systems. When a device is not supported on a guest operating system, the device will not work. You cannot install the device driver manually to try to make the device work. For a list of the devices that are available on each supported guest operating system, see http://go.microsoft.com/fwlink/?LinkID=128037.
Solution: If the guest operating system is supported, integration services are available for that operating system. After you install the integration services, Device Manager will recognize the devices that are available for that guest operating system.
To install the guest operating system
Open Hyper-V Manager. Click Start, point to Administrative Tools, and then click Hyper-V Manager.
Connect to the virtual machine. From the Virtual Machines section of the results pane, using one of the following methods:
The Virtual Machine Connection tool opens.
From the Action menu in the Virtual Machine Connection window, click Start.
The virtual machine starts, searches the startup devices, and loads the installation package.
Proceed through the installation.
Depending on the operating system being installed, the mouse pointer may change to a small dot when you move the mouse cursor over the image of the setup window. If this occurs, click anywhere in the virtual machine window. This action "captures" the mouse so that keyboard and mouse input is sent to the virtual machine. To return the input to the physical computer, press CTRL+ALT+LEFT ARROW and then move the mouse pointer outside of the virtual machine window.
Hyper-V includes a software package for supported guest operating systems that improves integration between the physical computer and the virtual machine. This package is referred to as integration services. Newer versions of supported Windows operating systems include the integration services and do not require installation after you install the guest operating system. For more information about which operating systems are supported and which of those require you to install integration services, see the deployment content for Hyper-V at the Windows Server 2008 Technical Library (http://go.microsoft.com/fwlink/?LinkID=128037).
The following instructions assume that you are installing an operating system for which the software package is available and installation is required.
To install integration services
From the Action menu of Virtual Machine Connection, click Insert Integration Services Setup Disk. This action loads the setup disk in the virtual DVD drive.
Depending on the operating system being installed, you may need to start the installation manually. Click anywhere in the guest operating system window and navigate to the CD drive. Use the method that is appropriate for the guest operating system to start the installation package from the CD drive.
After the installation finishes, all integration services are available for use.
You don’t.
Chances are you found this blog post by searching for some combination of the words in the bag “set processor affinity Hyper-V”.
As Ben explains in his blog post: Processor Affinity and why you don’t need it on Hyper-V, there is no way to set VM processor affinity in Hyper-V. Instead, you use the “virtual machine reserve” to 100. Turn off the VM, get an account with local admin perms, then:
To configure memory or processors for a virtual machine
In the results pane, under Virtual Machines, select the virtual machine that you want to configure.
In the Action pane, under the virtual machine name, click Settings. Then, in the navigation pane, click the appropriate hardware setting as described in the following steps.
To configure the memory, click Memory. On the Memory page, specify the new amount of memory.
To configure the processor, click Processor. If multiple processors are supported by the guest operating system, specify the number of processors to assign to the virtual machine. Then click OK.
To set processor affinity, click Processor, and configure the Virtual machine reserve (percentage) to “100”:
This ensures that Hyper-V will dedicate the whole processor (or multiple whole processors – depending on how many virtual processors the virtual machine has) whenever the VM is running.
FYI the rest of the *important* stuff on this page relates to:
While you are on this page, if your VMs are highly-available (and why wouldn’t you want that?), then you need to review the settings in the Processor Compatibility section:
If the physical computer has multiple processors and uses non-uniform memory architecture (NUMA), we recommend that you do not assign more processors or memory to a virtual machine than are available on a single NUMA node. For example, do not assign 4 processors to a virtual machine if each NUMA node has only two processors. For more information about the processor architecture of the physical computer, see the documentation that came with the computer.
Now, if your VM requires a specific CPU feature, then you have already determined that all the virtualization servers (hosts) in the cluster support the same feature, right? If not, then it is possible that the VM will not live or quick migrate. If the OS/and/or application you are running on a VM require a specific CPU feature, and that feature is not supported on the new host, then Hyper-V won’t migrate the VM.
Microsoft is developing an Exchange SLA scorecard. The userguide introduction explains:
"As we move into more complex and interdependent applications, it becomes increasingly difficult to track the capabilities of various IT services. Furthermore, it seems that there is no single formula or presentation mechanism to easily roll up the data and demonstrate that IT is in fact meeting the needs of the business and achieving its service level agreement (SLA) targets.
Microsoft IT has become a world-class IT organization, possessing much experience in managing a large enterprise and achieving great success in messaging service delivery. Microsoft IT is diligent in its operations management processes and metrics management. They track key components and derive measurements that truly show how IT services are performing against business needs. They measure service delivery based on IT scorecards and SLAs. These metrics and measures allow them to fine tune services and achieve high availability with the Microsoft® Exchange Server messaging platform. However, since there is no industry standard for measuring services, customers frequently ask, “How does Microsoft do it?” The SLA Scorecard Solution Accelerator for Exchange provides customers with best practices for measuring the service delivery of Exchange."
The official name of the Beta is Microsoft Solutions for Infrastructure and Management Exchange SLA Scorecard.
Beta 2 of the scorecard is in use by a small group for customers in the Technology Adoption Program under NDA and other formal agreements. The TAP program is closed to new customers for getting official support from Microsoft. However, anyone can download the SLA materials, with BetaPlace registration, which includes signing a EULA. These "open beta" customers only get limited best-effort email support from the product team as time allows, but can still enter bugs and suggestions.
You can download the SLA Scorecard Beta 2 at http://www.beta.microsoft.com with the user name MSIMExchangeSLA (Case sensitive).
The beta includes the following components and features that are compatible with Exchange 2000/2003:
Why?
The scorecard shows more than just service uptime. It roles up availability by Exchange server role for all Exchange servers in the enterprise. It allows you to configure your SLA target metrics and aggregates MOM event and performance data, displaying actual availability vs. SLA target.
In addition, there are about 11 measures that give you a picture of the "workload" the infrastructure is doing. You can use this to help tune performance to more effectively achieve the SLA target. For example, using a version of the scorecard accelerator to monitor outage maintenance, Microsoft IT is able to categorize each particular outage and export the entire outage table to Excel. This helps Service Managers and IT Managers demonstrate that from an end to end perspective an email outage is more than an application outage. By slicing and dicing the outage data in prep for Service Review Meetings they can present where the majority of outages are occurring and focus efforts in those areas as appropriate. This makes a nice tie-in to change/problem management.
UPDATE: If you are interested in the SLA scorecard, you will definately be interested in this webcast.
TechNet Webcast: Defining and Monitoring Desired Configuration Across a Messaging Service (Level 300)Wednesday, September 21, 2005 - 11:30 AM - 12:30 PM Pacific TimeEdhi Sarwono, SYSTEMS DESIGN ENGINEER, Microsoft CorporationRobbie McAlpine, SR PROGRAM MANAGER, Microsoft CorporationDo you consider it a challenge to monitor a configuration across a messaging service? This webcast presents a new solution: the Desired Configuration Monitoring (DCM) Solution Accelerator, which will be released in September. Learn about the DCM Solution Accelerator, how configuration manifests are generated, how the configuration check is processed and about the resulting reports of non-compliant services. The Solution Accelerator provides tools to alert users of differences or non-compliance between their present configuration and baseline or desired configuration. It also provides environmental configuration data to aid configuration management.Register for this webcast
Collating together best practice tips for getting best performance from your VMs:
1. Software optimization:
2. Memory Optimization: Install additional RAM in the host computer. The amount of RAM in the host computer limits the number of virtual machines that you can run in Virtual Server 2005 more than any other factor. The host operating system and each running virtual machine require sufficient memory. To calculate the total amount of memory that you require, tote up:
For example:
Physical or virtual machine
Operating system
RAM allocated to OS
RAM allocated to virtualization
Total RAM required
Host computer
Windows Server 2003
512 MB
Virtual machine 1
Windows NT 4.0 Service Pack 6a
128 MB
32 MB
672 MB
Virtual machine 2
832 MB
Virtual machine 3
Windows 2000 Service Pack 4
256 MB
1120 MB
Virtual machine 4
1408 MB
Virtual machine 5
1952 MB
Virtual machine 6
2496 MB
Virtual machine 7
3040 MB
Virtual machine 8
3584 MB
3. CPU optimization: Install additional CPUs in the host computer. Disable Hyperthreading if the host has support for it.
4. Disk optimization:
See: http://support.microsoft.com/default.aspx?scid=kb;en-us;903748 and http://blogs.technet.com/brucecowper/archive/2004/12/22/330223 and http://support.microsoft.com/kb/840575/en-us