0
我希望能夠使用Powershell和自定義映像創建新的Azure虛擬機。這個自定義圖像是在Azure存儲帳戶X和新的虛擬機將使用Azure存儲帳戶Y.創建當我運行以下命令來創建新的虛擬機:從Powershell中的映像創建Azure中的Linux虛擬機
Set-AzureSubscription -CurrentStorageAccount $StorageAccount -SubscriptionName $SubscriptionName
New-AzureVMConfig -Name $MachineName -InstanceSize $InstanceSize -ImageName $Image |
Add-AzureProvisioningConfig -Linux -LinuxUser $LinuxUser -Password $AdminPassword |
Set-AzureSubnet $subNet |
New-AzureVM -ServiceName $MachineName -VNetName $VNet -ErrorVariable errs
其中$圖片是在自定義圖像存儲帳戶X和CurrentStorageAccount設置爲Y認購,我得到以下錯誤:
The disk's VHD must be in the same account as the VHD of the source image
如果自定義圖像是存儲帳戶Ÿ正確地創建新的虛擬機工作的命令。
當映像位於不同的存儲帳戶時,是否可以創建Azure虛擬機?
我希望情況並非如此。 –