2017-04-05 92 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地址。

相關問題