Skip to content

upgrade/systemvm: add template zone entries#5642

Merged
yadvr merged 3 commits intoapache:mainfrom
shapeblue:fix-systpltregistration-zoneentry
Nov 2, 2021
Merged

upgrade/systemvm: add template zone entries#5642
yadvr merged 3 commits intoapache:mainfrom
shapeblue:fix-systpltregistration-zoneentry

Conversation

@shwstppr
Copy link
Contributor

Description

Fixes #5641

When registering a system VM template during an upgrade, entries in cloud.template_zone_ref must be created for the new template.
For a cross-zones template, an entry for each zone must be added.

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?

Fixes apache#5641

When registering a system VM template during an upgrade, entries in cloud.template_zone_ref must be created for the new template.
For a cross-zones template, entry for each zone must be added.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

1 similar comment
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

@nvazquez
Copy link
Contributor

@blueorangutan test matrix

@yadvr
Copy link
Member

yadvr commented Oct 29, 2021

Manual upgrade testing required from 4.14, 4.15 to this PR's pkgs cc @nvazquez @borisstoyanov @vladimirpetrov @sureshanaparti

@yadvr
Copy link
Member

yadvr commented Oct 29, 2021

@blueorangutan test matrix

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@blueorangutan
Copy link

Trillian test result (tid-2491)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34411 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5642-t2491-xenserver-71.zip
Smoke tests completed. 90 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_cancel_host_maintenace_with_no_migration_jobs Error 1050.19 test_host_maintenance.py

@blueorangutan
Copy link

Trillian test result (tid-2493)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35134 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5642-t2493-vmware-65u2.zip
Smoke tests completed. 91 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm
did not test it

@shwstppr
Copy link
Contributor Author

shwstppr commented Nov 1, 2021

There seems to be some issue even after changes, getting an exception on upgrade,

2021-11-01 07:33:35,313 ERROR [c.c.u.SystemVmTemplateRegistration] (main:null) (logid:) Failed to register template for hypervisor: VMware
java.lang.NullPointerException
	at com.cloud.storage.dao.VMTemplateDaoImpl.addTemplateToZone(VMTemplateDaoImpl.java:474)
	at com.cloud.upgrade.SystemVmTemplateRegistration.createCrossZonesTemplateZoneRefEntries(SystemVmTemplateRegistration.java:468)
	at com.cloud.upgrade.SystemVmTemplateRegistration.performTemplateRegistrationOperations(SystemVmTemplateRegistration.java:600)

Looking into it.
Moving PR into draft meanwhile
@nvazquez @weizhouapache @rhtyd

@shwstppr shwstppr marked this pull request as draft November 1, 2021 07:36
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

shwstppr commented Nov 1, 2021

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

@shwstppr
Copy link
Contributor Author

shwstppr commented Nov 1, 2021

@nvazquez @weizhouapache @rhtyd
Tested 2 upgrades 4.14.1 and 4.15.2. Both worked fine:

  • Deployed env
  • Upgraded to this PR packages without registering system VM template prior to upgrade
  • Verified cloud.template_zone_ref after upgrade for a new entry for new system VM template
  • Enabled CK and deployed a k8s cluster

@blueorangutan test matrix

@shwstppr shwstppr marked this pull request as ready for review November 1, 2021 11:17
@shwstppr
Copy link
Contributor Author

shwstppr commented Nov 1, 2021

@blueorangutan test matrix

@blueorangutan
Copy link

@shwstppr a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

templateZoneVO = new VMTemplateZoneVO(zoneId, templateId, new java.util.Date());
templateZoneVO = vmTemplateZoneDao.persist(templateZoneVO);
} else {
templateZoneVO.setRemoved(GenericDaoBase.DATE_TO_NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, no need to explicitly set removed to null (the record retrieved using findByZoneTemplate() already has removed null)

templateZoneVO = null;
}
}
return templateZoneVO;
Copy link
Contributor

Choose a reason for hiding this comment

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

this returned templateZoneVO is unused, and only being validated for null. I think, it is better through the exception when the update fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't think it affects functionality

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think it affects functionality

correct, doesn't affect functionality. it's about the implementation. returning VMTemplateZoneVO is not required in this method.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan
Copy link

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

Test Result Time (s) Test File

@blueorangutan
Copy link

Trillian test result (tid-2500)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34855 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5642-t2500-vmware-65u2.zip
Smoke tests completed. 91 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

Trillian test result (tid-2498)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35412 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5642-t2498-xenserver-71.zip
Smoke tests completed. 91 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@vladimirpetrov vladimirpetrov left a comment

Choose a reason for hiding this comment

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

LGTM based on manual testing, tested upgrades from:

4.14.1 KVM CentOS 7, 2 zones
4.14.1 VMWare 6.7, 2 zones
4.14.1 XCP-NG 8.2, 1 zone
4.15.2 KVM CentOS 7, 1 zone
4.15.2 VMWare 6.7, 2 zones
4.15.2 XCP-NG 8.2, 2 zones

@yadvr yadvr merged commit d717d8a into apache:main Nov 2, 2021
weizhouapache added a commit to shapeblue/cloudstack that referenced this pull request Nov 2, 2021
weizhouapache added a commit that referenced this pull request Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cks: cluster deployment fails for an upgraded env with auto-registered system vm template

8 participants