Open nihr43 opened 2 years ago
oh, looks like lxd itself does know how to handle intra-cluster migrations correctly, pylxd just needs to know how to do it:
heres what lxc does: https://github.com/lxc/lxd/blob/master/lxc/move.go#L258
heres what lxd knows: https://github.com/lxc/lxd/blob/master/lxd/instance_post.go#L102
meanwhile pylxd is just doing a naive create(): https://github.com/lxc/pylxd/blob/master/pylxd/models/instance.py#L592
Hi; unsure if this is expected behavior or something that slipped through the integration tests.
Im trying to migrate instances within a cluster, precisely akin to
lxc mv "$instance" --target="$target_node"
. Im getting:I'm reminded of how the lxc client creates a temporary instance like 'mv-uuid...' during a migration; this behavior must have already been worked around over there.
I see how this could have been missed; i don't see any sort of ad-hoc cluster construction ( like in lxd proper ) going on in the integration tests here. I see
migration/run_migration_integration_tests-18-04
but it doesnt appear to be consumed by anything.So my questions are.. Is this expected behavior? Am I the consumer expected to work around this in my own code? Or, if this is not expected behavior, what input would you have on an integration test and fix for this? Im interested in taking a stab at it.. I figure
migration/run_migration_integration_tests-18-04
needs taught to build a cluster of two, and migrate() needs taught to juggle instance names like lxc does.Or perhaps im missing something? Any better ideas? Thanks.