New-SCVMHostNetworkAdapterProfile
创建主机网络适配器配置文件。
语法
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsGenericNIC]
[-ConsistentDeviceName <String>]
[-UseDhcpForIPConfiguration]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsManagementNIC]
[-ConsistentDeviceName <String>]
[-UseDhcpForIPConfiguration]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsGenericNIC]
[-ConsistentDeviceName <String>]
[-UseStaticIPForIPConfiguration]
-LogicalNetwork <LogicalNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-ConsistentDeviceName <String>]
-LogicalSwitch <LogicalSwitch>
-UplinkPortProfileSet <UplinkPortProfileSet>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsManagementNIC]
[-ConsistentDeviceName <String>]
[-UseStaticIPForIPConfiguration]
-LogicalNetwork <LogicalNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsManagementNIC]
-TransientManagementNetworkAdapter <PhysicalComputerNetworkAdapterProfile>
[-UseStaticIPForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsGenericNIC]
[-UseDhcpForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsGenericNIC]
[-UseStaticIPForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsManagementNIC]
-TransientManagementNetworkAdapter <PhysicalComputerNetworkAdapterProfile>
[-UseDhcpForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
说明
New-SCVMHostNetworkAdapterProfile cmdlet 创建网络适配器配置文件。
请注意,创建网络适配器配置文件后,无法更新它。 若要更改网络适配器配置文件,必须删除网络适配器配置文件,然后重新创建它。
示例
示例 1:使用 DHCP 创建通用物理主机网络适配器配置文件
PS C:\> New-SCVMHostNetworkAdapterProfile -SetAsPhysicalNetworkAdapter -SetAsGenericNIC -UseDhcpForIPConfiguration -ConsistentDeviceName "Physical host network adapter profile 01"
此命令创建物理主机网络适配器配置文件。
此命令中使用的交换机指示这是一个物理网络适配器,并且网络适配器不是主机的管理网络适配器。 此外,DHCP 用于获取网络适配器的 IP 地址。
示例 2:使用逻辑交换机创建物理网络适配器配置文件
PS C:\> $LogSwitch = Get-SCLogicalSwitch -Name "LogicalSwitch01"
PS C:\> $UplinkPortProfSet = Get-SCUplinkPortProfileSet -Name "UplinkPortProfileSet01"
PS C:\> New-SCVMHostNetworkAdapterProfile -SetAsPhysicalNetworkAdapter -LogicalSwitch $LogSwitch -UplinkPortProfileSet $UplinkPortProfSet -ConsistentDeviceName "Physical host network adapter profile 02"
第一个命令获取名为 LogicalSwitch01 的逻辑交换机对象,并将对象存储在$LogSwitch变量中。
第二个命令获取名为 UplinkPortProfileSet01 的上行端口配置文件集对象,并将对象存储在$UplinkPortProfSet变量中。
最后一个命令使用 LogicalSwitch01 和 UplinkPortProfileSet01 创建物理主机网络适配器配置文件。
示例 3:使用静态 IP 地址创建管理虚拟主机网络适配器配置文件
PS C:\> $TransMgmtNIC = Get-SCVMHostNetworkAdapterProfile -ID "259f47c7-c5a9-429d-a421-d232f9b34991"
PS C:\> $LogSwitch = Get-SCLogicalSwitch -Name "LogicalSwitch01"
PS C:\> $VMNetwork = Get-SCVMNetwork -Name "VMNetwork01"
PS C:\> New-SCVMHostNetworkAdapterProfile -SetAsVirtualNetworkAdapter -SetAsManagementNIC -TransientManagementNetworkAdapter $TransMgmtNIC -UseStaticIPForIPConfiguration -LogicalSwitch $LogSwitch -VMNetwork $VMNetwork
第一个命令获取 ID 为 259f47c7-c5a9-429d-a421-d232f9b34991 的主机网络适配器配置文件对象,并将对象存储在$TransMgmtNIC变量中。
第二个命令获取名为 LogicalSwitch01 的逻辑交换机对象,并将对象存储在$LogSwitch变量中。
第三个命令获取名为 VMNetwork01 的 VM 网络对象,并将对象存储在$VMNetwork变量中。
最后一个命令使用 LogicalSwitch01 和 VMNetwork01 创建虚拟主机网络适配器 prfile 作为管理网络适配器。
参数
-ConsistentDeviceName
指定网络适配器的一致设备名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LogicalNetwork
指定逻辑网络。 逻辑网络是 IP 子网和 VLAN 的命名分组,用于组织和简化网络分配。
Type: | LogicalNetwork |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LogicalSwitch
指定逻辑交换机对象。
Type: | LogicalSwitch |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PortClassification
指定虚拟网络适配器连接到的交换机的端口分类。
Type: | PortClassification |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业以异步方式运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsGenericNIC
指示网络适配器不是主机的管理网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsManagementNIC
指示网络适配器是主机的管理网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsPhysicalNetworkAdapter
指示网络适配器是物理网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsVirtualNetworkAdapter
指示网络适配器是虚拟网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TransientManagementNetworkAdapter
指定管理虚拟网络适配器在初始操作系统部署阶段绑定到的物理网络适配器。 在部署主机之前临时使用此属性。
Type: | PhysicalComputerNetworkAdapterProfile |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UplinkPortProfileSet
指定上行端口配置文件集对象。
若要获取上行端口配置文件集对象,请使用 Get-SCUplinkPortProfileSet cmdlet。
Type: | UplinkPortProfileSet |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseDhcpForIPConfiguration
指示使用 DHCP 获取网络适配器的 IP 地址。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseStaticIPForIPConfiguration
指示网络适配器是使用静态 IP 地址配置的。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMNetwork
指定 VM 网络对象。
若要获取 VM 网络对象,请使用 Get-SCVMNetwork cmdlet。
Type: | VMNetwork |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输出
HostNetworkAdapterProfile
此 cmdlet 返回 HostNetworkAdapterProfile 对象。