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

Bug 1979038: oVirt: include master IPs when running must gather #5039

Merged

Conversation

eslutsky
Copy link
Contributor

gather bootstrap command will collect logs from the VMs only if the boostrap VM still exists.
this change adds the control planes VMs IP information, resulting the master logs
to be collected as well.

Signed-off-by: Evgeny Slutsky eslutsky@redhat.com

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 29, 2021
@eslutsky eslutsky force-pushed the gather_master_data branch 8 times, most recently from 37a43c9 to 5c4f71d Compare June 29, 2021 11:23

reportedDeviceSlice, err := getReportedDevices(c, moRefValue)
client, err := ovirt.NewConnection()
Copy link

Choose a reason for hiding this comment

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

Why are we creating a new oVirt connection here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to the connection one level up (outside the for loop)

@@ -69,52 +76,54 @@ func findVirtualMachineIP(c *ovirtsdk4.Connection, moRefValue string) (string, e
ipres, hasAddress := ip.Address()
if hasAddress {
if checkPortIsOpen(ipres, bootstrapSSHPort) {
logrus.Debugf("ovirt vm id: %s , found usable bootstrap IP %s", moRefValue, ipres)
logrus.Debugf("ovirt vm id: %s , found usable IP Address: %s", moRefValue, ipres)
Copy link

Choose a reason for hiding this comment

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

Is this log useful to the user anyhow or is this just debug code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its for debug

defer client.Close()


reportedDeviceSlice, err := getReportedDevices(client, moRefValue)
if err != nil {
return "", err
Copy link

Choose a reason for hiding this comment

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

This error should possibly be wrapped so we have context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

if len(br.Instances) == 0 {
return "", errors.New("no bootstrap instance found")
return []string{""}, errors.New(fmt.Sprintf("no %s instance found",name))
Copy link

Choose a reason for hiding this comment

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

Returning an empty IP seems like a workaround for something. It seems that this should not be handled here. If yes, we should add comments explaining what this does and why it is ok to return an empty string IP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay , in case of error we can return nil instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

// BootstrapIP returns the ip address for bootstrap host.
func BootstrapIP(tfs *terraform.State) (string, error) {
ips, err := lookupVMResources(tfs, "module.bootstrap", "bootstrap")
return ips[0], err
Copy link

Choose a reason for hiding this comment

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

Add error handling here if ips has no entries.

Copy link

Choose a reason for hiding this comment

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

After the last update this will cause a panic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}
ip, err := findVirtualMachineIP(vmid)
if err != nil {
return []string{""}, errors.Wrapf(err, "failed to lookup %s ipv4 address",name)
Copy link

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@eslutsky eslutsky force-pushed the gather_master_data branch 3 times, most recently from 75cfb4e to a112ffe Compare June 29, 2021 12:47
func findVirtualMachineIP(c *ovirtsdk4.Connection, moRefValue string) (string, error) {

reportedDeviceSlice, err := getReportedDevices(c, moRefValue)
func findVirtualMachineIP(moRefValue string,client *ovirtsdk4.Connection) (string, error) {
Copy link

Choose a reason for hiding this comment

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

This change seems unnecessary. Not a big deal, but still.

// BootstrapIP returns the ip address for bootstrap host.
func BootstrapIP(tfs *terraform.State) (string, error) {
ips, err := lookupVMResources(tfs, "module.bootstrap", "bootstrap")
return ips[0], err
Copy link

Choose a reason for hiding this comment

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

After the last update this will cause a panic.

@eslutsky eslutsky force-pushed the gather_master_data branch 5 times, most recently from 16663ca to f370157 Compare June 29, 2021 17:41
`gather bootstrap` command will collect logs from the VMs only if the boostrap VM still exists.
this change adds the control planes VMs IP information, resulting the master logs
to be collected as well.

Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
@eslutsky eslutsky requested a review from a user June 29, 2021 17:51
@eslutsky eslutsky changed the title WIP: oVirt: include master IPs when running must gather oVirt: include master IPs when running must gather Jul 4, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 4, 2021
@eslutsky
Copy link
Contributor Author

eslutsky commented Jul 4, 2021

/assign @crawford

@eslutsky eslutsky changed the title oVirt: include master IPs when running must gather Bug 1979038: oVirt: include master IPs when running must gather Jul 4, 2021
@openshift-ci openshift-ci bot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Jul 4, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 4, 2021

@eslutsky: This pull request references Bugzilla bug 1979038, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (mburman@redhat.com), skipping review request.

In response to this:

Bug 1979038: oVirt: include master IPs when running must gather

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jul 4, 2021
@Gal-Zaidman
Copy link
Contributor

/assign @staebler

Required for #5034

@jhixson74
Copy link
Member

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhixson74

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

5 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2021

@eslutsky: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-crc d19e8c6 link /test e2e-crc

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit fe9a17d into openshift:master Jul 8, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2021

@eslutsky: All pull requests linked via external trackers have merged:

Bugzilla bug 1979038 has been moved to the MODIFIED state.

In response to this:

Bug 1979038: oVirt: include master IPs when running must gather

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants