2017-04-05 91 views
-1

我有资源组“cbp.resourcegroup.neu”,我的保留IP和虚拟机都在同一个资源组中 我的保留IP名称是CBPIP-Dev-NEU 我的服务名称机VM是testmachine我从作为DNS名“testmachine.northeurope.cloudapp.azure.com”将保留的IP添加到azure上的现有虚拟机上

第一部分当我运行下面的命令来保留的IP添加到VM

Set-AzureReservedIPAssociation -ReservedIPName Group cbp.resourcegroup.neu 
CBPIP-Dev-NEU -ServiceName portrtestmachine 

采取我收到以下错误。

Set-AzureReservedIPAssociation : Cannot validate argument on parameter 
'Slot'. The argument "CBPIP-Dev-NEU" does not belong to the set 
"Staging,Production" specified by the ValidateSet attribute. Supply an 
argument that is in 
the set and then try the command again. 
At line:1 char:76 
+ ... ion -ReservedIPName Group cbp.resourcegroup.neu CBPIP-Dev-NEU -Servic 
... 
+              ~~~~~~~~~~~~~ 
+ CategoryInfo   : InvalidData: (:) [Set-AzureReservedIPAssociation], ParameterBindingValidationException 
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.SetAzureReservedIPAssociationCmdlet 

有什么我在我的命令中失踪。我使用PowerShell来做到这一点。

回答

0
Group cbp.resourcegroup.neu CBPIP-Dev-NEU 

的空间使命令以为你正在使用位置paramters,所以“CBPIP-DEV-NEU”被传递到-Slot参数,这不是一个有效的值。

试试这个

Set-AzureReservedIPAssociation -ReservedIPName "CBPIP-Dev-NEU" -ServiceName "portrtestmachine" 
+0

不,它没有工作。这里是错误。“Set-AzureReservedIPAssociation:ResourceNotFound:未找到任何部署。” –

+0

这只是意味着你给这个命令输入了错误的名字,仔细检查了什么是资源被调用,但是命令是否正确。 – CodedBeard

0

Azure的保留IP只能被分配到一个部署生产实例。

但这没用,导致CloudServices 已经有有静态IP。

我们应该检查云服务,确保没有静态的公网IP地址。

相关问题