-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Vmware to KVM Migration] Preserve boot type and boot mode of instances to be migrated #10975
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 to KVM Migration] Preserve boot type and boot mode of instances to be migrated #10975
Conversation
…es to be migrated
@blueorangutan package |
@nvazquez 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10975 +/- ##
==========================================
Coverage 16.15% 16.15%
- Complexity 13273 13275 +2
==========================================
Files 5657 5656 -1
Lines 497898 497792 -106
Branches 60374 60370 -4
==========================================
+ Hits 80435 80440 +5
+ Misses 408505 408399 -106
+ Partials 8958 8953 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13641 |
@blueorangutan test ol8 vmware-70u3 |
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests |
[SF] Trillian test result (tid-13475)
|
@blueorangutan test ol8 vmware-70u3 |
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests |
[SF] Trillian Build Failed (tid-13485) |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic looks good, but the code here needs some refactorring I think (new PR?) the method now is 153 lines and takes 21 parameters. Not sure about cyclic complexity and I really don’t want to know anymore by now.
@blueorangutan package |
@nvazquez 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13792 |
@blueorangutan package |
@nvazquez 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14100 |
@blueorangutan test ol8 vmware-70u3 |
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests |
@blueorangutan package |
@sureshanaparti 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14275 |
@blueorangutan test ol8 vmware-70u3 |
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments
@@ -1564,7 +1573,8 @@ private UserVm importUnmanagedInstanceFromHypervisor(DataCenter zone, Cluster cl | |||
template, displayName, hostName, CallContext.current().getCallingAccount(), owner, userId, | |||
serviceOffering, dataDiskOfferingMap, | |||
nicNetworkMap, nicIpAddressMap, | |||
details, migrateAllowed, forced, true); | |||
details, migrateAllowed, forced, true, | |||
unmanagedInstance.getBootType(), unmanagedInstance.getBootMode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nvazquez do we need to pass them here as they are already returned by unmanagedInstance
and it is already passed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks - fixed
@@ -1259,6 +1262,12 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI | |||
return userVm; | |||
} | |||
|
|||
private void addImportingVMBootTypeAndModeDetails(String bootType, String bootMode, Map<String, String> allDetails) { | |||
if (StringUtils.isNotBlank(bootType) && bootType.equalsIgnoreCase("uefi") && StringUtils.isNotBlank(bootMode)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check if bootMode is blank or not?
In a similar code block in #11218, I added a deployasis check as I saw it in UserVmManagerImpl.commitUserVm, not sure if it is worth adding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the deployasis check doesn't apply here, since Vmware to KVM migrations won't have that boolean enabled then converted VMs will never retain the boot mode and type. In case the VM is deploy as is then the boot mode and type will be preserved.
For the bootMode I think we do need to check if its not blank as that is the value we are adding as detail for the converted VM.
[SF] Trillian test result (tid-13833)
|
@nvazquez can you check the outstanding comments. |
Thanks @shwstppr for the review, comments addressed @blueorangutan package |
@nvazquez 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14346 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, manually checked the attributes are passed to imported instances
Description
This PR ensures the converted/imported instances preserve the source VM boot mode and boot type.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?