Bug 1722416

Summary: [V2V][UI] UI does not validate VM name for migration
Product: OpenShift Container Platform Reporter: Maayan Hadasi <mguetta>
Component: Console Kubevirt PluginAssignee: Brett Thurber <bthurber>
Status: CLOSED ERRATA QA Contact: Igor Braginsky <ibragins>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aos-bugs, apinnick, bthurber, cnv-qe-bugs, dagur, fkrepins, ibragins, istein, ncredi, tjelinek
Target Milestone: ---Keywords: Reopened
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.2.0-0.nightly-2019-08-15-073735 Doc Type: Known Issue
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-30 16:27:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maayan Hadasi 2019-06-20 10:03:56 UTC
Description of problem:
According to DNS-1123 spec - the VM and disk names can contain '.'
But actually the creation of VM failed in case of one of them include '.'


Version-Release number of selected component (if applicable):
HCO_BUNDLE_REGISTRY_TAG: v2.0.0-29


How reproducible:
100%


Steps to Reproduce:
1. Start migration procedure
2. Give machine/disk name that include the character '.'


Actual results:
No validation error is shown while insert '.' in the machine/disk name, but finally the creation of VM failed 


Additional info:
The error message that displayed in the last step:

Error "spec.template.spec.hostname does not conform to the kubernetes DNS_LABEL rules : a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')" for field "spec.template.spec.hostname".

Please note: there is no mention about '.'

Comment 3 Avital Pinnick 2019-06-23 08:03:12 UTC
Re-opening this bug at Maayan's request and targeting for UI.

Migration fails if a migrating VM contains a period (.), space, or international characters.

UI should check the VM name and raise a warning to the user if a migrating VM name is not valid.

Comment 6 Ilanit Stein 2019-06-24 14:27:42 UTC
Clarification:

This bug is about that the "Frontend" validation should fail, for VM/Disk name containing a period.

( In UI 'Create with Wizard' dialog, validation for both: 
 * 'Basic settings' card: VM name
 * 'Storage' card: Disk name 
)
Current state is that the "Backend" validation fails.

Current "Frontend" validation does fail for other characters, that are not allowed, like Upper case, or "_".
However it DO NOT fail for ".", which is included in the DNS-1123 spec. 


Regarding the documentation, mentioned in comment #2:

Avital,
Would you please add that the naming limitations also refer to Disk name, and not only to VM name?

Comment 7 Tomas Jelinek 2019-06-25 11:25:11 UTC
OK, after an offline discussion with Ilanit, this is a UI bug that the '.' sign is not validated on frontend. As agreed, this is not a 2.0 blocker, moving to 2.1.
Ilanit will open a followup doc bug to mention that the '.' is not a valid character.

Comment 8 Filip Krepinsky 2019-07-23 14:02:27 UTC
https://github.com/openshift/console/pull/2126

Comment 9 Nelly Credi 2019-11-04 12:30:00 UTC
should this move to ON QA?

Comment 10 Brett Thurber 2019-11-04 21:38:55 UTC
(In reply to Nelly Credi from comment #9)
> should this move to ON QA?

Yes it should.  @Daniel?

Comment 11 Daniel Gur 2019-11-05 10:45:37 UTC
I think it should automatically mobe to ON-QE once the target DS build  (2.1.1) is delivered to QE. 
Once we get the build with the fix will validate it.

Comment 12 Ilanit Stein 2019-12-24 16:20:10 UTC
On CNV-2.2.0-10, and Openshift console 
4.3.0-0.nightly-2019-12-19-050538 

There is a validation error if the VM/Disk Name include a '.',
at the stage of filling the Import VM dialog.
Previously on CNV-2.0 the Import VM dialog did not validate that. Import VM dialog was passing and the Import itself was failing on this.

Now, on CNV -2.2.0-10,
* VM name:
Name*
mini.
Name has to end with alphanumeric character. '.' characters are not allowed.

* Disk name:
Name*
hdd.
Name has to end with alphanumeric character. '.' characters are not allowed.

Comment 14 errata-xmlrpc 2020-01-30 16:27:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:0307