将自定义图像应用于使用自定义图像创建的现有天蓝色比例集 [英] Applying custom image to an existing azure scaleset which was created using custom image

查看:47
本文介绍了将自定义图像应用于使用自定义图像创建的现有天蓝色比例集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用自定义图片创建了天蓝色的比例尺.当我尝试使用"Azure VMSS:使用不可变的机器映像更新"来使用另一个自定义映像升级比例尺设置时,出现以下错误

I have created an azure scaleset using custom image. when I try to upgrade the scale set with another custom image using "Azure VMSS: update with immutable machine image" I get the following error

无法更新VMSS testvmssapp的映像.错误:VMSS testvmssapp由于它使用平台映像,因此无法更新.仅VMSS当前正在使用自定义图像的可以进行更新.

Failed to update image for VMSS testvmssapp. Error: VMSS testvmssapp can not be updated as it uses a platform image. Only a VMSS which is currently using a custom image can be updated.

自定义缩放集图像是否缺少某些内容?

Is there something I am missing with custom scaleset image?

"storageProfile": {
            "osDisk": {
              "createOption": "FromImage",
              "caching": "ReadWrite",
              "managedDisk": {
                "storageAccountType": "Standard_LRS"
              },
              "diskSizeGB": 127
            },
            "imageReference": {
              "id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourceGroups/testvmssdeployment/providers/Microsoft.Compute/images/MyCustomImage"
            }
          },

推荐答案

我打开了一个问题

I opened an issue here about task Azure VM scale set deployment that you track on.

作为解决方法,您可以尝试使用管道中的azure powershell任务或azure cli任务来更新图像,以在脚本下运行.

As workaround, You can try updating the image by using azure powershell task or azure cli task in your pipeline to run below script.

Azure Powershell:

Azure Powershell:

Update-AzVmss `
    -ResourceGroupName "myResourceGroup" `
    -VMScaleSetName "myScaleSet" `
    -ImageReferenceId /subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myNewImage

Azure CLI:

Azure CLI:

az vmss update \
    --resource-group myResourceGroup \
    --name myScaleSet \
    --set virtualMachineProfile.storageProfile.imageReference.id=/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myNewImage

此问题的另一种解决方法是创建一个VHD文件,并使用此VHD文件使用此此处获取信息

Another workaround to this issue is to create a VHD file, and use this VHD file to create the VSS using this template. And then you will have a Image resource that has a URL which you can use for task Azure VM scale set deployment. Please check here for information

这篇关于将自定义图像应用于使用自定义图像创建的现有天蓝色比例集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆