Export (0) Print
Expand All
Expand Minimize

Add-SCVMHost

Updated: September 27, 2012

Applies To: System Center 2012 - Virtual Machine Manager

Add-SCVMHost

Adds a computer as a virtual machine host.

Syntax

Parameter Set: DomainJoined
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> [-AvailableForPlacement <Boolean> ] [-CPUPercentageReserve <UInt16> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64> ] [-JobVariable <String> ] [-MaintenanceHost <Boolean> ] [-MaxDiskIOReservation <UInt64> ] [-MemoryReserveMB <UInt64> ] [-NetworkPercentageReserve <UInt16> ] [-PROTipID <Guid> ] [-Reassociate <Boolean> ] [-RemoteConnectEnabled <Boolean> ] [-RemoteConnectPort <UInt32> ] [-RunAsynchronously] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: Clustered
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -VMHostCluster <HostCluster> [-AvailableForPlacement <Boolean> ] [-Certificate <ClientCertificate> ] [-CPUPercentageReserve <UInt16> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64> ] [-EnableSecureMode <Boolean> ] [-JobVariable <String> ] [-MaintenanceHost <Boolean> ] [-MaxDiskIOReservation <UInt64> ] [-MemoryReserveMB <UInt64> ] [-NetworkPercentageReserve <UInt16> ] [-PROTipID <Guid> ] [-Reassociate <Boolean> ] [-RemoteConnectEnabled <Boolean> ] [-RemoteConnectPort <UInt32> ] [-RunAsynchronously] [-TCPPort <UInt32> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: ESXHost
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -VirtualizationManager <VirtualizationManager> [-AvailableForPlacement <Boolean> ] [-Certificate <ClientCertificate> ] [-CPUPercentageReserve <UInt16> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64> ] [-JobVariable <String> ] [-MaintenanceHost <Boolean> ] [-MaxDiskIOReservation <UInt64> ] [-MemoryReserveMB <UInt64> ] [-NetworkPercentageReserve <UInt16> ] [-PROTipID <Guid> ] [-Reassociate <Boolean> ] [-RemoteConnectEnabled <Boolean> ] [-RemoteConnectPort <UInt32> ] [-RunAsynchronously] [-SshPublicKey <ClientSshPublicKey> ] [-SshPublicKeyFile <String> ] [-SshTcpPort <UInt32> ] [-TCPPort <UInt32> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: NonTrustedDomain
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -NonTrustedDomainHost [-AvailableForPlacement <Boolean> ] [-CPUPercentageReserve <UInt16> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64> ] [-JobVariable <String> ] [-MaintenanceHost <Boolean> ] [-MaxDiskIOReservation <UInt64> ] [-MemoryReserveMB <UInt64> ] [-NetworkPercentageReserve <UInt16> ] [-PROTipID <Guid> ] [-Reassociate <Boolean> ] [-RemoteConnectEnabled <Boolean> ] [-RemoteConnectPort <UInt32> ] [-RunAsynchronously] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: PerimeterNetwork
Add-SCVMHost [-ComputerName] <String> -EncryptionKey <PSCredential> -PerimeterNetworkHost -SecurityFile <String> [-AvailableForPlacement <Boolean> ] [-CPUPercentageReserve <UInt16> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64> ] [-JobVariable <String> ] [-MaintenanceHost <Boolean> ] [-MaxDiskIOReservation <UInt64> ] [-MemoryReserveMB <UInt64> ] [-NetworkPercentageReserve <UInt16> ] [-PROTipID <Guid> ] [-Reassociate <Boolean> ] [-RemoteConnectEnabled <Boolean> ] [-RemoteConnectPort <UInt32> ] [-RunAsynchronously] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: XenServerHost
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -XenServerHost [-AvailableForPlacement <Boolean> ] [-Certificate <ClientCertificate> ] [-CPUPercentageReserve <UInt16> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64> ] [-EnableSecureMode <Boolean> ] [-JobVariable <String> ] [-MaintenanceHost <Boolean> ] [-MaxDiskIOReservation <UInt64> ] [-MemoryReserveMB <UInt64> ] [-NetworkPercentageReserve <UInt16> ] [-PROTipID <Guid> ] [-Reassociate <Boolean> ] [-RemoteConnectEnabled <Boolean> ] [-RemoteConnectPort <UInt32> ] [-RunAsynchronously] [-TCPPort <UInt32> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]




Detailed Description

The Add-SCVMHost cmdlet adds one or more computers as virtual machine hosts to System Center Virtual Machine Manager (VMM). A virtual machine host is a physical computer managed by VMM whose role is to host one or more virtual machines.

TYPES OF VIRTUAL MACHINE HOSTS SUPPORTED IN VMM FOR SYSTEM CENTER 2012

---------------------------------------------------

From the perspective of networking and domains, the types of hosts that VMM for System Center 2012 supports include:

- Domain-joined Windows host - The host can be located in either a

trusted or untrusted domain.

- Perimeter network Windows host - A non-domain-joined Windows host

can be managed in the same way as a perimeter network Windows

host that is located in a domain.

- A VMware ESX host - ESX hosts do not use Windows Active Directory

domains.

- A Citrix XenServer host - XenServer hosts are managed in the same way

whether or not they are configured to use Windows Active Directory.

From the perspective of virtualization platform and operating system, the types of hosts that VMM for System Center 2012 supports include:

- Hyper-V hosts - A server running Windows Server 2008 or later with the

Hyper-V role enabled.

- VMware ESX hosts " A VMware ESX host running proprietary software,

including a hypervisor, that is managed by a VMware vCenter

Server running Windows.

- Citrix XenServer hosts " A Citrix XenServer server running proprietary

software, including a hypervisor.

VMM for System Center 2012 manages these three types of hosts, even though each host type implements virtualization in a different way. The following sections describe each type of host in more detail. You can review the system requirements for virtual machine hosts host in the Microsoft TechNet library at http://go.microsoft.com/fwlink/?LinkId=217486.

WHAT YOU NEED TO KNOW BEFORE YOU ADD A HYPER-V HOST

---------------------------------------------------

- Review the system requirements for Hyper-V hosts located in the Microsoft

TechNet library at http://go.microsoft.com/fwlink/?LinkID=213749.

- The Add-SCVMHost cmdlet will enable the Hyper-V server role for you,

but you must first configure the Virtualization option in the BIOS

manually.

WHAT YOU NEED TO KNOW BEFORE YOU ADD A WINDOWS-BASED PERIMETER NETWORK HOST

---------------------------------------------------------------------------

To manage a Windows-based host in a perimeter network:

- Install the Virtual Machine Manager agent locally on the perimeter

network host.

- When you run VMM Setup and choose the option indicating that

this host is on a perimeter network, the wizard prompts you to:

- Provide an encryption key for the security file.

- Specify where you want to store the security file.

- After you have installed the local agent, obtain the security file from

the folder in which it is stored. The default location is:

C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager, and

the name of the security file is SecurityFile.txt.

- Copy the security file to a location that is accessible to the computer on

which a VMM console is installed.

- When you use Add-SCVMHost to add the perimeter network host, you must

specify the same encryption key and point to the local security file by

using the -EncryptionKey and -SecurityFile parameters. Followng is an

example format for these parameters:



Example format: -SecurityFile "C:\SecurityFile.txt" -EncryptionKey $Key

Example 2 outlines the cmdlets to use to add a perimeter network host.

WHAT YOU NEED TO KNOW BEFORE YOU ADD A VMWARE ESX HOST

------------------------------------------------------

- Review the system requirements for VMware ESX hosts in the Microsoft

TechNet Library at http://go.microsoft.com/fwlink/?LinkID=215885.

WHAT YOU NEED TO KNOW BEFORE YOU ADD A CITRIX XENSERVER HOST

---------------------------------------------------

- Review the system requirements for Citrix XenServer hosts in the Microsoft

TechNet library at http://go.microsoft.com/fwlink/?LinkId=217487.

For more information about Add-SCVMHost, type: "Get-Help Add-SCVMHost -online".

Parameters

-AvailableForPlacement<Boolean>

Indicates whether the VMM placement process will consider this host or this volume on a host to be eligible as a possible location on which to deploy virtual machines. If this parameter is set to False, you can choose to deploy virtual machines on this host or volume anyway. The default value is True. This parameter does not apply to VMware ESX hosts.

When this parameter is used with network adapters, if set to $False, then placement will not consider the logical networks configured on this network adapter to determine if the host is suitable for connecting a virtual machine.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Certificate<ClientCertificate>

Specifies a security certificate object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ComputerName<String>

Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are: FQDN, IPv4 or IPv6 address, or NetBIOS name.

NOTE: See the examples for a specific cmdlet to determine how that cmdlet specifies the computer name.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUPercentageReserve<UInt16>

Specifies the percentage of CPU to reserve for the use of the operating system on the physical host computer. If you do not use this parameter to specify the reserve, the default setting for the host group is used: 10 percent. The VMM placement process will not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<VMMCredential>

Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.

For more information about the PSCredential object, type: "Get-Help Get-Credential".

For more information about Run As accounts, type: "Get-Help New-SCRunAsAccount".


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

States a description for the specified object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DiskSpaceReserveMB<UInt64>

Specifies, in megabytes (MB), the amount of disk space to reserve for the use of the operating system on the physical host computer. If you do not use this parameter to specify the reserve, the default setting for the host group is used: 100 MB. The VMM placement process will not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableSecureMode<Boolean>

Indicates whether VMM communicates with VMware ESX hosts and Citrix XenServer hosts in secure mode. The default value is $True.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EncryptionKey<PSCredential>

Specifies credentials to be used as an encryption key when you add a Hyper-V host located in a perimeter network to VMM.

Example format: -SecurityFile "C:\SecurityFile.txt" -EncryptionKey $Key


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaintenanceHost<Boolean>

This parameter is obsolete. Use AvailableForPlacement instead.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxDiskIOReservation<UInt64>

Specifies the maximum disk I/O per second (IOPS) on the physical host computer. If you do not use this parameter to specify the reserve, the default setting for the host group is used: 10000. The VMM placement process will not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MemoryReserveMB<UInt64>

Specifies, in megabytes (MB), the amount of memory to reserve for the use of the host operating system on the physical host computer. If you do not use this parameter to specify the reserve, the default setting for the host group is used: 256 MB. The VMM placement process will not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NetworkPercentageReserve<UInt16>

Specifies the percentage of network capacity to reserve for the use of the host operating system on the physical host computer. If you do not use this parameter to specify the reserve, the default setting for the host group is used: 10 percent. The VMM placement process will not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NonTrustedDomainHost

Indicates that the host to be added to VMM belongs to a non-trusted domain.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PerimeterNetworkHost

Indicates that this host is located in a perimeter network.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Reassociate<Boolean>

Reassociates a host currently managed by one VMM server with another VMM server.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoteConnectEnabled<Boolean>

Enables, when set to $True, a connection on a host server that lets users connect to their virtual machines remotely. This parameter only applies to virtual machines on Hyper-V hosts. It is not applicable to virtual machines on VMware ESX hosts or Citrix XenServer hosts.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoteConnectPort<UInt32>

Specifies a default value for the TCP port to use when a remote user connects to a virtual machine. Typically, the default port for a Hyper-V host is 2179. This parameter does not apply to VMware ESX hosts or Citrix XenServer hosts.


Aliases

none

Required?

false

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SecurityFile<String>

Specifies the path to a file that contains the certificate and credentials to use for authentication of a Hyper-V host located in a perimeter network. This parameter does not apply to VMware ESX hosts or Citrix XenServer hosts.

Example format: -SecurityFile "C:\SecurityFile.txt" -EncryptionKey $Key


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SshPublicKey<ClientSshPublicKey>

Specifies the public key used by Secure Shell (SSH) communications.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SshPublicKeyFile<String>

Specifies the path to the public key file for establishing a secured SSH channel with the target hosts.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SshTcpPort<UInt32>

Specifies the TCP port number used by the Secure Shell (SSH) protocol.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TCPPort<UInt32>

Specifies a numeric value that represents a TCP port.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualizationManager<VirtualizationManager>

Specifies a virtualization manager object managed by VMM.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHostCluster<HostCluster>

Specifies a VMM host cluster object.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHostGroup<HostGroup>

Specifies a virtual machine host group object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VMPaths<String>

Specifies a set of default paths (as strings separated by the pipeline operator) on a host where virtual machine files can be stored.

Example format: -VMPaths "C:\Folder1|C:\Folder2|C:\Folder3"


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-XenServerHost

Indicates that the specified host is a Citrix XenServer host.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Host

Examples

1: Add a host in the same domain as the VMM server.

The first command gets the Run As account object named HostComputer RunAsAccount and stores the object in the $RunAsAccount variable.The required credentials for this operation are either a local Administrator account or a domain account with administrator rights on the computer that you want to add as a host.

The second command adds the host object named VMHost01 in the Contoso domain to VMM as a managed host, specifies a description, enables remote connections, and specifies that TCP port 5900 will be used for remote connections to VMHost01. As the last command is processed, $RunAsAccount provides credentials to Add-SCVMHost.


PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAcct01"PS C:\> Add-SCVMHost "VMHost01.Contoso.com" -Description "This is a new host" -RemoteConnectEnabled $True -RemoteConnectPort 5900 -Credential $RunAsAccount

2: Add a host located in a perimeter network to VMM.

The first command prompts you for a user name and password and stores the credentials in $Key. The user name can be any user name, but the password must be the same encryption key that was used when the VMM agent was installed on this computer. The VMM agent must be installed locally on a computer located in a perimeter network by choosing the local agent option when you run Setup. You specify the encryption key for the security file on the Security File Folder page of the System Center Virtual Machine Manager Agent Setup wizard.

The second command adds a host object that represents the computer named VMHost02 to the VMM database as a managed host. The command adds a description, disables remote connections, and specifies that this host is located in a perimeter network. This command uses the credentials stored in $Key to decrypt the contents of SecurityFile.txt (which, in this example, is located at C:\) and then uses the contents of SecurityFile.txt to authenticate the new host.


PS C:\> $Key = Get-SCCredentialPS C:\> Add-SCVMHost "VMHost02" -Description "This is my new perimeter network host" -RemoteConnectEnabled $FALSE -PerimeterNetworkHost -SecurityFile "C:\SecurityFile.txt" -EncryptionKey $Key

3: Add a host located in a non-trusted domain to VMM.

The first command gets the Run As account object named RunAsAccount02 and stores the object in the $RunAsAccount variable. The required credentials for this operation are an account with administrator rights to add a host located in the non-trusted domain to the VMM server in the Contoso.com domain.

The second command adds VMHost03, located in a domain that is not trusted by Contoso.com, to the VMM database as a managed host. As this command is processed, $RunAsAccont provides credentials to Add-SCVMHost.


PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount02"PS C:\> Add-SCVMHost "VMHost03.NonTrustedDomain.com" -VMMServer "VMMServer01.Contoso.com" "NonTrustedDomainHost "Credential $RunAsAccount

4: Add a VMware ESX host to VMM.

The first command gets the host group object named HostGroup02 and stores the object in the $HostGroup variable.

The second command gets the Run As account object named ESX Host Computer Acct and stores the object in the $RunAsAccount variable.

The third command gets the virtualization manager object named VirtMgrServer02 and stores the object in thye $VirtMgr variable.

The last command adds ESX Host01 to HostGroup02. The command provides the credentials in the form of a Run As account stored in $RunAsAccount, which is required to add this host to VMM.


PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup02"PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "ESX Host Computer Acct"PS C:\> $VirtMgr = Get-SCVirtualizationManager -ComputerName "VirtMgrServer02.Contoso.com"PS C:\> Add-SCVMHost -ComputerName "ESXHost01.Contoso.com" "Credential $RunAsAccount -VirtualizationManager $VirtMgr "VMHostGroup $HostGroup

5: Add a Citrix XenServer host to VMM.

The first command gets the host group object named HostGroup04 and stores the object in the $HostGroup variable.

The second command gets the Run As account object named XenServer Host Computer Acct and stores the object in the $RunAsAccount variable. The required credentials for this operation are an account with root credentials on the XenServer host.

The third command gets the certificate object for XenServerHost01 and stores the object in the $Certificate variable.

The last command adds a XenServer as a host to HostGroup04 in VMM and provides the credentials in the form of a Run As account stored in $RunAsAccount, which is required to add this host to VMM.


PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup04"PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "XenServer Run As Acct"PS C:\> $Certificate = Get-SCCertificate -ComputerName "XenServerHost01.Contoso.com"PS C:\> Add-SCVMHost -ComputerName "XenServerHost01.Contoso.com" "Credential $RunAsAccount "VMHostGroup $HostGroup -XenServerHost -Certificate $Certificate -EnableSecureMode $True -TCPPort 5989

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft