Register-SCVirtualMachine
Register-SCVirtualMachine
Registers an existing virtual machine with VMM.
構文
Parameter Set: Default
Register-SCVirtualMachine [-Path] <String> [-VMHost] <Host> [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]
詳細説明
The Register-SCVirtualMachine cmdlet registers an existing virtual machine with Virtual Machine Manager (VMM) that is not currently registered with the virtualization platform (Hyper-V, VMware, or XenServer) of any host managed by VMM, and is not stored in the VMM library. If virtual machine files are stored in the VMM library, you do not need to register the virtual machine before you deploy it on a host.
The configuration files for the virtual machine that you want to register must be stored either in the file system on the host on which you want to deploy the virtual machine or stored on shared storage (such as a SAN) available to this host:
-- HYPER-V HOST. You can register a virtual machine for a Hyper-V host if the configuration files for that virtual machine are stored in a folder on the host's file system or on shared storage, and an export of the virtual machine was created using the Export function in the Hyper-V Manager console.
The path must specify a folder. Example: -Path D:\HyperVFolderForVMs
-- VMWARE ESX HOST. You can register a virtual machine for a VMware ESX host if the VMware virtual machine configuration file (a .vmx file) is stored on the host's file system or on shared storage. No separate export step is required.
The path must specify the folder and the configuration file. Example: -Path [Datastore]\VMwareFolderForVMs\VM.vmx
-- CITRIX XENSERVER HOST. This command does not apply to virtual machines on a XenServer host.
パラメーター
-JobGroup<Guid]>
Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Path<String>
Specifies the destination path for the operation.
Example formats:
Local: -Path "F:\"
UNC: -Path "\\Library\Templates"
Volume GUID: -Path "\\?\Volume{4703c1ea-8ae7-11db-b473-00123f7603e3}\"
VMware ESX: -Path "[storage1]\MyVMwareFolderForVMs\MyVM.vmx"
Citrix XenServer: -Path "Local storage[99b6212f-b63d-c676-25f9-d6c460992de7]"
Wildcards are supported for Get- cmdlets and when you specify the UNC path.
Example format:
UNC: -Path "\\VMHostServer\MyVMs\*VM*"
エイリアス |
none |
必須? |
true |
位置は? |
1 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PROTipID<Guid]>
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VMHost<Host>
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, type Get-Help Add-SCVMHost -detailed
. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.
エイリアス |
none |
必須? |
true |
位置は? |
1 |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- VirtualMachine
例
Example 1: Register an existing virtual machine on a Hyper-V host
The first command gets the Hyper-V host object named HVHost02, and then stores the object in the $VMHost variable.
The second command adds the existing virtual machine on HVHost02 to VMM by specifying the path to the folder that contains the virtual machine configuration file.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "HyperVHost01"
PS C:\> Register-SCVirtualMachine -VMHost $VMHost -Path "D:\HyperVFolderForVMs"
Example 2: Register an existing virtual machine on a VMware ESX host
The first command gets the object that represents a VMware ESX host called ESXHost03, and then stores the host object in the $VMHost variable.
The second command adds an existing virtual machine on ESXHost03 to VMM by specifying the path to the virtual machine's virtual machine configuration file, MyVM.vmx.
PS C:\> $VMHost = Get-VMHost -ComputerName "ESXHost03"
PS C:\> Register-SCVirtualMachine -VMHost $VMHost -Path "[storage1]\VMwareFolderForVMs\MyVM.vmx"