Skip to content

Can't add resources to a list when there are wildcards in ignoreChanges #824

@lichtie

Description

@lichtie

Describe what happened

As of version 4.14.0, the vSphere provider no longer lets you add new items to a list (e.g. a disk to a VirtualMachine) when ignoreChanges is used with a wildcard on that list. The operation fails with the error:

cannot ignore changes to the following properties because one or more elements of the path are missing.

Sample program

const vm = new vsphere.VirtualMachine(
  "testVM",
  {
    name: "testVM",
    resourcePoolId: resourcePoolId,
    datastoreId: datastoreId,
    folder: folder,
    numCpus: numCPUs,
    memory: memoryMB,
    guestId: "otherGuest",
    networkInterfaces: [
      {
        networkId: networkId,
        adapterType: "vmxnet3",
      },
    ],
    disks: diskSizesGB.map((size, index) => ({
      label: `disk${index + 1}`,
      size: size,
      eagerlyScrub: false,
      thinProvisioned: true,
      unitNumber: index,
      datastoreId: "datastoreId",
    })),
    clone: {
      templateUuid: "templateUuid",
    },
  },
  { ignoreChanges: ["disks[*].datastoreId"] }
);

Log output

No response

Affected Resource(s)

No response

Output of pulumi about

CLI          
Version      3.178.0
Go Version   go1.24.4
Go Compiler  gc

Plugins
KIND      NAME           VERSION
resource  gcp            8.36.0
language  nodejs         3.178.0
resource  synced-folder  0.0.9
resource  vsphere        4.14.0

Host     
OS       darwin
Version  15.5
Arch     arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v24.1.0'

Current Stack: ElisabethLich/repro-vsphere/dev

Found no resources associated with dev

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/ElisabethLich
User           ElisabethLich
Organizations  ElisabethLich, team-ce, demo
Token type     personal

Dependencies:
NAME                   VERSION
@pulumi/gcp            8.36.0
@pulumi/pulumi         3.181.0
@pulumi/synced-folder  0.0.9
@pulumi/vsphere        4.14.0
@types/node            18.19.115
typescript             5.8.3

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

Labels

awaiting-feedbackBlocked on input from the authorawaiting/coreBlocked on a missing bug or feature in pulumi/pulumi (except codegen)kind/bugSome behavior is incorrect or out of specresolution/fixedThis issue was fixed

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions