次の方法で共有


New-SCVMHost

New-SCVMHost

Creates a VMM host from a physical computer.

Syntax

Parameter Set: LegacySkipBMCPowerControl
New-SCVMHost -ComputerName <String> -SMBiosGuid <Guid]> -VMHostProfile <PhysicalComputerProfile> [-BypassADMachineAccountCheck] [-Description <String> ] [-IPAddress <String> ] [-JobVariable <String> ] [-LogicalNetwork <LogicalNetwork> ] [-ManagementAdapterMACAddress <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-Subnet <String> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: LegacyUseBMCPowerControl
New-SCVMHost -BMCAddress <String> -BMCProtocol <OutOfBandManagementType]> -BMCRunAsAccount <RunAsAccount> -ComputerName <String> -SMBiosGuid <Guid]> -VMHostProfile <PhysicalComputerProfile> [-BMCCustomConfigurationProvider <ConfigurationProvider> ] [-BMCPort <UInt32]> ] [-BypassADMachineAccountCheck] [-Description <String> ] [-IPAddress <String> ] [-JobVariable <String> ] [-LogicalNetwork <LogicalNetwork> ] [-ManagementAdapterMACAddress <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-Subnet <String> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: UseHostConfig
New-SCVMHost -VMHostConfig <PhysicalComputerConfig> [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The New-SCVMHost cmdlet creates a Virtual Machine Manager (VMM) host from a physical computer by using the properties defined in a host profile. The physical computer must have an out-of-band controller.

Before you create a host, ensure that a PXE server has been added to VMM, a host profile has been created, and any needed driver files have been added to the library.

The PXE server you add to VMM must be in the same subnet as the physical computers that you want to convert to managed Hyper-V hosts.

For more information about the types of hosts supported by VMM, type Get-Help Add-SCVMHost -detailed.

Parameters

-BMCAddress<String>

Specifies, or updates, the out-of-band baseboard management controller (BMC) address for a specific physical machine. A BMC is also known as a service processor or management controller. A BMC address can be an IP address, the fully qualified domain name (FQDN), or the DNS prefix, which is usually the same name as the NetBIOS name,.

Typically, the BMC address and its connection to the network are separate from the IP address associated with a standard network adapter. Alternatively, some computers do use a standard network adapter to provide a single address for the BMC and for the network adapter. However, the BMC address has a unique port and is thus uniquely identifiable on the network.

-- IPv4 format: 10.0.0.21
-- Ipv6 format: 2001:4898:2a:3:657b:9c7a:e1f0:6829
-- FQDN format: Computer01.Contoso.com
-- NetBIOS format: Computer01

By default, VMM uses an IP address or FQDN for the BMC address. However, it is also possible to create a Windows PowerShell module that enables you to specify other types of addresses as the BMC address.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BMCCustomConfigurationProvider<ConfigurationProvider>

Specifies, or updates, a configuration provider object for a BMC. A configuration provider is a plug-in to VMM that translates VMM Windows PowerShell commands to API calls that are specific to a type of BMC. To use this parameter, specify a value of Custom for the BMCProtocol parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BMCPort<UInt32]>

Specifies, or updates, the out-of-band BMC port for a specific physical machine. A BMC port is also known as a service processor port. Example default ports are 623 for IPMI and 443 for SMASH over WS-Man.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BMCProtocol<OutOfBandManagementType]>

Specifies, or updates, the protocol that VMM uses to communicate with the out-of-band BMC. Valid values are:

-- IPMI
-- SMASH
-- Custom

A BMC is a specialized controller on the motherboard of a server that acts an interface between the hardware and system management software. If the motherboard of a physical machine includes a BMC, when the machine is plugged in, whether it is powered off or powered on, and whether or not an operating system is installed, information about system hardware and the state of that system hardware health is available.

The Custom protocol requires you to specify the BMCCustomConfigurationProvider parameter.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BMCRunAsAccount<RunAsAccount>

Specifies the Run As account to use with the BMC device.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BypassADMachineAccountCheck

Indicates that New-SCVMhost reuses a computer account that already exists in Active Directory. By default, New-SCVMHost checks Active Directory for an existing account with the specified name to prevent overwriting computer accounts.

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
-- NetBIOS name

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

Specifies a description for the host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPAddress<String>

Specifies an IPv4 or IPv6 address.

Aliases

none

Required?

false

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

-LogicalNetwork<LogicalNetwork>

Specifies a logical network. A logical network is a named grouping of IP subnets and VLANs that is used to organize and simplify network assignments.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ManagementAdapterMACAddress<String>

Specifies the MAC address of the physical network adapter on the computer that is to be used by the VMM server to communicate with this host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

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

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

-SMBiosGuid<Guid]>

Specifies the System Management BIOS globally unique identifier (SMBIOS GUID) for a physical computer that is associated with a record for that physical computer in VMM. SMBIOS defines data structures and access methods that enable a user or application to store and retrieve information about hardware on this computer, such as the name of the system, manufacturer, or the system BIOS version. Windows operating systems retrieve SMBIOS data at system startup and make that data available to programs.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Subnet<String>

Specifies an IP subnet (IPv4 or IPv6) in Classless Inter-Domain Routing (CIDR) notation.

An IP subnet cannot overlap with any other subnet in a host group or child host groups.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHostConfig<PhysicalComputerConfig>

Specifies a host configuration object.

For information about host configuration objects, see the New-SCVMHostConfig cmdlet.

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

-VMHostProfile<PhysicalComputerProfile>

Specifies a virtual machine host profile object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).

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

Notes

  • This cmdlet requires a host profile object. To obtain one, use the Get-SCVMHostProfile cmdlet.

Examples

Example 1: Create a host from a physical computer by using a DHCP-based host profile

The first command gets the Run As account object named BMCRunAsAcct, and then stores the object in the $BMCRAA variable.

The second command discovers the physical computer with the IP address of 10.10.0.1 using the Run As account supplied in $BMCRAA. It then stores the physical computer object in the $NewPhysicalComputer variable.

The third command gets the host group object named HostGroup01, and then stores the object in the $HostGroup variable.

The fourth command gets the host profile object named HostProfile01, and stores the object in the $HostProfile variable. HostProfile01 is configured to obtain an IP address through the DHCP service.

The last command creates a host from the physical computer stored in $NewPhysicalComputer using the host profile stored in $HostProfile, and gives it the name NewHost01.

PS C:\> $BMCRAA = Get-SCRunAsAccount -Name "BMCRunAsAcct"
PS C:\> $NewPhysicalComputer = Find-SCComputer -BMCAddress "10.10.0.1" -BMCRunAsAccount $BMCRAA -BMCProtocol "IPMI"
PS C:\> $HostGroup = Get-SCVMHostGroup -Name "HostGroup01"
PS C:\> $HostProfile = Get-SCVMHostProfile -Name "HostProfile01"
PS C:\> New-SCVMHost -VMHostGroup $HostGroup -VMHostProfile $HostProfile -ComputerName "NewHost01" -BMCAddress $NewPhysicalComputer.BMCAddress -BMCRunAsAccount $BMCRAA -BMCProtocol "IPMI" -SMBIOSGUID $NewPhysicalComputer.SMBIOSGUID -ManagementAdapterMACAddress "00-1D-D8-B7-1C-00" -LogicalNetwork "LogicalNetwork01" -Subnet "192.168.0.1/24" -IPAddress "192.168.0.91" 

Example 2: Create a host from a physical computer by using a static IP-based host profile

The first command gets the Run As account object named BMCRunAsAccount, and then stores the object in the $BMCRAA variable.

The second command discovers the computer with the address 10.10.0.1, using the Run As account stored in $BMCRAA, and then stores the computer in the $NewPhysicalComputer variable.

The third command gets the host group object named HostGroup01, and then stores the object in the $HostGroup variable.

The fourth command gets the host profile object named HostProfile02, and then stores the object in the $HostProfile variable. HostProfile02 is configured to allocate a static IP address.

The last command creates a host from the physical computer stored in $NewPhysicalComputer using the host profile stored in $HostProfile, gives it the name NewHost02, and configures the MAC address, IPAddress, and subnet.

PS C:\> $BMCRAA = Get-SCRunAsAccount -Name "BMCRunAsAcct"
PS C:\> $NewPhysicalComputer = Find-SCComputer -BMCAddress "10.10.0.1" -BMCRunAsAccount $BMCRAA -BMCProtocol "IPMI"
PS C:\> $HostGroup = Get-SCVMHostGroup -Name "HostGroup01"
PS C:\> $HostProfile = Get-SCVMHostProfile -Name "HostProfile02"
PS C:\> New-SCVMHost -VMHostGroup $HostGroup -VMHostProfile $HostProfile -BMCAddress $NewPhysicalComputer.BMCAddress -BMCRunAsAccount $BMCRAA -BMCProtocol "IPMI" -SMBIOSGUID $NewPhysicalComputer.SMBIOSGUID -ComputerName "NewHost02" -ManagementAdapterMACAddress "00-18-8B-0A-4D-76" -LogicalNetwork "LogicalNetwork01" -Subnet "192.168.1.1/24" -IPAddress "192.168.1.101" 

Example 3: Redeploy an existing host with a new host profile.

The first command gets the Run As account object named BMCRunAsAccount, and then stores the object in the $BMCRaa variable.

The next eight commands save properties from the host that you are going to redeploy.

The tenth command removes the old host from VMM.

The eleventh command gets the host group object named New HostGroup01, and then stores the object in the $NewHostGroup variable.

The twelfth command gets the host profile object named HostProfile02, and then stores the object in the $NewHostProfile variable.

The last command redeploys the old host using the previous settings that identify the host, but to a new host group, stored in $NewHostGroup, and with updated profile settings, stored in $NewHostProfile.

PS C:\> $BMCRaa = Get-SCRunAsAccount -Name "BMCRunAsAcct"
PS C:\> $OldHost = Get-SCVMHost "NewHost02"
PS C:\> $OldBMCIP = $OldHost.physicalmachine.BMCAddress
PS C:\> $OldBMCProtocol = $OldHost.physicalmachine.BMCType
PS C:\> $OldComputer = Find-SCComputer -BMCAddress $OldBMCIP -BMCRunAsAccount $BMCRAA -BMCProtocol $OldBMCProtocol
PS C:\> $OldGuid = $OldComputer.SMBIOSGUID
PS C:\> $OldAdapter = Get-SCVMHostNetworkAdapter -VMHost $OldHost
PS C:\> $OldMAC = $OldAdapter[0].macaddress
PS C:\> $OldRAA = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> Remove-SCVMHost $OldHost -Credential $OldRAA
PS C:\> $NewHostGroup = Get-SCVMHostGroup -Name "HostGroup01"
PS C:\> $NewHostProfile = Get-SCVMHostProfile -Name "HostProfile02"
PS C:\> New-SCVMHost -VMHostGroup $NewHostGroup -VMHostProfile $NewHostProfile  -BMCAddress $OldBMCIP -BMCRunAsAccount $BMcRAA -BMCProtocol $OldBMCProtocol -SMBIOSGUID $OldGUID -ManagementAdapterMACAddress $OldMAC -ComputerName "Computer01" -LogicalNetwork "LogicalNetwork01" -Subnet "192.168.0.1/24" -IPAddress "192.168.0.93" 

Add-SCVMHost

Disable-SCVMHost

Enable-SCVMHost

Get-SCVMHost

Move-SCVMHost

Read-SCVMHost

Register-SCVMHost

Remove-SCVMHost

Repair-SCVMHost

Restart-SCVMHost

Set-SCVMHost

Start-SCVMHost

Stop-SCVMHost

New-SCVMHostConfig

Get-SCRunAsAccount

Get-SCVMHostGroup

Get-SCVMHostNetworkAdapter

Get-SCVMHostProfile