Skip to content

Conversation

@hamistao
Copy link

@hamistao hamistao commented Nov 26, 2024

If not using recursion on GET /1.0/instances/:instanceName, almost all the instance information used in the response comes from the database. So when forwarding the request is not possible, fallback to reading the instance info from the node being queried. The only change is the response is the instance state, that in this case would show as Error since we can't determine the state of a remote instance.

closes #13698

@hamistao hamistao force-pushed the show_instance_offine_member branch from 411a0d7 to 8df3530 Compare November 26, 2024 14:51
@tomponline
Copy link
Member

typo in pr title

@hamistao hamistao force-pushed the show_instance_offine_member branch from 8df3530 to de1a655 Compare November 26, 2024 19:10
@hamistao hamistao changed the title lxd: Get config for instance on offine member lxd: Get config for instance on offline cluster member Nov 26, 2024
@hamistao hamistao force-pushed the show_instance_offine_member branch 2 times, most recently from ffa1c0e to 6f8039e Compare November 27, 2024 15:04
@hamistao hamistao force-pushed the show_instance_offine_member branch 3 times, most recently from 610a82b to 66c3dbe Compare November 28, 2024 11:13
hamistao added 6 commits November 28, 2024 09:31
If our lxc object refers to a remote container, we can't determine its
state. Useful when rendering containers on offline/unreachable cluster
members.

Signed-off-by: hamistao <[email protected]>
If our qemu object refers to a remote VM, we can't determine its
state. Useful when rendering VMs on offline/unreachable cluster
members.

Signed-off-by: hamistao <[email protected]>
If not using recursion, all the instance information, besides its state, used in the response comes from the database.
So when the instance's node is unavailable, return instance data with status `Error` we were unable to get its state.
For a recursive request, the additional info on instance state is
ungettable from a node that is not running the instance, so fail same as
before.

Signed-off-by: hamistao <[email protected]>
The Node field now has to be accurately set to determine the instance
state. So this sets it when getting local instances.

Signed-off-by: hamistao <[email protected]>
The Node field now has to be accurately set to determine the instance
state. So this sets it when getting local instances from backup.

Signed-off-by: hamistao <[email protected]>
@hamistao hamistao force-pushed the show_instance_offine_member branch from 66c3dbe to a321ba7 Compare November 28, 2024 12:33
@hamistao hamistao marked this pull request as ready for review November 28, 2024 13:39
@hamistao hamistao requested a review from tomponline November 28, 2024 13:39
@hamistao hamistao force-pushed the show_instance_offine_member branch from a321ba7 to c6be07e Compare November 28, 2024 13:49
@hamistao hamistao force-pushed the show_instance_offine_member branch from c6be07e to 31b790c Compare November 28, 2024 13:54
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

Thanks

@tomponline tomponline merged commit c74e0aa into canonical:main Dec 9, 2024
@hamistao hamistao deleted the show_instance_offine_member branch December 9, 2024 12:57
tomponline added a commit that referenced this pull request Dec 19, 2024
PR #14539 broke live migration in
commit
d734721

This is because when live migrating a VM, the VM's `Start()` function is
called on the target side (so that live migration can occur) before the
Location of the instance is updated in the DB. This in turn calls
`statusCode` during the start process.

The change to the `statusCode` function meant that this returned an
error status because the instance was in theory non-local, and that
prevented the qemu process from being started.

This PR reverts the `statusCode` error change and moves that logic into
the Render function.

Fixes #14679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lxc config show <instance> for an instance on an offline cluster member fails

2 participants