我使用以下配置创建VM,该配置指定了-EnableAutoUpdate:
# Create virtual machine
Write-Host "Creating virtual machine '$vmName' in resource group '$resourceGroupName'";
$virtualMachineConfig = New-AzVmConfig -VMName "$vmName" -VMSize "Standard_D2_v3" -IdentityType UserAssigned -IdentityID "$($userAssignedIdentity.Id)" `
| Set-AzVMOperatingSystem -CustomData $encodedScript -Windows -ComputerName "$vmname" -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate `
| Add-AzVMNetworkInterface -Id $nic.Id `
| Set-AzVMSourceImage -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2016-Datacenter' -Version latest `
| Set-AzVMBootDiagnostics -Enable -ResourceGroupName $resourceGroup.ResourceGroupName -StorageAccountName $bootDiagStorageAccount.StorageAccountName;但是,当我试图重新映像VM时,会得到以下错误:
Invoke-AzVMReimage: The Reimage and OSUpgrade Virtual Machine actions require that the virtual machine has Automatic OS Upgrades enabled.到底需要什么才能运行重映像命令?
发布于 2019-03-12 16:04:33
我含糊的记住,这个特性是在预览的Azure与短暂的操作系统磁盘。我当时没有报名参加预览,那是因为我不能复制。
https://azure.microsoft.com/en-us/blog/ephemeral-os-disk-limited-public-preview/
希望这能给你指明正确的方向。
https://stackoverflow.com/questions/55107848
复制相似问题