Bug 1685948 - Add validation on the source VM name for migration plan selection
Summary: Add validation on the source VM name for migration plan selection
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: V2V
Version: 5.10.1
Hardware: All
OS: All
medium
medium
Target Milestone: GA
: 5.11.z
Assignee: Fabien Dupont
QA Contact: Shveta
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On: 1727275
Blocks: 1726231
TreeView+ depends on / blocked
 
Reported: 2019-03-06 11:33 UTC by Fabien Dupont
Modified: 2020-03-18 08:09 UTC (History)
5 users (show)

Fixed In Version: 5.11.0.13
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1726231 (view as bug list)
Environment:
Last Closed: 2020-03-18 08:09:15 UTC
Category: Feature
Cloudforms Team: V2V
Target Upstream Version:


Attachments (Terms of Use)
wrapper log (6.02 KB, text/plain)
2019-08-20 01:04 UTC, Shveta
no flags Details
Migration log (280 bytes, text/plain)
2019-08-20 01:04 UTC, Shveta
no flags Details
log for international chars vm with OSP (18.56 KB, text/plain)
2019-08-20 19:29 UTC, Shveta
no flags Details

Description Fabien Dupont 2019-03-06 11:33:24 UTC
Description of problem:

We know that some VM names are invalid in RHV and OpenStack. For example, RHV doesn't allow space and punctuation, and OpenStack doesn't allow special characters. The goal is to identify VMs in source provider whose name will not be allowed by the destination provider and make them unselectable in the UI.

Comment 2 Fabien Dupont 2019-03-06 21:14:01 UTC
https://github.com/ManageIQ/manageiq/pull/18528

Comment 3 Fabien Dupont 2019-03-08 13:46:55 UTC
https://github.com/ManageIQ/manageiq/pull/18536

Comment 5 Fabien Dupont 2019-05-16 10:05:23 UTC
Moving to 5.10.6 because 5.10.5 focuses on conversion host management UI.

Comment 7 Fabien Dupont 2019-06-18 08:49:04 UTC
@Brett, waiting on review.

Comment 9 Shveta 2019-07-26 21:03:51 UTC
Vm's with space and international characters (�Ääú) in name are filtered out from RHEV.

Comment 10 Shveta 2019-07-31 17:25:39 UTC
Hi Fabien , Is this expected? 
Vm's (with space and international chars) are not displayed in VM list in migration plan

Comment 11 Fabien Dupont 2019-08-01 07:22:54 UTC
For RHV, it's normal because RHV doesn't support spaces or international chars for VM names. That's precisely the purpose of this BZ.
We don't make the VM unselectable, we simply filter them out.

Comment 12 Shveta 2019-08-01 15:07:12 UTC
Not able to verify the BZ for OSP because of https://bugzilla.redhat.com/show_bug.cgi?id=1727275

Comment 13 Shveta 2019-08-19 18:51:25 UTC
Checked on OSP , The plan does not filter (or makes the VM unselectable) the VM's with name containing space or international chars.
Appliance : https://10.16.5.88
5.11.0.19.20190813184334_ed72c9f

Comment 14 Fabien Dupont 2019-08-19 19:54:26 UTC
That's because they are supported in OpenStack. OpenStack doesn't support non-printable characters, and to be honest, I don't know how to create a VM with non-printable characters in its name.

Comment 15 Shveta 2019-08-20 01:04:32 UTC
Created attachment 1605905 [details]
wrapper log

Hi Fabien , 
Can you please check the attached logs .
Both space and international chars VM fails on OSP .

Comment 16 Shveta 2019-08-20 01:04:56 UTC
Created attachment 1605906 [details]
Migration log


We discussed on another BZ earlier that OSP does not support international chars https://bugzilla.redhat.com/show_bug.cgi?id=1678385#c18.

Hence atleast VM's with international chars in name should be filtered out .

Comment 17 Fabien Dupont 2019-08-20 06:53:31 UTC
What I said in https://bugzilla.redhat.com/show_bug.cgi?id=1678385#c18 is that the filter we had at that time filtered out international characters for both RHV and OSP.
OpenStack supports international characters, so this BZ implements a different filter for RHV and OSP VMs:

 - RHV doesn't support spaces and international characters (https://github.com/ManageIQ/manageiq/blob/master/app/models/transformation_mapping/vm_migration_validator.rb#L144-L147)
 - OSP doesn't support non-printable characters (https://github.com/ManageIQ/manageiq/blob/master/app/models/transformation_mapping/vm_migration_validator.rb#L149-L152)

If you look at the virt-v2v log, you can see that the error is not related to VM name: "virt-v2v: error: ‘-io vddk-libdir=/opt/vmware-vix-disklib-distrib’ does not point to a directory.".
I would guess that the conversion host is not properly configured.

Moving it back to ON_QA.

Comment 18 Shveta 2019-08-20 19:29:16 UTC
Created attachment 1606239 [details]
log for international chars vm with OSP

Ok created a plan (plan_international) with international chars VM (�Äã).
Plan failed with error : "56:be:64:5b', '--enable', u'\ufffd\xc4\xe3_port_0', '--security-group', u'224a6f1b-465e-458b-9170-a7216643f4f2'], environment: {} (virt-v2v-wrapper:1769)
2019-08-20 15:21:50,396:ERROR: Command exited with non-zero return code 1, output:
'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)"


Appliance : https://10.16.5.91
Plan: plan_international

Comment 19 Shveta 2019-08-20 20:24:23 UTC
Plan with space in VM name worked but got stuck at refresh inventory state which is tracked in separate BZ .
But I think we are good with this test case ( VM with space in name on OSP)

appliance : https://10.16.5.91/migration#/plan/2

Comment 20 Fabien Dupont 2019-08-20 20:47:32 UTC
Thanks @shveta. It seems that the command to arguments passed to virt-v2v were valid unicode characters. We can see them in virt-v2v log and virt-v2v succeeded.
As you wrote, in virt-v2v-wrapper log, the command to create the network port fails. @Tomas, do you think it's the way virt-v2v-wrapper uses the string ?

Comment 21 Tomáš Golembiovský 2019-08-21 10:34:49 UTC
This is a bug in openstack see bug 1661913

Comment 22 Fabien Dupont 2019-08-21 13:43:09 UTC
Thanks Tomas.
So, maybe we should use the same validation rules for RHV and OSP. Do you know what the limitations are on CNV ?

Comment 23 Tomáš Golembiovský 2019-08-22 15:07:00 UTC
Looks like they have same requirements as Kubernetes. I've been referred to DNS 1123 specification. I don't know if they have any easily readable regex somewhere in the code.

Comment 24 Tomáš Golembiovský 2019-08-22 15:21:09 UTC
So it seems the rules in Kubernetes/CNV are:
- maximum length is 253 characters
- can only contain lower case characters, numebers and dashes: [a-z0-9-]
- cannot start/end with dash

Comment 25 Fabien Dupont 2020-03-18 08:09:15 UTC
Closing as this is already in CFME 5.11.4 and we don't plan to backport.


Note You need to log in before you can comment on or make changes to this bug.