Skip to content

Prevent NPE on reboot stopped VM and startVM output with null displayname - #6397

Merged
nvazquez merged 5 commits into
apache:4.16from
shapeblue:fixrebootstoppedvm
May 20, 2022
Merged

nvazquez merged 5 commits into
apache:4.16from
shapeblue:fixrebootstoppedvm

Conversation

@nvazquez

@nvazquez nvazquez commented May 18, 2022

Copy link
Copy Markdown
Contributor

Description

This PR prevents an NPE on VM reboot when the VM is not in Running state.

Also addresses the output of the startVirtualMachine API with null displayname:

(isc-uat) 🐱 > start virtualmachine id=5e549d97-f6c6-4109-9416-ed6eb7c8b912
{
  "accountid": "53c6e98d-bc37-11ec-ba86-02000252074f",
  "cmd": "org.apache.cloudstack.api.command.admin.vm.StartVMCmdByAdmin",
  "completed": "2022-05-17T21:50:25+0000",
  "created": "2022-05-17T21:50:24+0000",
  "jobid": "0ea90ce5-2af2-4268-baed-e189134aad78",
  "jobinstanceid": "5e549d97-f6c6-4109-9416-ed6eb7c8b912",
  "jobinstancetype": "VirtualMachine",
  "jobprocstatus": 0,
  "jobresult": {
    "errorcode": 431,
    "errortext": "The virtual machine 5e549d97-f6c6-4109-9416-ed6eb7c8b912 (null) is already running"
  },
  "jobresultcode": 530,
  "jobresulttype": "object",
  "jobstatus": 2,
  "userid": "9013ef87-e072-492f-a609-32c1f4c18383"
}

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

@nvazquez nvazquez added this to the 4.17.0.0 milestone May 18, 2022
@nvazquez
nvazquez force-pushed the fixrebootstoppedvm branch from 909b33f to f1d092f Compare May 18, 2022 12:23
@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@apache apache deleted a comment from blueorangutan May 18, 2022
@blueorangutan

Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@nvazquez
nvazquez requested a review from sureshanaparti May 18, 2022 12:34

@shwstppr shwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested. Works okay, a suggestion on exception message

Comment thread server/src/main/java/com/cloud/vm/UserVmManagerImpl.java Outdated
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3438

@slavkap slavkap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code looks good, didn't test it

@Pearl1594 Pearl1594 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@nvazquez nvazquez changed the title Prevent NPE on reboot stopped VM Prevent NPE on reboot stopped VM and startVM output with null displayname May 18, 2022
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✖️ debian ✔️ suse15. SL-JID 3439

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@sureshanaparti sureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

code LGTM @nvazquez

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3440

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan test

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code lgtm

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4206)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37897 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6397-t4206-kvm-centos7.zip
Smoke tests completed. 91 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_07_deploy_kubernetes_ha_cluster Failure 3617.22 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 0.05 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 64.05 test_kubernetes_clusters.py

@nvazquez
nvazquez merged commit b62b5c9 into apache:4.16 May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants