Bug 1919855

Summary: [OSP 16.2] Can't launch instance if name ends with a number
Product: Red Hat OpenStack Reporter: Stephen Finucane <stephenfin>
Component: openstack-novaAssignee: Stephen Finucane <stephenfin>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: high    
Version: 16.2 (Train)CC: chhu, dasmith, eglynn, gregraka, jamsmith, jhakimra, jmelvin, juzhou, kchamart, ljozsa, ltamagno, lyarwood, mxie, mzhan, nova-maint, pkesavar, sbauza, sgordon, smooney, stephenfin, tyan, tzheng, vromanso, xiaodwan
Target Milestone: AlphaKeywords: Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-20.4.2-2.20210127094933.8378786.el8ost Doc Type: Bug Fix
Doc Text:
When an instance is created, the Compute service (nova) sanitizes the instance display name to generate a valid hostname when DNS integration is enabled in the Networking service (neutron). + Before this update, the sanitization did not replace periods ('.') in instance names, for example, 'rhel-8.4'. This could result in display names being recognized as Fully Qualified Domain Names (FQDNs) which produced invalid hostnames. When instance names contained periods and DNS integration was enabled in the Networking service, the Networking service rejected the invalid hostname, which resulted in a failure to create the instance and a HTTP 500 server error from the Compute service. + With this update, periods are now replaced by hyphens in instance names to prevent hostnames being parsed as FQDNs. You can continue to use free-form strings for instance display names.
Story Points: ---
Clone Of: 1872314 Environment:
Last Closed: 2021-09-15 07:11:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1872314    

Description Stephen Finucane 2021-01-25 09:59:57 UTC
+++ This bug was initially created as a clone of Bug #1872314 +++

Description of problem:
Can't launch volume as instance on RHOSP16.1 if instance name ends with a number


Version-Release number of selected component (if applicable):
id: RHOS-16.1-RHEL-8-20200723.n.0

Package version of compute node of RHOSP16.1
libvirt-client-6.0.0-17.2.module+el8.2.0+6629+3fc0f2c2.x86_64
qemu-kvm-4.2.0-19.module+el8.2.0+6296+6b821950.x86_64
overcloud-novacompute-0 4.18.0-193.13.2.el8_2.x86_64 


How reproducible:
100%

Steps to Reproduce:
1. Convert a guest from VMware to openstack by v2v 
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA  esx6.7-ubuntu18.04-x86_64 -o openstack -oo server-id=rhel8.3-v2v-osp16-server  -oo server-id=rhel8.3-v2v-osp16-server  -oo os-username=admin -oo os-auth-url=http://192.168.24.16:5000 -oo os-password=redhat -oo os-project-name=admin -oo os-user-domain-name=default -oo os-project-domain-name=default -oo os-identity-api-version=3 -ip /home/passwd
[   1.6] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-ubuntu18.04-x86_64 -it vddk  -io vddk-libdir=/home/vmware-vix-disklib-distrib -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   3.3] Creating an overlay to protect the source from being modified
[   4.2] Opening the overlay
[  13.6] Inspecting the overlay
[  21.9] Checking for sufficient free disk space in the guest
[  21.9] Estimating space required on target for each disk
[  21.9] Converting Ubuntu 18.04.3 LTS to run on KVM
virt-v2v: warning: could not determine a way to update the configuration of 
Grub2
virt-v2v: This guest has virtio drivers installed.
[  97.2] Mapping filesystem data to avoid copying unused and blank areas
[ 101.8] Closing the overlay
[ 102.1] Assigning disks to buses
[ 102.1] Checking if the guest needs BIOS or UEFI to boot
[ 102.1] Initializing the target -o openstack
Failed to set volume read-only access mode flag: Invalid volume: Volume 877aca84-9fc4-41c3-9bad-ccd579f7f096 status must be available to update readonly flag, but current status is: creating. (HTTP 400) (Request-ID: req-691b758b-b495-4d80-8dcd-0f60563b59e2)
[ 122.2] Copying disk 1/1 to /dev/disk/by-id/virtio-877aca84-9fc4-41c3-9 (raw)
    (100.00/100%)
[ 614.4] Creating output metadata
[ 621.4] Finishing off

2.Try to launch the volume as instance on OSP16 dashboard, but find failed to launch volume as instance if instance name ends with a number, pls refer to screenshot "instance-name-end-with-number.png" 


3.Check nova-compute log in compute node, found below error:
2020-08-25 13:21:03.737 7 ERROR nova.compute.manager [req-dd27a4f5-432f-4656-bd58-3722531493dc 9c197202fce24d9f8dcc95c23d4af583 3ccefcef669147dcbd6139347a5da986 - default default] [instance: 37ea6a40-e236-4b12-9845-988215ec1d10] Failed to build and run instance: neutronclient.common.exceptions.BadRequest: Invalid input for dns_name. Reason: 'ubuntu18.04' not a valid PQDN or FQDN. Reason: TLD '04' must not be all numeric.

Actual results:
As above description


Expected results:
Can launch volume as instance on RHOSP16.1 if instance name ends with a number

Additional infoļ¼š
Can launch volume as instance on RHOSP14 if instance name ends with a number

Comment 15 errata-xmlrpc 2021-09-15 07:11: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 (Red Hat OpenStack Platform (RHOSP) 16.2 enhancement 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-2021:3483