https://pulumi.com logo
Title
f

fast-solstice-31083

04/03/2023, 5:56 AM
ATM i m using ts, i created a volume like this:
const myManagedDisk = new azure.compute.ManagedDisk("myManagedDisk", {
    location: resourceGroup.location,
    resourceGroupName: resourceGroup.name,

    storageAccountType: "Standard_LRS",
    createOption: "Empty",
    diskSizeGb: 250,
});

const gpuDataDiskAttachment = new azure.compute.DataDiskAttachment("myDataDiskAttachment", {
    managedDiskId: myManagedDisk.id,
    virtualMachineId: vm.id,
    lun: 10,
    caching: "ReadOnly",
});
That worked well. The disk still exist in the RessourceGroup, but on rerun i want to use the existing managed disk, but i m not able to attach it to a new a vm if i rerun the stack, no matter what i change. if i dont change my script creationOption would be "Empty" like shown above, then i get : Code="ConflictingUserInput" Message="source-osdisk already exists in resource group RG-5265FCB5. Only CreateOption.Attach is supported." Ok, but when i change to attach i get: resource 'source' has a problem: expected create_option to be one of [Copy Empty FromImage Import ImportSecure Restore Upload], got Attach. Examine values at 'ManagedDisk.CreateOption'. In doc: https://www.pulumi.com/registry/packages/azure/api-docs/compute/manageddisk/ there "Possible values include:" are empty But how would i attach an existing manged disk to the vm.