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

[VMware] Consider CD/DVD drive when calculating next free unit number for volume attachment over IDE controller #9644

Open
wants to merge 2 commits into
base: 4.19
Choose a base branch
from

Conversation

winterhazel
Copy link
Collaborator

Description

When attaching a volume to an instance, CloudStack calculates the next free unit number of the disk controller that should be associated with the volume. However, for IDE disk controllers, CD/DVD drives associated with the controller are not taken into consideration when calculating the next available unit number. Due to this, an error happens in some situations when trying to attach a volume to an instance over IDE controllers because CloudStack tries to associate the volume to an unit number that is already being used.

The generic method of reproducing this problem is:

  1. Deploy a VM
  2. Set dataDiskController to ide
  3. If there are any volumes using IDE controllers, detach them
  4. Try to attach a volume

This PR fixes the issue by making the code also consider CD/DVD drives. Tests will be added in another PR alongside an extension for the disk controllers that I'm currently working on, as it will require me to modify this code again.

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

  1. I deployed a VM from a template with both rootDiskController and dataDiskController set to ide, with only a root disk
  2. I detached the root disk
  3. I reattached the root disk. Before, an exception would be thrown in this step. After the changes, I verified that the volume was associated successfully to IDE(0:1)
  4. I attached a data disk. I verified that the volume was associated successfully to IDE(1:0)
  5. I attached another data disk. I verified that the volume was associated successfully to IDE(1:1)
  6. I tried to attach another data disk. I verified that an exception was thrown because the maximum number of devices over IDE controllers was reached

@winterhazel
Copy link
Collaborator Author

@blueorangutan package

@blueorangutan
Copy link

@winterhazel 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.

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 15.08%. Comparing base (0204cb7) to head (dddfea4).
Report is 28 commits behind head on 4.19.

Files with missing lines Patch % Lines
...m/cloud/hypervisor/vmware/mo/VirtualMachineMO.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##               4.19    #9644     +/-   ##
===========================================
  Coverage     15.08%   15.08%             
- Complexity    11185    11193      +8     
===========================================
  Files          5406     5406             
  Lines        473123   473215     +92     
  Branches      58163    60800   +2637     
===========================================
+ Hits          71371    71390     +19     
- Misses       393810   393877     +67     
- Partials       7942     7948      +6     
Flag Coverage Δ
uitests 4.30% <ø> (-0.01%) ⬇️
unittests 15.80% <0.00%> (+<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.

@blueorangutan
Copy link

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

@rohityadavcloud
Copy link
Member

@blueorangutan test ol8 vmware-70u3

@blueorangutan
Copy link

@rohityadavcloud a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@blueorangutan
Copy link

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

Test Result Time (s) Test File
ContextSuite context=TestPrivateGwACL>:setup Error 0.00 test_privategw_acl.py
test_09_project_suspend Error 1.11 test_projects.py
test_10_project_activation Error 1.09 test_projects.py

@rohityadavcloud rohityadavcloud added this to the 4.19.2.0 milestone Sep 19, 2024
Copy link
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

CLGTM

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.

5 participants