Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/virtual_machine: Allow vMotions to other clusters #474

Merged
merged 1 commit into from
Apr 14, 2018

Conversation

vancluever
Copy link
Contributor

As host_system_id is an optional attribute that also holds the current
host that a VM is currently located on (read: Optional/Computed value),
changing resource_pool_id to a resource pool in a cluster that does not
contain the host denoted by the current value of host_system_id (which
would be unmodified unless actually pinned by the user) would produce an
error.

This corrects this by flagging host_system_id as computed in the diff if
resource_pool_id is changing while the former is not. This correctly
skips the host check.

Fixes #424.

As host_system_id is an optional attribute that also holds the current
host that a VM is currently located on (read: Optional/Computed value),
changing resource_pool_id to a resource pool in a cluster that does not
contain the host denoted by the current value of host_system_id (which
would be unmodified unless actually pinned by the user) would produce an
error.

This corrects this by flagging host_system_id as computed in the diff if
resource_pool_id is changing while the former is not. This correctly
skips the host check.
@vancluever vancluever requested a review from a team April 14, 2018 14:10
@vancluever vancluever added the bug Type: Bug label Apr 14, 2018
Copy link
Contributor

@bill-rich bill-rich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vancluever vancluever merged commit 0c5625a into master Apr 14, 2018
@vancluever vancluever deleted the b-vm-cluster-vmotion branch April 26, 2018 17:17
@surajsub
Copy link

surajsub commented Mar 7, 2019

I did see the same problem on 1.8 as well . I get an error
vsphere_virtual_machine.vm_1: Modifying... (ID: 4238eb7f-7c76-6906-bc6f-0b0854a5ab2c)
datastore_id: "datastore-29" => "datastore-33"
disk.0.datastore_id: "datastore-29" => "datastore-33"
disk.1.datastore_id: "datastore-29" => "datastore-33"
disk.2.datastore_id: "datastore-29" => "datastore-33"
disk.3.datastore_id: "datastore-29" => "datastore-33"
disk.4.datastore_id: "datastore-29" => "datastore-33"
host_system_id: "host-28" => ""
resource_pool_id: "resgroup-36" => "resgroup-37"

Error: Error applying plan:
1 error(s) occurred:

  • vsphere_virtual_machine.vm_1: 1 error(s) occurred:
  • vsphere_virtual_machine.vm_1: ServerFaultCode: vim.fault.InvalidState
    Terraform does not automatically rollback in the face of errors.
    Instead, your Terraform state file has been partially updated with
    any resources that successfully completed. Please address the error
    above and apply again to incrementally change your infrastructure.

@surajsub
Copy link

surajsub commented Mar 7, 2019

@bill-rich - Can you please take a look above and suggest ?

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vMotion - migrating to different clusters not functional
3 participants