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

[MTV-595] Refactor run virt-customize for linux on any non windows #998

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

yaacov
Copy link
Member

@yaacov yaacov commented Aug 28, 2024

Ref: https://issues.redhat.com/browse/MTV-595

Issue:
The original issue was reported on RHEL8, after discussions with reporter we found out that this fix may be helpful for other distributions.

Concerns:
The fix will work for machines that use network manager, but will no nothing in other cases.

@yaacov yaacov requested a review from mnecas as a code owner August 28, 2024 09:08
Copy link

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 16.46%. Comparing base (3712ab2) to head (4d5ea0b).
Report is 2 commits behind head on main.

Files Patch % Lines
virt-v2v/cold/entrypoint.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #998      +/-   ##
==========================================
- Coverage   16.50%   16.46%   -0.05%     
==========================================
  Files         107      107              
  Lines       19628    19628              
==========================================
- Hits         3240     3231       -9     
- Misses      16099    16110      +11     
+ Partials      289      287       -2     
Flag Coverage Δ
unittests 16.46% <33.33%> (-0.05%) ⬇️

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.

// RHEL
if strings.Contains(operatingSystem, "rhel") {
// Linux
if !strings.Contains(operatingSystem, "win") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we actually check for the family == 'linux' here.

osinfo-db has family, see: https://gitlab.com/libosinfo/osinfo-db/-/blob/main/data/os/fedoraproject.org/fedora-38.xml.in?ref_type=heads#L

Copy link
Contributor

Choose a reason for hiding this comment

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

… with that approach we don't risk to be run on i.e. freebsd

Copy link
Member Author

Choose a reason for hiding this comment

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

we use the xml output of virt-v2v, this information is missing, IMHO it's safe to try and run on any machine that is not identifying as windows, the script test for udev script and will not override if exist, and will fail gracefully if it can't find the network manager configuration scripts.

@yaacov yaacov merged commit 3ad243d into kubev2v:main Aug 28, 2024
13 of 14 checks passed
yaacov added a commit that referenced this pull request Aug 28, 2024
Backport of 
#985 - sen mac <=> ip mappings
for linux
#983 - customize script for
linux
#997 - refactor bash script
#998 - run customize script on
any linux

Ref: https://issues.redhat.com/browse/MTV-595

Issue:
When migrating a simple RHEL8 VM from VMware 7 to OCPv 4.13 the name of
the network interfaces changes and the static IP configuration for the
VM no longer works

---------

Signed-off-by: yaacov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants