Register-SCVirtualMachine

Registers an existing virtual machine with VMM that is currently not registered with the virtualization platform of any host managed by VMM and is not stored in the VMM library.

Syntax

Register-SCVirtualMachine
        [-VMHost] <Host>
        [-Path] <String>
        [-JobGroup <Guid>]
        [-RunAsynchronously]
        [-PROTipID <Guid>]
        [-JobVariable <String>]
        [<CommonParameters>]

Description

The Register-SCVirtualMachine cmdlet registers an existing virtual machine with Virtual Machine Manager (VMM). Register a host that is not currently registered with the virtualization platform of any host managed by VMM, and is not stored in the VMM library. Virtualization platforms are Hyper-V, VMware, and XenServer. If virtual machine files are stored in the VMM library, you do not have to register the virtual machine before you deploy it on a host.

The configuration files for the virtual machine to register must be stored either in the file system on the host on which to deploy the virtual machine or stored on shared storage available to this host.

To register a virtual machine for a Hyper-V host, the configuration files for that virtual machine must be stored in a folder on the file system of the host or on shared storage. Additionally, you must create an export of the virtual machine by using the Export command in the Hyper-V Manager console. The path must specify a folder.

To register a virtual machine for a VMware ESX host, the VMware configuration .vmx must be stored on the file system of the host or on shared storage. There is no separate export step. The path must specify the folder and the configuration file.

Do not use this cmdlet to register virtual machines on a XenServer host.

Examples

Example 1: Register an existing virtual machine on a Hyper-V host

PS C:\> $VMHost = Get-SCVMHost -ComputerName "HyperVHost01"
PS C:\> Register-SCVirtualMachine -VMHost $VMHost -Path "D:\HyperVFolderForVMs"

The first command gets the Hyper-V host object named HyperVHost01, and then stores that object in the $VMHost variable.

The second command adds the existing virtual machine on HVHost02 to VMM by specifying the path of the folder that contains the virtual machine configuration file.

Example 2: Register an existing virtual machine on a VMware ESX host

PS C:\> $VMHost = Get-VMHost -ComputerName "ESXHost03" 
PS C:\> Register-SCVirtualMachine -VMHost $VMHost -Path "[storage1]\VMwareFolderForVMs\MyVM.vmx"

The first command gets the object that represents a VMware ESX host called ESXHost03, and stores that host object in the $VMHost variable.

The second command adds an existing virtual machine on ESXHost03 to VMM by specifying the path of the virtual machine's virtual machine configuration file.

Required Parameters

-Path

Specifies the path of the virtual machine configuration file for the virtual machine that this cmdlet registers.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMHost

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, see the Add-SCVMHost cmdlet.

Type:Host
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-JobGroup

Specifies an identifier for a series of commands that run as a set just before the final command that includes the same job group identifier runs.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

Specifies the name of a variable in which to track and store job progress.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

VirtualMachine