你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzureStorSimpleNetworkConfig
准备网络配置对象。
注意
本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧 Azure 资源。 创建新的资源时,不建议使用此旧版 PowerShell 模块,因为 ASM 计划停用。 有关详细信息,请参阅 Azure Service Manager 停用。
Az PowerShell 模块是推荐的 PowerShell 模块,用于使用 PowerShell 管理 Azure 资源管理器 (ARM) 资源。
语法
New-AzureStorSimpleNetworkConfig
-InterfaceAlias <String>
[-EnableIscsi <Boolean>]
[-EnableCloud <Boolean>]
[-Controller0IPv4Address <String>]
[-Controller1IPv4Address <String>]
[-IPv6Gateway <String>]
[-IPv4Gateway <String>]
[-IPv4Address <String>]
[-IPv6Prefix <String>]
[-IPv4Netmask <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
说明
New-AzureStorSimpleNetworkConfig cmdlet 准备一个网络配置对象,以传递给 Set-AzureStorSimpleDevice cmdlet。 仅在 Data0 接口上设置 Controller0IPAddress 参数和 Controller1IPAddress 参数。 Data0 仅支持三个设置: Controller0IPAddress、 Controller1IPAdress 和 EnableIscsi。
示例
示例 1:配置 Data0 接口
PS C:\>New-AzureStorSimpleNetworkConfig -InterfaceAlias Data0 -EnableIscsi $True -Controller0IPv4Address "10.67.64.48" -Controller1IPv4Address "10.67.64.49"
VERBOSE: ClientRequestId: 0621d220-a460-48ec-84ec-02a3a82f88b2_PS
IsIscsiEnabled : True
IsCloudEnabled :
Controller0IPv4Address : 10.67.64.48
Controller1IPv4Address : 10.67.64.49
IPv6Gateway :
IPv4Gateway :
IPv4Address :
IPv6Prefix :
IPv4Netmask :
InterfaceAlias : Data0
VERBOSE: Successfully created a StorSimple Network Configuration for interface Data0
此命令为 Data0 接口创建网络配置。 此命令指定 Controller0IPv4Address、 Controller1IPv4Address 和 EnableIscsi 参数。 此 cmdlet 只能为这三个参数配置 Data0。
示例 2:配置 Data0 以外的接口
PS C:\>New-AzureStorSimpleNetworkConfig -InterfaceAlias Data1 -EnableIscsi $True -EnableCloud $True -IPv6Gateway "db8:421e:9a8::a4:1c50" -IPv4Gateway "10.67.64.1" -IPv4Address "10.67.64.48" -IPv6Prefix "2001:db8:a::123/64" -IPv4Netmask "255.255.0.0"
VERBOSE: ClientRequestId: 3a15ff0e-b769-4329-9147-676b1e0acd7d_PS
IsIscsiEnabled : True
IsCloudEnabled : True
Controller0IPv4Address :
Controller1IPv4Address :
IPv6Gateway : db8:421e:9a8::a4:1c50
IPv4Gateway : 10.67.64.1
IPv4Address : 10.67.64.48
IPv6Prefix : 2001:db8:a::123/64
IPv4Netmask : 255.255.0.0
InterfaceAlias : Data1
VERBOSE: Successfully created a StorSimple Network Configuration for interface Data1
此命令配置 Data1 接口。
示例 3:修改设备的配置
PS C:\>$NetworkConfigData0 = New-AzureStorSimpleNetworkConfig -InterfaceAlias Data0 -EnableIscsi $True -Controller0IPv4Address "10.67.64.48" -Controller1IPv4Address "10.67.64.49"
$OnlineDevice = @(Get-AzureStorSimpleDevice | Where { $_.Status -eq "Online"})[0]
$UpdatedDetails = Set-AzureStorSimpleDevice -DeviceId $OnlineDevice.DeviceId -StorSimpleNetworkConfig $NetworkConfigData0
VERBOSE: ClientRequestId: 0f163163-5ad0-4635-a7b5-870d47297f66_PS
VERBOSE: Successfully created a StorSimple Network Configuration for interface Data0
VERBOSE: ClientRequestId: 552e4a6c-7006-4015-a20b-9def6428a85e_PS
VERBOSE: ClientRequestId: f31cc84c-bc8a-404a-9da6-4670a7999e75_PS
VERBOSE: 1 StorSimple device found!
VERBOSE: ClientRequestId: 545bc1a9-3c1b-4e50-89a6-9678aefe79e5_PS
VERBOSE: ClientRequestId: f114ad08-47f5-4fb8-8a01-1ea7f1ed1b98_PS
VERBOSE: About to configure the device : newDeviceName !
VERBOSE: ClientRequestId: 6afe7927-1c19-48d3-ac22-68148fd056b8_PS
VERBOSE: The task created for your Setup operation has completed successfully.
VERBOSE: ClientRequestId: 467c142c-90da-4d75-82a4-c114afce953d_PS
VERBOSE: Successfully updated configuration for device newDeviceName with id 865e68f6-1e71-47b6-80d5-15d3a23bd2b0
第一个命令为 Data0 接口创建网络配置。 此命令指定 Controller0IPv4Address、 Controller1IPv4Address 和 EnableIscsi 参数。 该命令将结果存储在 $NetworkConfigData 0 变量中。
第二个命令使用 Get-AzureStorSimpleDevice cmdlet 和 Where-Object core cmdlet 获取联机 StorSimple 设备,然后将其存储在$OnlineDevice变量中。
最后一个命令使用 Set-AzureStorSimpleDevice cmdlet 修改具有指定设备 ID 的设备的配置。 该命令使用在第一个命令中创建的当前 cmdlet 的配置对象。
参数
-Controller0IPv4Address
指定控制器 0 的 IPv4 地址。 仅为 Data0 接口指定此参数。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Controller1IPv4Address
指定控制器 1 的 IPv4 地址。 仅为 Data0 接口指定此参数。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnableCloud
指示是否启用云启用接口。
类型: | Boolean |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnableIscsi
指示是否为接口启用 Internet SCSI (ISCSI)。
类型: | Boolean |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InterfaceAlias
指定此 cmdlet 为其提供设置的接口的接口别名。 有效值为 Data0 到 Data5。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-IPv4Address
指定接口的 IPv4 地址。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IPv4Gateway
指定网关的 IPv4 地址。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IPv4Netmask
指定接口的 IPv4 netmask。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IPv6Gateway
指定接口的 IPv6 网关。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IPv6Prefix
指定接口的 IPv6 前缀。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Profile
指定 Azure 配置文件。
类型: | AzureSMProfile |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
None
输出
NetworkConfig
此 cmdlet 返回包含以下属性的 NetworkConfig 对象:
- IsIscsiEnabled (布尔值)
- IsCloudEnabled (布尔值)
- Controller0IPv4Address (IPAddress)
- Controller1IPv4Address (IPAddress)
- IPv6Gateway (IPAddress)
- IPv4Gateway (IPAddress)
- IPv4Address (IPAddress)
- IPv6Prefix (字符串)
- IPv4Netmask (IPAddress)
- InterfaceAlias (NetInterfaceId)