Share via


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

Default (Default)

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.

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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobVariable

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Path

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsynchronously

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Host
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

VirtualMachine