Skip to content

Fix migrateVMwithVolumes API in case of multiple volumes on VMware#4480

Merged
DaanHoogland merged 1 commit into
masterfrom
fixMigrateVMwithVolume_in_VMwareVsphere
Nov 20, 2020
Merged

Fix migrateVMwithVolumes API in case of multiple volumes on VMware#4480
DaanHoogland merged 1 commit into
masterfrom
fixMigrateVMwithVolume_in_VMwareVsphere

Conversation

@harikrishna-patnala

@harikrishna-patnala harikrishna-patnala commented Nov 19, 2020

Copy link
Copy Markdown
Member

Description

Problem:
When migrateVMwithVolumes API is tried on a VM with two volumes to migrate to a different host and tried to migrate only one volume, Cloudstack migrates both the Volumes but then marks only one of them migrated. This makes volume inaccessible due to inconsitency in path of volume in cloudstack and vsphere

Solution:
Set the target datastore in relocate spec properly for each volume
Fixes #4421

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?

Test cases covered (all the cases are checked at vSphere level also)

Setup has two clusters C1 and C2

Initial VM state:
VM1 having 3 volumes on a host in Cluster C1
root volume : vVols-C1 primary storage
data disk1 : NFS2-C1 primary storage
data disk2 : vVols-C1 primary storage

  1. Migrate VM1 to another host in C1 and migrate only root volume to NFS1-C1 primary storage ---- successful
    root volume : NFS1-C1 primary storage
    data disk1 : NFS2-C1 primary storage
    data disk2 : vVols-C1 primary storage
  2. Migrate VM1 to another host in C1 and migrate only data disk1 volume to NFS1-C1 primary storage ---- successful
    root volume : NFS1-C1 primary storage
    data disk1 : NFS1-C1 primary storage
    data disk2 : vVols-C1 primary storage
  3. Migrate VM1 to another host in different cluster C2 ---- successful
    root volume : NFS1-C2 primary storage
    data disk1 : VMFS6-C2 primary storage
    data disk2 : NFS2-C2 primary storage

…en only volume is tried to migrate along with VM.

Problem:
When migrateVMwithVolumes API is tried on a VM with two volumes to migrate to a different host and tried to migrate only one volume, Cloudstack migrates both the Volumes but then marks only one of them migrated. This makes volume inaccessible due to inconsitency in path of volume in cloudstack and vsphere

Solution:
Set the target datastore in relocate spec properly for each volume
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@harikrishna-patnala is this a vmware only issue?
And is it specific to certains storage types?

@harikrishna-patnala

Copy link
Copy Markdown
Member Author

@DaanHoogland This is vmware only issue and is not specific to any storage type.
changes are made only for vmware so we can run tests specific to vmware.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2406

@Pearl1594

Copy link
Copy Markdown
Contributor

@blueorangutan test centos7 vmware-67u3

@blueorangutan

Copy link
Copy Markdown

@Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3218)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38489 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4480-t3218-vmware-67u3.zip
Intermittent failure detected: /marvin/tests/smoke/test_human_readable_logs.py
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Smoke tests completed. 85 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_03_deploy_and_upgrade_kubernetes_cluster Failure 769.06 test_kubernetes_clusters.py

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

LGTM, did not test it manualy

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

logic looks right.

@DaanHoogland DaanHoogland changed the title Fix migrateVMwithVolumes API in case of VMware to address the case wh… Fix migrateVMwithVolumes API in case of multiple volumes on VMware Nov 20, 2020
@DaanHoogland DaanHoogland merged commit 51034be into master Nov 20, 2020
@DaanHoogland DaanHoogland deleted the fixMigrateVMwithVolume_in_VMwareVsphere branch November 20, 2020 12:38
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.

migratevmwithvolume api migrates both disks when you point just one of them

5 participants