这篇文章已经过机器翻译.放弃
用于 Azure 部署的其他 PowerShell 脚本
本部分内容提供了一些 PowerShell cmdlet,可以使用这些 cmdlet 在 Azure PowerShell 中执行以下配置:
- 配置 Citrix ADC VPX 独立实例
- 使用 Azure 外部负载均衡器在高可用性设置中配置 Citrix ADC VPX 对
- 使用 Azure 内部负载均衡器在高可用性设置中配置 Citrix ADC VPX 对
另请参阅以下主题,了解您可以使用 PowerShell 命令执行的配置:
- 使用 PowerShell 命令配置具有多个 IP 地址和 NIC 的高可用性设置
- 在 Citrix ADC VPX 实例上配置 GSLB
- 在 NetScaler 主动-备用高可用性设置中配置 GSLB
- 使用 PowerShell 命令在独立模式下为 Citrix ADC VPX 实例配置多个 IP 地址
配置 Citrix ADC VPX 独立实例
-
创建资源组
资源组可以包括解决方案的所有资源,也可以仅包括要作为一个组管理的资源。 此处指定的位置是该资源组中的资源的默认位置。 请确保用于创建负载均衡器的所有命令均使用同一资源组。
$rgName="\<resource group name\>" $locName="\<location name, such as West US\>" New-AzureRmResourceGroup -Name $rgName -Location $locName
例如:
$rgName = "ARM-VPX" $locName = "West US" New-AzureRmResourceGroup -Name $rgName -Location $locName
-
创建存储帐户
为您的存储帐户选择仅包含小写字母和数字的唯一名称。
$saName="\<storage account name\>" $saType="\<storage account type, specify one: Standard\_LRS, Standard\_GRS, Standard\_RAGRS, or Premium\_LRS\>" New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -Type $saType -Location $locName
例如:
$saName="vpxstorage" $saType="Standard\_LRS" New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -Type $saType -Location $locName
-
创建可用性集
可用性集可帮助使您的虚拟机在停机期间(例如,在维护期间)保持可用。 配置了可用性集的负载均衡器可确保您的应用程序始终可用。
$avName="\<availability set name\>" New-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName -Location $locName
-
创建虚拟网络
如果以前未创建子网,请添加一个至少包含一个子网的新虚拟网络。
$FrontendAddressPrefix="10.0.1.0/24" $BackendAddressPrefix="10.0.2.0/24" $vnetAddressPrefix="10.0.0.0/16" $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix $FrontendAddressPrefix $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix $BackendAddressPrefix New-AzureRmVirtualNetwork -Name TestNet -ResourceGroupName $rgName -Location $locName -AddressPrefix $vnetAddressPrefix -Subnet $frontendSubnet,$backendSubnet
例如:
$frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix $FrontendAddressPrefix $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix $BackendAddressPrefix New-AzureRmVirtualNetwork -Name TestNet -ResourceGroupName $rgName -Location $locName -AddressPrefix $vnetAddressPrefix -Subnet $frontendSubnet,$backendSubnet
-
创建 NIC
创建 NIC 并将 NIC 与 Citrix ADC VPX 实例相关联。 上述过程中创建的前端子网索引编号为 0,后端子网索引编号为 1。 现在采用以下三种方式之一创建 NIC:
-
具有公共 IP 地址的 NIC
``` $nicName=”<name of the NIC of the VM>”
$pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -Location $locName -AllocationMethod Dynamic
$nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[$subnetIndex].Id -PublicIpAddressId $pip.Id
- NIC with Public IP and DNS label
$nicName="\<VM 的 NIC 名称\>" $domName="\<域名标签\>" $pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -DomainNameLabel $domName -Location $locName -AllocationMethod 动态
Before assigning `$domName`, check it is available or not by using command:
Test-AzureRmDnsAvailability -DomainQualifiedName $domName -Location $locName $nic = New-AzureRmNetworkInterface -名称 $nicName -ResourceGroupName $rgName -位置 $locName -SubnetId $vnet.Subnets\[$subnetIndex\].Id -PublicIpAddressId $pip.Id
For example:
$nicName="frontendNIC" $domName="vpxazure" $pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -DomainNameLabel $domName -Location $locName -AllocationMethod Dynamic $nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets\[0\].Id -PublicIpAddressId $pip.Id
-
NIC with Dynamic Public Address and Static Private IP address*
Make sure that the private (static) IP address you add to the VM should be the same range as that of the subnet specified.
$nicName="\<VM 的 NIC 名称\>" $staticIP="\<子网上可用的静态 IP 地址\>" $pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -Location $locName -AllocationMethod 动态 $nic = New-AzureRmNetworkInterface -名称 $nicName -ResourceGroupName $rgName -位置 $locName -SubnetId $vnet.Subnets\[$subnetIndex\].Id -PublicIpAddressId $pip.Id -PrivateIpAddress $staticIP
-
-
Create a virtual object
$vmName=”<VM name>”
$vmSize=”<VM size string>”
$avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName
$vm=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id
- Get the Citrix ADC VPX image
$pubName=”<Image publisher name>”
$offerName=”<Image offer name>”
$skuName=”<Image SKU name>”
$cred=Get-Credential -Message “Type the name and password of the local administrator account.”
Provide your credentials that is used to login into VPX
$vm=Set-AzureRmVMOperatingSystem -VM $vm -Linux -ComputerName $vmName -Credential $cred -Verbose
$vm=Set-AzureRmVMSourceImage -VM $vm -PublisherName $pubName -Offer $offerName -Skus $skuName -Version “latest”
$vm=Add-AzureRmVMNetworkInterface -VM $vm -Id $nic.Id
For example:
$pubName="citrix"
The following command is used for displaying all offers from Citrix:
Get-AzureRMVMImageOffer -Location \$locName -Publisher \$pubName | 选择优惠
$offerName="netscalervpx110-6531"
The following command is used to know sku offered by publisher for specific offer name:
Get-AzureRMVMImageSku -Location $locName -Publisher $pubName -Offer $offerName | Select Skus |
- Create a virtual machine
$diskName=”<name identifier for the disk in Azure storage, such as OSDisk>”
For example:
$diskName="动态"
$pubName="citrix"
$offerName="netscalervpx110-6531"
$skuName="netscalerbyol"
$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName
$osDiskUri=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds/" + $diskName+ ".vhd"
$vm=Set-AzureRmVMOSDisk -VM $vm -Name $diskName -VhdUri $osDiskUri -CreateOption fromImage
When you create VM from Images present in marketplace, use the following command to specify the VM plan:
Set-AzureRmVMPlan -VM $vm -Publisher $pubName -Product $offerName -Name $skuName
New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm
Provision a Citrix ADC VPX pair in a high availabilty setup with an Azure external load balancer
Log on to AzureRmAccount using your Azure user credentials.
1) Create a resource group
The location specified here is the default location for resources in that resource group. Make sure that all commands used to create a load balancer use the same resource group.
$rgName=”<resource group name>”
$locName=”<location name, such as West US>”
New-AzureRmResourceGroup -Name $rgName -Location $locName
For example:
$rgName = “ARM-LB-NS”
$locName = “美国西部”
New-AzureRmResourceGroup -名称 $rgName -位置 $locName
2) Create a storage account
Choose a unique name for your storage account that contains only lowercase letters and numbers.
$saName=”<storage account name>”
$saType=”<storage account type, specify one: Standard_LRS, Standard_GRS, Standard_RAGRS, or Premium_LRS>”
New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -Type $saType -Location $locName
For example:
$saName="vpxstorage"
$saType="标准\_LRS"
New-AzureRmStorageAccount -名称 $saName -资源组名称 $rgName -类型 $saType -位置 $locName
3) Create an availability set
A load balancer configured with an availability set ensures that your application is always available.
$avName=”<availability set name>”
New-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName -Location $locName
4) Create a virtual network
Add a new virtual network with at least one subnet, if the subnet was not created previously.
$vnetName = “LBVnet”
$FrontendAddressPrefix="10.0.1.0/24"
$BackendAddressPrefix="10.0.2.0/24"
$vnetAddressPrefix="10.0.0.0/16"
$frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix$FrontendAddressPrefix
$backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix$BackendAddressPrefix
$vnet=New-AzureRmVirtualNetwork -名称 $vnetName -ResourceGroupName $rgName -位置 $locName -AddressPrefix $vnetAddressPrefix-子网 $frontendSubnet,$backendSubnet
Note:
Choose the AddressPrefix parameter value as per your requirement.
Assign front end and back end subnet to the virtual network that you created earlier in this step.
If the front end subnet is the first element of array vnet, subnetId should be $vnet.Subnets[0].Id.
If the front end subnet is the second element in the array, the subnetId should be $vnet.Subnets[1].Id, and so on..
5) Configure front end IP address and create back end address pool
Configure a front end IP address for the incoming load balancer network traffic and create a back end address pool to receive the load balanced traffic.
$pubName="公共IP1"
$publicIP1 = New-AzureRmPublicIpAddress -名称 $pubName-ResourceGroupName $rgName -位置 $locName -AllocationMethod 静态 -DomainNameLabel nsvpx
Note: Check for the availability of the value for DomainNameLabel.
$FIPName = “ELBFIP”
$frontendIP1 = New-AzureRmLoadBalancerFrontendIpConfig -名称 $FIPName -PublicIpAddress $publicIP1
$BEPool = "LB-后端池"
$beaddresspool1= New-AzureRmLoadBalancerBackendAddressPoolConfig -名称 $BEPool
8) Create a health probe
Create a TCP health probe with port 9000 and interval 5 seconds.
$healthProbe = New-AzureRmLoadBalancerProbeConfig -名称 HealthProbe -协议 Tcp -端口 9000 -IntervalInSeconds 5 -ProbeCount 2
9) Create a load balancing rule
Create a LB rule for each service that you are load balancing.
For example:
You can use the following example to load balance http service.
$lbrule1 = New-AzureRmLoadBalancerRuleConfig -名称“HTTP-LB” -FrontendIpConfiguration $frontendIP1 -BackendAddressPool $beAddressPool1 -Probe $healthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80
10) Create inbound NAT rules
Create NAT rules for services that you are not load balancing.
For example, when creating a SSH access to a Citrix ADC VPX instance.
Note: Protocol-FrontEndPort-BackendPort triplet should not be the same for two NAT rules.
$inboundNATRule1= New-AzureRmLoadBalancerInboundNatRuleConfig -名称 SSH1 -FrontendIpConfiguration $frontendIP1 -协议 TCP -FrontendPort 22 -BackendPort 22
$inboundNATRule2= New-AzureRmLoadBalancerInboundNatRuleConfig -名称 SSH2 -FrontendIpConfiguration $frontendIP1 -协议 TCP -FrontendPort 10022 -BackendPort 22
11) Create a load balancer entity
Create the load balancer adding all objects (NAT rules, load balancer rules, probe configurations) together.
$lbName="ELB"
$NRPLB = New-AzureRmLoadBalancer -ResourceGroupName $rgName -Name $lbName -Location $locName -InboundNatRule $inboundNATRule1, $inboundNATRule2 -FrontendIpConfiguration $frontendIP1 -LoadBalancingRule $lbrule1 -BackendAddressPool $beAddressPool1 -Probe $healthProbe
12) Create a NIC
Create two NICs and associate each NIC with each VPX instance
a) NIC1 with VPX1
For example:
$nicName="NIC1"
$lbName="ELB"
$bePoolIndex=0
\* 规则索引从 0 开始。
$natRuleIndex=0
$subnetIndex=0
\* 前端子网索引
$lb=Get-AzureRmLoadBalancer -Name $lbName -ResourceGroupName $rgName
$nic1=New-AzureRmNetworkInterface -名称 $nicName -ResourceGroupName $rgName -位置 $locName -子网 $vnet.Subnets\[$subnetIndex\] -LoadBalancerBackendAddressPool $lb.BackendAddressPools\[$bePoolIndex\] -LoadBalancerInboundNatRule $lb.InboundNatRules\[$natRuleIndex\]
b) NIC2 with VPX2
For example:
$nicName="NIC2"
$lbName="ELB"
$bePoolIndex=0
$natRuleIndex=1
* Second Inbound NAT (SSH) rule we need to use
$subnetIndex=0
* Frontend subnet index
$lb=Get-AzureRmLoadBalancer -Name $lbName -ResourceGroupName $rgName
$nic2=New-AzureRmNetworkInterface -名称 $nicName -ResourceGroupName $rgName -位置 $locName -子网 $vnet.Subnets\[$subnetIndex\] -LoadBalancerBackendAddressPool $lb.BackendAddressPools\[$bePoolIndex\] -LoadBalancerInboundNatRule$lb.InboundNatRules\[$natRuleIndex\]
13) Create Citrix ADC VPX instances
Create two Citrix ADC VPX instances as part of the same resource group and availability set, and attach it to the external load balancer.
a) Citrix ADC VPX instance 1
For example:
$vmName="VPX1"
$vmSize="标准\_A3"
$pubName="citrix"
$offerName="netscalervpx110-6531"
$skuName="netscalerbyol"
$avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName
$vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id
$cred=Get-Credential -Message “输入用于登录 VPX 实例的凭证”
$vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName -Credential $cred -Verbose
$vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version “最新”
$vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $nic1.Id
$diskName="动态"
$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName
$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds1/" + $diskName+ ".vhd"
$vm1=Set-AzureRmVMOSDisk -VM $vm1 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage
Set-AzureRmVMPlan -VM $vm1 -发布者 $pubName -产品 $offerName -名称 $skuName
New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm1
b) Citrix ADC VPX instance 2
For example:
$vmName="VPX2"
$vmSize="标准\_A3"
$avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName
$vm2=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id
$cred=Get-Credential -Message “输入用于登录 VPX 实例的凭证”
$vm2=Set-AzureRmVMOperatingSystem -VM $vm2 -Linux -ComputerName $vmName -Credential $cred -Verbose
$vm2=Set-AzureRmVMSourceImage -VM $vm2 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version “最新”
$vm2=Add-AzureRmVMNetworkInterface -VM $vm2 -Id $nic2.Id
$diskName="动态"
$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName
$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds2/" + $diskName+ ".vhd"
$vm2=Set-AzureRmVMOSDisk -VM $vm2 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage
Set-AzureRmVMPlan -VM $vm2 -发布者 $pubName -产品 $offerName -名称 $skuName
New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm2
14) Configure the virtual machines
When both the Citrix ADC VPX instances start, then connect to both Citrix ADC VPX instances using the SSH protocol to configure the virtual machines.
a) Active-Active: Run the same set of configuration commands on the command line of both the Citrix ADC VPX instances.
b) Active-Passive: Run this command on the command line of both the Citrix ADC VPX instances.
add ha node #nodeID <nsip of other Citrix ADC VPX>
In Active-Passive mode, run configuration commands on the primary node only.
Provision a Citrix ADC VPX pair in a high availability setup with Azure internal load balancer
Log on to AzureRmAccount using your Azure user credentials.
1) Create a resource group
The location specified here is the default location for resources in that resource group. Make sure all commands to create a load balancer use the same resource group.
$rgName=”<resource group name>”
$locName=”<location name, such as West US>”
New-AzureRmResourceGroup -Name $rgName -Location $locName
For example:
$rgName = “ARM-LB-NS”
$locName = “美国西部”
New-AzureRmResourceGroup -名称 $rgName -位置 $locName
2) Create a storage account
Choose a unique name for your storage account that contains only lowercase letters and numbers.
$saName=”<storage account name>”
$saType=”<storage account type, specify one: Standard_LRS, Standard_GRS, Standard_RAGRS, or Premium_LRS>”
New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -Type $saType -Location $locName
For example:
$saName="vpxstorage"
$saType="标准\_LRS"
New-AzureRmStorageAccount -名称 $saName -资源组名称 $rgName -类型 $saType -位置 $locName
3) Create an availability set
A load balancer configured with an availability set ensures that your application is always available..
$avName=”<availability set name>”
New-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName -Location $locName
4) Create a virtual network
Add a new virtual network with at least one subnet, if the subnet was not created previously.
$vnetName = “LBVnet”
$vnetAddressPrefix="10.0.0.0/16"
$FrontendAddressPrefix="10.0.1.0/24"
$BackendAddressPrefix="10.0.2.0/24"
$vnet=New-AzureRmVirtualNetwork -名称 $vnetName -ResourceGroupName $rgName -位置 $locName -AddressPrefix $vnetAddressPrefix-子网 $frontendSubnet,$backendSubnet\`
$frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix$FrontendAddressPrefix
$backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix$BackendAddressPrefix
Note: Choose the AddressPrefix parameter value as per your requirement.
Assign front end and back end subnet to the virtual network that you created earlier in this step.
If the front end subnet is the first element of array vnet, subnetId should be $vnet.Subnets[0].Id.
If the front end subnet is the second element in the array, the subnetId should be $vnet.Subnets[1].Id, and so on..
5) Create an back end address pool
$beaddresspool= New-AzureRmLoadBalancerBackendAddressPoolConfig -Name“LB-backend”
6) Create NAT rules
Create NAT rules for services that you are not load balancing.
$inboundNATRule1= New-AzureRmLoadBalancerInboundNatRuleConfig -名称“Inboundnatrule1”-FrontendIpConfiguration $frontendIP -协议 TCP -FrontendPort 3441 -BackendPort 3389
$inboundNATRule2= New-AzureRmLoadBalancerInboundNatRuleConfig -名称“RDP2” -FrontendIpConfiguration $frontendIP -协议 TCP -FrontendPort 3442 -BackendPort 3389
Use front end and back end ports as per your requirement.
7) Create a health probe
Create a TCP health probe with port 9000 and interval 5 seconds.
$healthProbe = New-AzureRmLoadBalancerProbeConfig -名称“HealthProbe”“-协议 tcp -端口 9000 -IntervalInSeconds 5 -ProbeCount 2
8) Create a load balancing rule
Create a LB rule for each service that you are load balancing.
For example:
You can use the following example to load balance http service.
$lbrule = New-AzureRmLoadBalancerRuleConfig -名称“lbrule1”-FrontendIpConfiguration $frontendIP -BackendAddressPool $beAddressPool -Probe $healthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80
Use front end and back end ports as per your requirement.
9) Create a load balancer entity
Create the load balancer adding all objects (NAT rules, load balancer rules, probe configurations) together.
$NRPLB = New-AzureRmLoadBalancer -ResourceGroupName $rgname -Name "InternalLB" -Location $locName -FrontendIpConfiguration $frontendIP -InboundNatRule $inboundNATRule1,$inboundNatRule2 -LoadBalancingRule $lbrule -BackendAddressPool $beAddressPool -Probe $healthProbe
10) Create a NIC
Create two NICs and associate each NIC with each Citrix ADC VPX instance
$backendnic1= New-AzureRmNetworkInterface -ResourceGroupName $rgName -Name lb-nic1-be -Location $locName -PrivateIpAddress 10.0.2.6 -Subnet $backendSubnet -LoadBalancerBackendAddressPool $nrplb.BackendAddressPools\[0\] -LoadBalancerInboundNatRule $nrplb.InboundNatRules\[0\]
This NIC is for Citrix ADC VPX 1. The Private IP should be in same subnet as that of subnet added.
$backendnic2= New-AzureRmNetworkInterface -ResourceGroupName $rgName-Name lb-nic2-be -Location $locName-PrivateIpAddress 10.0.2.7 -Subnet $backendSubnet -LoadBalancerBackendAddressPool $nrplb.BackendAddressPools\[0\] -LoadBalancerInboundNatRule $nrplb.InboundNatRules\[1\].
This NIC is for Citrix ADC VPX 2.The parameter Private IPAddress can have any private IP as per your requirement.
11) Create Citrix ADC VPX instances
Create two VPX instances part of same resource group and availability set and attach it to the internal load balancer.
a) Citrix ADC VPX instance 1
For example:
$vmName="VPX1"
$vmSize="标准\_A3"
$avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName
$vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id
$cred=Get-Credential -Message “输入用于登录 VPX 实例的凭证”
$vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName -Credential $cred -Verbose
$vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version “最新”
$vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $backendnic1.Id
$diskName="动态"
$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName
$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds1/" + $diskName + ".vhd"
$vm1=Set-AzureRmVMOSDisk -VM $vm1 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage
Set-AzureRmVMPlan -VM $vm1 -发布者 $pubName -产品 $offerName -名称 $skuName
New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm1
b) Citrix ADC VPX instance 2
For example:
$vmName="VPX2"
$vmSize="标准\_A3"
$avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName $rgName
$vm2=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id
$cred=Get-Credential -Message “输入用于登录 VPX 实例的凭证”
$vm2=Set-AzureRmVMOperatingSystem -VM $vm2 -Linux -ComputerName $vmName -Credential $cred -Verbose
$vm2=Set-AzureRmVMSourceImage -VM $vm2 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version “最新”
$vm2=Add-AzureRmVMNetworkInterface -VM $vm2 -Id $backendnic2.Id
$diskName="动态"
$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName
$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds2/" + $diskName + ".vhd"
$vm2=Set-AzureRmVMOSDisk -VM $vm2 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage
Set-AzureRmVMPlan -VM $vm2 -发布者 $pubName -产品 $offerName -名称 $skuName
New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm2 ```
12\)**配置虚拟机**
两个 Citrix ADC VPX 实例启动后,使用 SSH 协议连接到这两个 Citrix ADC VPX 实例以配置虚拟机。
a) 主动-主动:在两个 Citrix ADC VPX 实例的命令行上运行同一组配置命令。
b) 主动-被动:在两个 Citrix ADC VPX 实例的命令行上运行此命令。
添加其他 Citrix ADC VPX 的 ha 节点 \#nodeID \<nsip\>
在主动-被动模式下,仅在主节点上运行配置命令。