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”.
In VMM we say "everything you can do in the GUI you can do on the command line” because the Administrator Console is build on top of Windows PowerShell.
The fact is, there are some things you can do on the command-line much easier than in the GUI. For example, if you are creating VMs using the Administrator Console, you will want to install VM Additions on them.
Using the Administrator Console you would:
1) Open the VM properties.
2) Click the Hardware Config tab.
3) Add a DVD drive to the IDE device if there is not one there already
4) Click "Known image file" and then browse to the VMAdditions ISO, click it, and click OK.
5) Click Apply
.
If the Known image file list does not currently include VMAdditions, you can copy the VMAdditions.iso file from Microsoft Virtual Server 2005 (which is installed by default with Virtual Machine Manager). You can find the VMAdditions.iso file in Windows Explorer at <C>:\Program Files\Microsoft Virtual Server\Virtual Machine Additions
Here is a PowerShell script you can run on the VMM server that will do that. Of course this is an example to get you thinking, and error checking should be added. It assumes that you have an ISO called VMAdditions.iso in a library share managed by VMM. The VM Additions are installed with Virtual Server 2005 R2 SP1 in the <yourinstalldrive>\Program Files\Microsoft Virtual Server\Virtual Machine Additions folder. So you first either copy this ISO to the library for use on all VMs, or modify the script to use the copy local to the host your VM is on. We recommend the first way J
# Install-VMAdditions.ps1
$vm = $args[0]
if ( $vm.State -eq ‘Running’ )
{
$vmadditions = get-iso | where { $_.Name –eq ‘VMAdditions’ }
Set-VirtualDVDDrive –VirtualDVDDrive $vm.VirtualDVDDrives[0] -Link –ISO $vmadditions
}
else
write-host "The VM must be Running before you can install VM Additions."
To use this script:
$vm = get-vm –Name “My VM”
C:\Scripts\Install-VMAdditions.ps1 $vm
The VM Additions installer will launch automatically inside the guest OS.
NOTE:
· At RTM, $vm.State will be $vm.Status
· The VM does not need to be running order to attach an ISO to a Virtual DVD drive, but the VM does need to be running in order to install VM Additions.
· On the Set-VirtualDVDDrive lines, the –Link parameter means: Point to the ISO inside the library instead of copying it to the host.
Bonus Question: Where are the virtual machine additions for Linux?
Answer: Read http://www.microsoft.com/technet/virtualserver/downloads/linuxguestsupport.mspx
Everything you can do in the VMM Beta 2 Administrator Console you can do on the command line. Our PM puts it best, "Our API is the customer's API".
For example, a beta VMM user recently asked "How can I specify which bus/lun I want to assign myHD to when I create a new vm? It seems that New-VM isn’t happy if you don’t pass it a –virutalharddisk parameter so I can’t seem to create the VM first and then use Add-VirtualHardDisk."
You can do this in a job group, here’s an example that shows creating a vm in a job group that adds a VHD to IDE 1,0 and adds a NIC:
$job = [Guid]::NewGuid().ToString()
New-VirtualNetworkAdapter -VMMServer localhost -JobGroup $job -EthernetAddressType Dynamic
Add-VirtualHardDisk -JobGroup $job -Bus 1 -Lun 0 -VirtualHardDisk $VirtualHardDisk -IDE
New-VM -VMMServer localhost -Name $name -VMHost $VMHost -Path $path -HardwareProfile $HardwareProfile -JobGroup $job -runasynchronously
You can use this to do new-vm related cmndlets before calling the new-vm itself (such as adding VHDs or adding a NIC in this example)
We've just posted the MP for VMM Beta 2 ont he connect.microsoft.com site (requires Windows Live ID sign-in and Beta program participation: http://go.microsoft.com/fwlink/?LinkID=85858
1. Deploy System Center Operations Manager 2007:
a. Install System Center Operations Manager 2007. System requirements and installation instructions which can be downloaded from: http://www.microsoft.com/technet/opsmgr/2007/library/proddocs.mspx
b. Configure the Data Warehouse and Reporting in Operations Manager.
c. Deploy an Operations Manager agent on each computer on which a VMM component is installed. These include the VMM server, virtual machine hosts, library servers, and the Web server that hosts the Virtual Machine Manager Self-Service Portal.
2. Import the Virtualization Management Pack prerequisite Management Packs:
a. Before you import the Management Packs for Virtual Machine Manager, you must import the following Management Packs into Operations Manager:
· Microsoft.Windows.Server.Library.mp
· Microsoft.SQLServer.2005.Discovery.mp
· Microsoft.SQLServer.2005.Monitoring.mp
· Microsoft.SQLServer.Library.mp
· Microsoft.Windows.InternetInformationServices.2003.MP
· Microsoft.Windows.InternetInformationServices.CommonLibrary.MP
· Microsoft.Windows.Server.2003.mp
Note: These Management Packs provide data for the Virtualization Management Pack. They can be found in the Management Packs directory of the Operations Manager Installation source media
3. Enable the Operations Manager agent on the Virtual Machine Manager server to be used as a proxy:
a. In the Operations Manager Console, display the Administration tab.
b. Under Device Management, click the Agent Managed node.
c. From the list of computers in the center pane, right-click the entry for the computer that is the Virtual Machine Manager server, and then click Properties.
d. On the Security tab, select the checkbox that allows the agent to be used as a proxy.
e. Click OK to commit the changes
Note: The security account that the Operations Manager agent on the VMM server is running as must be granted access to the database in SQL Server that Virtual Machine Manager uses.
2. Download and import the Server Virtualization Management Pack:
a. Download the zipped MP files from the connect site: http://go.microsoft.com/fwlink/?LinkID=85858
b. Unzip the files on the computer running the Operations Manager console.
c. On the Administration tab of the Operators Console, click the Management Packs node.
d. On the Actions menu, click Import Management Packs.
e. Select all four of the Management Pack files that were downloaded, and then click Open.
f. To import the selected Management Packs, click Import.
3. Enable Virtual Machine Manager administrators to view and order reports:
a. On the Administration tab in the Operations Manager console, expand Security, and then click User Roles.
b. Double-click the Operation Manager Report Operator node.
c. In the dialog box, add all of the Virtual Machine Manager administrators who will access reports either through Operations Manager or through the VMM Administrator Console.
1. Enable the reporting tab in the VMM console
a. In the Virtual Machine Manager Administrator Console, display Administration view, and expand the Settings node.
b. In the results pane, double-click Reporting Settings to open the Reporting Settings dialog box.
c. Select the Enable reporting checkbox, and then enter the URL for the MOM reporting server in the following format: http://opsmgrserver./ReportServer. (where <opsmgrserver> is the name of the reporting server configured in step 1.b above and “/reportserver” is a parameter indicating the server’s role in Operations Manager)
d. To add Reporting view to the Administrator Console, close and reopen the VMM Administrator Console.
e. To display the VMM reports, click the Reporting button beneath the navigation pane on the left side of the console.
Note: In order to display the reports list in the VMM Administrator Console, you must have the Report Operator role in Operations Manager. For information, see “Enable Virtual Machine Manager Administrators to view and order reports,” earlier in this document.
-All Your VMs Are Belong To Us...
Free (with Windows Live ID sign in and Beta program participation**).
To facilitate rapid deployment for demonstration and evaluation, you can now download a free evauation version of System Center Virtual Machine Manager 2007 (VMM) pre-installed and pre-configured in a Virtual Hard Disk (VHD). You can use the VHD to create a virtual machine (VM) running VMM.
Instructions are here.
Like the idea of Betas released as VHD? Let us know by leaving comments on this blog.
Enjoy :-)
Please note that the "case sensitive" admin password for the VHD is: Evaluation1This VHD contains;· Microsoft Windows Server 2003 R2 SP1 Trial Software (30-day version)· Microsoft SQL Server 2005 Express Edition SP1· Microsoft .NET Framework 2.0· Microsoft .NET Framework 3.0· Windows Remote Management (WinRM)· Microsoft Core XML Services (MSXML) 6.0· Windows Server Internet Information Services (IIS)· Windows PowerShell 1.0· System Center Virtual Machine Manager 2007 Server Beta2· System Center Virtual Machine Manager 2007 Administrator Console Beta2· System Center Virtual Machine Manager 2007 Self Service Portal Beta2
http://www.microsoft.com/technet/try/vhd/faq.mspx
Q. How long is the evaluation period for the VHD?
A. Open evaluations for customers will enable a 30-day evaluation time period. MSDN and TechNet subscribers are governed by their agreements and may use their subscription product keys to test and evaluate the products in the VHD for up to 365 days, but this depends on when the original VHD was created.
**sign-up for the beta program first
To sign-up for System Center Virtual Machine Manager Beta and download Beta 2:
Right-click on your VM in the Administrator Console and the new (in Beta 2) vm “tag” feature appears. Enter a tag for the VM here. Now you have a way of grouping vms that have tags in the "Virtual Machine Views" section, or sort the Virtual Machines view by selecting Tag from the “group by” list. Mighty handy as a way of tracking self-service vms, for example.
To set a tag on a vm, right-click and view properties. On the General tab of the vm enter a value in the "Tag" field.
And, because this is VMM, where everything you can do in the GUI you can do on the command-line, to query on the tags, on the VMM shell command line use:
get-vm | where {$_.Tag -match "<tag name>" }