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

GetMachineStatus prevents machine deletion, if SrcAndDstChecks is disabled #165

Closed
hendrikKahl opened this issue Jul 8, 2024 · 1 comment
Labels
kind/bug Bug status/closed Issue is closed (either delivered or triaged)

Comments

@hendrikKahl
Copy link
Contributor

What happened:

We saw a machine stuck in status Terminating with

Error occurred with decoding machine error status while getting VM status, aborting without retry. machine code: machine codes error: code = [Uninitialized] message = [VM "i-<id>" associated with machine "<name>" has SourceDestCheck=true despite providerSpec.SrcAndDstChecksEnabled=false] Set machine status to termination. Now, getting VM Status

From the machine creation logs we could derive that

func disableSrcAndDestCheck(svc ec2iface.EC2API, instanceID *string) error {
srcAndDstCheckEnabled := &ec2.ModifyInstanceAttributeInput{
InstanceId: instanceID,
SourceDestCheck: &ec2.AttributeBooleanValue{
Value: pointer.BoolPtr(false),
},
}
_, err := svc.ModifyInstanceAttribute(srcAndDstCheckEnabled)
if err != nil {
return err
}
klog.V(2).Infof("Successfully disabled Source/Destination check on instance %s.", *instanceID)
return nil
}
never ran successfully for this machine.

With GetMachineStatus being called also upon deletion of a machine, the status is stuck and requires manual intervention (e.g. patching the instance's attribute).

What you expected to happen:

GetMachineStatus should not block machine deletion.

How to reproduce it (as minimally and precisely as possible):

  • create a machine with provider AWS
  • patch the instance status aws ec2 modify-instance-attribute --no-source-dest-check --instance-id i-<id>
  • trigger the deletion of the machine

Anything else we need to know:

Environment:

@rishabh-11
Copy link
Contributor

gardener/machine-controller-manager#928 is merged and the corresponding version of MCM is also updated in the provider.

/close

@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

No branches or pull requests

3 participants