Skip to content

server: check hostId when attach disk to a Stopped vm with local storage#7886

Merged
yadvr merged 1 commit intoapache:4.18from
weizhouapache:4.18-fix-attach-volume-local-storage
Aug 22, 2023
Merged

server: check hostId when attach disk to a Stopped vm with local storage#7886
yadvr merged 1 commit intoapache:4.18from
weizhouapache:4.18-fix-attach-volume-local-storage

Conversation

@weizhouapache
Copy link
Copy Markdown
Member

@weizhouapache weizhouapache commented Aug 21, 2023

Description

This fixes #7834

Steps to reproduce the issue

  • create service offering and disk offering with local storage
  • create a vm with local storage, and stop it
  • create volume with local storage
  • attach volume to vm

sometimes the volume is allocated to other host than root disk in the attach process, and an exception is thrown

com.cloud.utils.exception.CloudRuntimeException: Failed to attach local data volume data-001 to VM local-001 as migration of local data volume is not allowed
    at com.cloud.storage.VolumeApiServiceImpl.orchestrateAttachVolumeToVM(VolumeApiServiceImpl.java:2234)
    at com.cloud.storage.VolumeApiServiceImpl.orchestrateAttachVolumeToVM(VolumeApiServiceImpl.java:4697)

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?

@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a [SF] 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.

@weizhouapache weizhouapache added this to the 4.18.1.0 milestone Aug 21, 2023
@blueorangutan
Copy link
Copy Markdown

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

@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 21, 2023

Codecov Report

Merging #7886 (54e575a) into 4.18 (ddc2a36) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               4.18    #7886      +/-   ##
============================================
- Coverage     13.04%   13.04%   -0.01%     
  Complexity     9067     9067              
============================================
  Files          2720     2720              
  Lines        257236   257241       +5     
  Branches      40103    40105       +2     
============================================
  Hits          33552    33552              
- Misses       219474   219479       +5     
  Partials       4210     4210              
Files Changed Coverage Δ
...stack/engine/orchestration/VolumeOrchestrator.java 1.89% <0.00%> (-0.01%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Copy Markdown
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.

code looks good.

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File

Copy link
Copy Markdown
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm

Copy link
Copy Markdown
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

LGTM haven't tested it but I can see where/how Wei has fixed it and has tested it.

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.

Stopped VM with local storage and data disk created/attached fails if created on a different host

5 participants