Bug 1308778 - Windows VM name validation is limited to 15 chars, no indication that sysinit VM hostname should be used
Windows VM name validation is limited to 15 chars, no indication that sysinit...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.6.2
Unspecified Unspecified
high Severity medium
: ovirt-3.6.5
: 3.6.5
Assigned To: Shahar Havivi
Ilanit Stein
: ZStream
: 1336047 (view as bug list)
Depends On:
Blocks: 1309612
  Show dependency treegraph
 
Reported: 2016-02-15 22:07 EST by tingting zheng
Modified: 2016-05-14 03:37 EDT (History)
18 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Windows VM names was limited to 15 characters when creating a new VM. The new limitation is 64 aligned with Linux and other os (Note: only the windows limit change in this fix) The 15 characters limitation needs only for Windows Sysprep so we do limit it in Sysprep section on new VM. Important Note: If the user will not set the Sysprep VM name we will take it from the actual VM name - which is same as we use to, how ever we do corp it to 15 characters if the actual VM name is longer then 15 characters.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-25 10:08:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
sceenshot of "Invalid error" when import guests from export domain (174.27 KB, image/jpeg)
2016-02-15 22:07 EST, tingting zheng
no flags Details
engine log from rhevm server (1011.55 KB, text/plain)
2016-02-15 22:08 EST, tingting zheng
no flags Details
vdsm log file (28.19 KB, text/plain)
2016-02-16 05:44 EST, tingting zheng
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 53659 master MERGED core: fix windows vm name length validator 2016-02-24 03:04 EST
oVirt gerrit 53660 master MERGED core: limit sysprep net-bios name to 15 chars 2016-02-24 03:05 EST
oVirt gerrit 53708 master MERGED ui: Windows VM name validation is limited to 15 chars in sysprep 2016-02-24 03:05 EST
oVirt gerrit 53954 ovirt-engine-3.6 MERGED core: fix windows vm name length validator 2016-02-24 05:43 EST
oVirt gerrit 53955 ovirt-engine-3.6 MERGED core: limit sysprep net-bios name to 15 chars 2016-02-24 05:44 EST
oVirt gerrit 53956 ovirt-engine-3.6 MERGED ui: Windows VM name validation is limited to 15 chars in sysprep 2016-02-24 06:54 EST

  None (edit)
Description tingting zheng 2016-02-15 22:07:15 EST
Created attachment 1127485 [details]
sceenshot of "Invalid error" when import guests from export domain

Description:
Invalid name shows when try to import windows guest from export domain to data domain after virt-v2v

Version:
virt-v2v-1.32.2-2.el7.x86_64
rhevm-3.6.2.6-0.1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1.Use virt-v2v to convert a windows guest to rhev.
# virt-v2v  -ic qemu:///system -o rhev -os 10.73.69.63:/home/nfs_export -of raw -b ovirtmgmt -n ovirtmgmt kvm-win2008-i386-qcow2

2.After conversion,check on rhev GUI,under export domain,choose the guest and click "Import"->"OK",there is warning box "Invalid name" and guest can not be imported on rhev.

3.The scenario is a bit confusing.
3.1 Change guest name in step 2 to something like "kvm-win2008" or "test",it can be imported successfully.
3.2 Use virt-v2v to convert a linux guest to rhev,
eg:# virt-v2v  -ic xen+ssh://10.66.106.64/ -o rhev -os 10.73.69.63:/home/nfs_export -of raw -b ovirtmgmt -n ovirtmgmt xen-pv-rhel6.7-i386
The guest can be imported successfully.

3.3 Change guest name in step 3.2 from "xen-pv-rhel6.7-i386" to "kvm-win2008-i386-qcow2"(this one which fails in step 3.1),guest can be imported successfully.
3.4 Tried other windows guest,each fails as step 3.1,linux guest can be imported successfully.


Actual results:
As description.

Expected results:
Guest can be imported to rhev 3.6 successfully from export domain to data domain.

Additional info:
Tried rhev 3.5,windows guest can be imported from export domain to data domain successfully.
Comment 1 tingting zheng 2016-02-15 22:08 EST
Created attachment 1127486 [details]
engine log from rhevm server
Comment 2 Richard W.M. Jones 2016-02-16 04:06:28 EST
I think we're going to need /var/log/vdsm/vdsm.log from the SPM.

http://libguestfs.org/virt-v2v.1.html#debugging-rhev-m-import-failures
Comment 3 Michal Skrivanek 2016-02-16 04:22:36 EST
The name exceeds allowed length for Windows names (limited by netbios) which is 15 characters. Standalone virt-v2v does not have that validation, but such VM is not allowed in UI

Bug 906243 was supposed to remove that limitation, but apparently it was not fixed correctly
Comment 4 Michal Skrivanek 2016-02-16 04:24:37 EST
(In reply to Richard W.M. Jones from comment #2)
> I think we're going to need /var/log/vdsm/vdsm.log from the SPM.
> 
> http://libguestfs.org/virt-v2v.1.html#debugging-rhev-m-import-failures

I think this is purely a RHEVM problem, v2v seems to work in all cases. Additional netbios lenght validation is IMHO out of scope for command line usage, we just need to fix bug 906243 properly
Comment 5 tingting zheng 2016-02-16 05:38:21 EST
(In reply to Michal Skrivanek from comment #3)
> The name exceeds allowed length for Windows names (limited by netbios) which
> is 15 characters. Standalone virt-v2v does not have that validation, but
> such VM is not allowed in UI
> 
> Bug 906243 was supposed to remove that limitation, but apparently it was not
> fixed correctly

For linux guest,eg:xen-pv-rhel6.7-i386 which name exceeds 15 characters can be imported successfully,and if I change the linux guest name(xen-pv-rhel6.7-i386) to the one which fail to import(kvm-win2008-i386-qcow2) and the linux guest with the new name can be imported successfully.
Comment 6 tingting zheng 2016-02-16 05:44 EST
Created attachment 1127559 [details]
vdsm log file
Comment 7 Richard W.M. Jones 2016-02-16 06:52:44 EST
I think what Michal is saying is that the limit is different for
Linux and Windows guests.  We pass to RHEV the information that
the guest is Windows, so it could in theory do something different.

Unfortunately I can't find the "invalid name" error in the vdsm.log
either :-(
Comment 8 Michal Skrivanek 2016-02-17 02:13:11 EST
(In reply to Richard W.M. Jones from comment #7)
> I think what Michal is saying is that the limit is different for
> Linux and Windows guests.  We pass to RHEV the information that
> the guest is Windows, so it could in theory do something different.
> 
> Unfortunately I can't find the "invalid name" error in the vdsm.log
> either :-(

yeah. And this is purely engine side limitation. Let me take over this bug and change its scope a bit.

Shahar - the fix in bug 906243 is not entirely correct. The point was to remove the 15 chars limitation from VM name and "move" that limit to the newly created VM hostname field under sysprep options. This is what's missing:
- change the validation of VM name to use only a single value shared with Linux OSes(64)
- warn (red box) when VM name exceeds the Windows name limit(15) and there is no alternative defined in sysprep's hostname field
    alternatively - just set that sysprep field to the same string cropped to 15 chars, and put a (?) with explanation there. This is less intrusive to users who do not care about sysprep
- apply the Windows length on VM hostname under sysprep (currently not being validated at all)

I kind of like the cropped name as it would solve the original problem as well. Otherwise you would still need to define a shorter name on import/v2v.
Comment 9 Ilanit Stein 2016-04-06 09:26:19 EDT
Verified on rhevm 3.6.5-0.1, by these actions:

1. Windows VM name (From UI, in Edit VM, General tab), can exceed 15 chars.

2. Verified on a Windows 2008 R2 VM, created from a sealed template, 
Run once->InitialRun-> VM Hostname validation do not exceed 15 chars.
Also checked inside guest, computer name is set by VM hostname value. 

3. For Windows VM name > 15 chars, checked that VM host name (guest computer name) is cropped to the first 15 chars.
Comment 10 Eyal Edri 2016-04-25 10:08:44 EDT
3.6.5 released
Comment 11 Michal Skrivanek 2016-05-14 03:37:50 EDT
*** Bug 1336047 has been marked as a duplicate of this bug. ***

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