Skip to content

Conversation

@Pearl1594
Copy link
Contributor

Description

This PR addresses: #8440

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)
  • build/CI
  • test (unit or integration test code)

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?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

❌ Patch coverage is 18.18182% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.81%. Comparing base (638c152) to head (590dc48).
⚠️ Report is 1002 commits behind head on main.

Files with missing lines Patch % Lines
.../cloud/configuration/ConfigurationManagerImpl.java 0.00% 9 Missing ⚠️
.../main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java 40.00% 6 Missing ⚠️
...ain/java/com/cloud/api/query/QueryManagerImpl.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##               main    #9546     +/-   ##
===========================================
  Coverage     15.81%   15.81%             
- Complexity    12539    12554     +15     
===========================================
  Files          5623     5629      +6     
  Lines        491606   492041    +435     
  Branches      59582    61524   +1942     
===========================================
+ Hits          77725    77817     +92     
- Misses       405562   405901    +339     
- Partials       8319     8323      +4     
Flag Coverage Δ
uitests 4.48% <ø> (-0.02%) ⬇️
unittests 16.60% <18.18%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10698

return Active;
}
State state = EnumUtils.getEnumIgnoreCase(State.class, diskOfferingState);
if (!diskOfferingState.equalsIgnoreCase("all") && state == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these checks not relevant anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just made this uniform to how it works with listing network and vpc offerings ; wherein when the state isn't passed, we list all offerings - so we do not explicitly need "all"

return Active;
}
State state = EnumUtils.getEnumIgnoreCase(State.class, serviceOfferingState);
if (!serviceOfferingState.equalsIgnoreCase("all") && state == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same 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.

I just made this uniform to how it works with listing network and vpc offerings ; wherein when the state isn't passed, we list all offerings - so we do not explicitly need "all"

@vishesh92
Copy link
Member

I am not sure if should allow deletion of offerings. This could potentially cause some issues when the offering being deleted is still in use by some other resource (e.g. CKS, autoscaling group, etc.) which could then result in NPE or some other errors.

@Pearl1594
Copy link
Contributor Author

I am not sure if should allow deletion of offerings. This could potentially cause some issues when the offering being deleted is still in use by some other resource (e.g. CKS, autoscaling group, etc.) which could then result in NPE or some other errors.

@vishesh92 Checks have been added to prevent deletion of offerings if there are any VMs or volumes using them

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 10715

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10716

serviceOfferingSearch.join("diskOfferingSearch", diskOfferingSearch, JoinBuilder.JoinType.INNER, JoinBuilder.JoinCondition.AND,
serviceOfferingSearch.entity().getDiskOfferingId(), diskOfferingSearch.entity().getId(),
serviceOfferingSearch.entity().setString("Active"), diskOfferingSearch.entity().getState());
serviceOfferingSearch.entity().getDiskOfferingId(), diskOfferingSearch.entity().getId());
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this a query that is executed if vmid != null? if so, should we list inactive offerings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this PR aims to support disabling service offerings - to make it similar to the way network offerings work, it would make sense to list active and inactive offerings

Copy link
Contributor

@JoaoJandre JoaoJandre Aug 20, 2024

Choose a reason for hiding this comment

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

This method is too long (500+ lines...) for me to judge what it is exactly doing and where it is being done.
I just want to make sure that when creating VMs we don't list inactive offerings. If this change does not cause that, then I'm ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Al, that's a fair point.. Probably reverting to it listing Active by default would be a better option. Thanks.

@Pearl1594 Pearl1594 requested a review from kiranchavala August 20, 2024 20:35
@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@Pearl1594
Copy link
Contributor Author

Most test failures seems not related to this PR:

Test Reason
test_primary_storage.py Failed to add data store: Storage pool nfs2 already in use by another pod
test_vm_deployment_planner.py ol8.localdomain is not in the right state
test_vm_life_cycle ol8.localdomain is not in the right state Or Unable to deploy the VM as the host: ol8.localdomain is not in the right state or TypeError: object of type 'NoneType' has no len()
test_vm_strict_host_tags Unable to deploy the VM as the host: ol8.localdomain is not in the right stat

@JoaoJandre JoaoJandre modified the milestones: 4.20.0.0, 4.21.0.0 Sep 10, 2024
@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11086

@Pearl1594
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-11442)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 57914 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9546-t11442-kvm-ol8.zip
Smoke tests completed. 131 look OK, 10 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestClusterDRS>:setup Error 0.00 test_cluster_drs.py
ContextSuite context=TestDeployVirtioSCSIVM>:teardown Error 50.78 test_deploy_virtio_scsi_vm.py
test_01_add_primary_storage_disabled_host Error 0.22 test_primary_storage.py
test_03_migration_options_storage_tags Error 0.02 test_primary_storage.py
ContextSuite context=TestResourceNames>:teardown Error 41.62 test_resource_names.py
ContextSuite context=TestCpuCapServiceOfferings>:setup Error 0.00 test_service_offerings.py
ContextSuite context=TestServiceOfferings>:teardown Error 152.94 test_service_offerings.py
ContextSuite context=TestSharedFSLifecycle>:teardown Error 69.99 test_sharedfs_lifecycle.py
test_02_list_snapshots_with_removed_data_store Error 0.00 test_snapshots.py
test_01_deploy_vm_on_specific_host Error 0.09 test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_cluster Error 0.12 test_vm_deployment_planner.py
test_01_migrate_VM_and_root_volume Error 95.41 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 52.71 test_vm_life_cycle.py
test_01_secure_vm_migration Error 316.39 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 340.06 test_vm_life_cycle.py
test_04_nonsecured_to_secured_vm_migration Error 268.43 test_vm_life_cycle.py
test_08_migrate_vm Error 0.07 test_vm_life_cycle.py
test_01_migrate_vm_strict_tags_success Error 0.27 test_vm_strict_host_tags.py
test_02_migrate_vm_strict_tags_failure Error 0.24 test_vm_strict_host_tags.py
test_01_restore_vm_strict_tags_success Error 0.23 test_vm_strict_host_tags.py
test_02_restore_vm_strict_tags_failure Error 0.24 test_vm_strict_host_tags.py
test_01_scale_vm_strict_tags_success Error 0.25 test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failure Error 0.27 test_vm_strict_host_tags.py
test_01_deploy_vm_on_specific_host_without_strict_tags Error 0.18 test_vm_strict_host_tags.py
test_02_deploy_vm_on_any_host_without_strict_tags Error 2.57 test_vm_strict_host_tags.py
test_03_deploy_vm_on_specific_host_with_strict_tags_success Error 0.23 test_vm_strict_host_tags.py
test_04_deploy_vm_on_any_host_with_strict_tags_success Error 5.62 test_vm_strict_host_tags.py
test_05_deploy_vm_on_specific_host_with_strict_tags_failure Failure 0.21 test_vm_strict_host_tags.py

Comment on lines +4371 to +4374
List<VolumeVO> volumesUsingOffering = _volumeDao.findByDiskOfferingId(diskOfferingId);
if (!volumesUsingOffering.isEmpty()) {
throw new InvalidParameterValueException(String.format("Unable to delete disk offering: %s [%s] because there are volumes using it", offering.getUuid(), offering.getName()));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this related to the main change? Why should we start blocking this now?

Comment on lines +4447 to +4450
List<VMInstanceVO> vmsUsingOffering = _vmInstanceDao.listByOfferingId(offeringId);
if (!vmsUsingOffering.isEmpty()) {
throw new CloudRuntimeException(String.format("Unable to delete service offering %s as it is in use", offering.getUuid()));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this related to the main change? Why should we start blocking this now?

@github-actions
Copy link

github-actions bot commented Jan 8, 2025

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sureshanaparti sureshanaparti moved this to In Progress in Apache CloudStack 4.21.0 Jun 5, 2025
@sureshanaparti sureshanaparti changed the title Add support for disabling serivce / system and disk offerings Add support for disabling service / system and disk offerings Jul 14, 2025
@weizhouapache weizhouapache modified the milestones: 4.21.0, 4.22.0 Aug 29, 2025
@DaanHoogland
Copy link
Contributor

@Pearl1594 , please update, or should we close/convert to draft?

@Pearl1594 Pearl1594 closed this Oct 10, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.0 Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Provide the option of disabling the service offerings, system offerings, disk offerings

9 participants