Bug 1562602 - VM with special characters failed to start
Summary: VM with special characters failed to start
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.2.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.3.0
: 4.3.0
Assignee: Andrej Krejcir
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-01 11:52 UTC by Nisim Simsolo
Modified: 2019-02-13 07:46 UTC (History)
7 users (show)

Fixed In Version: ovirt-engine-4.3.0_alpha
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-13 07:46:48 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.3+


Attachments (Terms of Use)
engine.log (2.62 MB, text/plain)
2018-04-01 11:53 UTC, Nisim Simsolo
no flags Details
vdsm.log (524.13 KB, application/x-xz)
2018-04-01 11:54 UTC, Nisim Simsolo
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 95193 0 master MERGED virt: xml: Escape VM name inserted into placeholder domain XML 2018-11-06 08:03:13 UTC
oVirt gerrit 95226 0 master MERGED core: Validate VM name on import 2018-11-15 15:50:48 UTC

Description Nisim Simsolo 2018-04-01 11:52:09 UTC
Description of problem:
Trying to run the next VM which was imported from VMware and include special characters:  
centos44%/\&+=?!@#$^*()[]
failed with the next engine.log error:

2018-04-01 14:22:29,946+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedThreadFactory-engineScheduled-Thread-67) [] EVENT_ID: VM_DOWN_ERROR(119), VM centos44%/\&+=?!@#$^*()[]1 is down with error. Exit message: (domain_definition):2: xmlParseEntityRef: no name
  <name>centos44%/\&+=?!@#$^*()[]1</name>

- another issue with it is that in RHV, only the next special chars are valid: "." "," "_" "-"
and importing from external provider is allowing other chars to be included in VM name.

- Removing these chars from VM name is solving the "running VM" issue. 
- At the past there were no issues with running such VM.

Version-Release number of selected component (if applicable):
rhvm-4.2.2.6-0.1.el7
libvirt-client-3.9.0-14.el7_5.2.x86_64
qemu-kvm-rhev-2.10.0-21.el7_5.1.x86_64
sanlock-3.6.0-1.el7.x86_64
vdsm-4.20.23-1.el7ev.x86_64
virt-v2v-1.36.10-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Import VM with special chars from external provider.
2. Run VM
3.

Actual results:
VM failed to start.

Expected results:
VM should run, or an appropriate message related to these chars should appear.

Additional info:
engine.log and vdsm.log attached

Comment 1 Nisim Simsolo 2018-04-01 11:53:51 UTC
Created attachment 1415790 [details]
engine.log

Comment 2 Nisim Simsolo 2018-04-01 11:54:13 UTC
Created attachment 1415791 [details]
vdsm.log

Comment 3 Michal Skrivanek 2018-04-16 12:49:10 UTC
can you try that?

Comment 4 Milan Zamazal 2018-04-16 14:20:01 UTC
I could observe at least three problems:

- libvirt doesn't permit `/' character in VM name.
- `&' is not escaped when passed for the first time to libvirt, so an invalid XML is provided to libvirt.
- The second libvirt defineXML call fails, apparently due to changed VM name, perhaps escaping is applied this time.

So it looks like at least one XML escaping problem in Vdsm (XML received from Engine looks OK) and the libvirt constraint on `/'.

Comment 5 Michal Skrivanek 2018-04-16 15:02:10 UTC
we'll see if there is anything to backport, hopefully it's not going to be a problem

Comment 7 Ryan Barry 2018-11-01 18:12:04 UTC
After speaking with Milan/Michal, let's also run it through validation in the engine.

Andrej, can you pick it up from there?

Comment 8 meital avital 2018-11-21 15:23:54 UTC
I'm not sure what is the expected behavior now in order to verify this bug. 
The current behavior when trying to import VM named: RHEL7_2-invalid-name-44%/\&+=?!@#$^*()[]:
is:
the second import dialog rejects the action when clicking "ok" button with the next "operation canceled" pop-up message: 

Error while executing action: 
"
RHEL7_2-invalid-name-44%/\&+=?!@#$^*()[]:
Can not import VM. The given name contains special characters. Only lower-case and upper-case letters, numbers, '_', '-', '.' are allowed.
Attribute: vm.vmStatic.name
"

Is that the expected behavior in such case?

Comment 9 Andrej Krejcir 2018-11-21 15:36:39 UTC
Yes, that is expected. It should not be possible to import a VM with invalid name, using UI or API.

Maybe we could improve the UI, if the popup is too inconvenient, but it works.

Comment 10 Sandro Bonazzola 2018-11-26 15:37:11 UTC
Referenced in vdsm v4.30.3 despite this bug is on ovirt-engine

Comment 11 Milan Zamazal 2018-11-26 16:03:56 UTC
There were fixes in both Vdsm and Engine.

Comment 12 meital avital 2018-11-28 09:57:05 UTC
Verified on:
ovirt-engine-4.3.0-0.2.master.20181121071050.gita8fcd23.el7.noarch

Comment 13 Sandro Bonazzola 2019-02-13 07:46:48 UTC
This bugzilla is included in oVirt 4.3.0 release, published on February 4th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.0 release, it has been closed with a resolution of CURRENT RELEASE.

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


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