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

govc: add cluster.mv command #3106

Merged
merged 1 commit into from
Apr 27, 2023
Merged

govc: add cluster.mv command #3106

merged 1 commit into from
Apr 27, 2023

Conversation

dougm
Copy link
Member

@dougm dougm commented Apr 19, 2023

Description

Move hosts into a cluster.

vcsim: add ClusterComputeResource.MoveInto_Task support

Closes #2524

Type of change

Please mark options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update
  • Build related change

How Has This Been Tested?

added new bats tests

Checklist:

  • My code follows the CONTRIBUTION
    guidelines of
    this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

govc/test/cluster.bats Outdated Show resolved Hide resolved
[ ${#lines[@]} -eq 8 ]

# standalone host
run govc cluster.mv -cluster DC0_C1 DC0_H0
Copy link
Member

Choose a reason for hiding this comment

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

matching test for moving a host out of a cluster to become standalone?

Copy link
Member Author

Choose a reason for hiding this comment

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

cluster.mv (MoveInto_Task) can only move hosts into a cluster (from standalone or another cluster).
object.mv (MoveIntoFolder_Task) can move from a cluster into a host folder and it becomes a standalone host (just learned that tonight). Let's revisit that case, at the moment vcsim only supports moving from Folders:

govmomi/simulator/folder.go

Lines 567 to 571 in c715016

parent, ok := ctx.Map.Get(*(obj.Entity()).Parent).(*Folder)
if !ok || !folderHasChildType(&f.Folder, ref.Type) {
return nil, &types.NotSupported{}
}

simulator/cluster_compute_resource.go Show resolved Hide resolved
vcsim: add ClusterComputeResource.MoveInto_Task support

Closes vmware#2524
@dougm dougm merged commit 2dbc28b into vmware:main Apr 27, 2023
@dougm dougm deleted the issue-2524 branch April 27, 2023 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GOVC] Add a new command to support move host from datacenter to cluster
3 participants