Bug 1923031 - VM name with upper-case letters passes validation (RFC-1123)
Summary: VM name with upper-case letters passes validation (RFC-1123)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Virtualization
Classification: Red Hat
Component: General
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.0.0
Assignee: Sam Lucidi
QA Contact: Amos Mastbaum
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-01 10:22 UTC by Amos Mastbaum
Modified: 2021-06-10 17:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-10 17:11:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2021:2381 0 None None None 2021-06-10 17:11:37 UTC

Description Amos Mastbaum 2021-02-01 10:22:25 UTC
Description of problem:

Migration of VM with one or more Upper Case letter passes MTV validation and only fails when trying to create the VM:

  Warning  VMCreationFailed  1s    virtualmachineimport-controller  Error while creating virtual machine openshift-migration/Aruvm: VirtualMachine.kubevirt.io "Aruvm" is invalid: metadata.name: Invalid value: "Aruvm": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')


Note: CentOS_7-, for example, does produces the expected results (post: https://github.com/konveyor/forklift-controller/pull/142) 



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Fabien Dupont 2021-04-07 11:16:23 UTC
Here, the validation service will catch it. It should be marked as "fatal", so the controller should not even try to migrate the VM and fail with the concern message.

Comment 2 Jeff Ortel 2021-04-08 13:03:05 UTC
Since this is a kubernetes (not CNV) limitation, Seems better for the plan controller, not the validation service, to validate this. The controller will need to perform a similar validation anyway should we support a user renaming the VM on the plan.

Comment 3 Fabien Dupont 2021-04-08 13:45:33 UTC
I think it's still valuable for the validation service to catch it, so that the concern is raised before creating the plan.
I also agree that it should also be a validation in the controller to fail as early as possible.

Comment 5 Fabien Dupont 2021-04-16 07:23:44 UTC
The fix should be part of build 2.0.0-17 / iib:66911.

Comment 6 Amos Mastbaum 2021-04-26 10:09:12 UTC
Verified MTV 2.0.0-20 (iib:69034)

Status:
  Conditions:
    Category:  Critical
    Items:
      vm-43
    Last Transition Time:  2021-04-26T10:07:36Z
    Message:               Target VM name not valid.
    Reason:                NotValid
    Status:                True
    Type:                  TargetNameNotValid
  Migration:
  Observed Generation:  1
Events:
  Type     Reason              Age   From  Message
  ----     ------              ----  ----  -------
  Warning  TargetNameNotValid  9s    plan  Target VM name not valid.

Comment 9 errata-xmlrpc 2021-06-10 17:11:27 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 (MTV 2.0.0 images), 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-2021:2381


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