Skip to content

Import conflicts when using datastoreClusterId vs datastoreId with VM disks #873

@MeganYTan

Description

@MeganYTan

Describe what happened

When importing an existing VM with an attached disk into Pulumi, conflicts occur between datastoreId and datastoreClusterId.

  • If only datastoreId is specified on the VM and the disk, the preview shows [diff: -datastoreClusterId] which blocks the import.
  • If only datastoreClusterId is specified on the VM, and no datastoreId is specified on the disk level, there is the following error:
[13:34:38 INF]     error: vsphere:index/virtualMachine:VirtualMachine resource 'rsgberger01' has a problem: Conflicting configuration arguments. "datastore_cluster_id": conflicts with datastore_id. Examine values at 'rsgberger01.datastoreClusterId'.
[13:34:38 INF]     error: vsphere:index/virtualMachine:VirtualMachine resource 'rsgberger01' has a problem: Conflicting configuration arguments. "datastore_id": conflicts with datastore_cluster_id. Examine values at 'rsgberger01.datastoreId'.
  • If only datastoreId is specified on the VM, there is the following error:
[13:36:30 INF]   vsphere:index:VirtualMachine (rsgadcita3):
[13:36:30 INF]     error: vsphere:index/virtualMachine:VirtualMachine resource 'rsgadcita3' has a problem: Conflicting configuration arguments. "disk.0.datastore_id": conflicts with datastore_cluster_id. Examine values at 'rsgadcita3.disks[0].datastoreId'.
  • If both datastoreId and datastoreClusterId are specified, conflicting configuration argument errors are raised.

Pulumi commands run:

pulumi import vsphere:index/virtualMachine:VirtualMachine rsgadcita3 vm-12345
pulumi preview

Sample program

This is an import issue with no sample.

Log output

See above for various logs under different scenarios.

Affected Resource(s)

vsphere:index/virtualMachine:VirtualMachine

Output of pulumi about

Awaiting response

Additional context

Found a related issue with the Terraform provider: vmware/terraform-provider-vsphere#483

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

kind/bugSome behavior is incorrect or out of spec

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions