Bug 1308778 - Windows VM name validation is limited to 15 chars, no indication that sysinit VM hostname should be used
Summary: Windows VM name validation is limited to 15 chars, no indication that sysinit...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.6.2
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-3.6.5
: 3.6.5
Assignee: Shahar Havivi
QA Contact: Ilanit Stein
URL:
Whiteboard:
: 1336047 (view as bug list)
Depends On:
Blocks: 1309612
TreeView+ depends on / blocked
 
Reported: 2016-02-16 03:07 UTC by tingting zheng
Modified: 2016-05-14 07:37 UTC (History)
18 users (show)

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.
Clone Of:
Environment:
Last Closed: 2016-04-25 14:08:44 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1309612 0 unspecified CLOSED Increase RHEV Windows VM name lengths to 256 characters 2021-02-22 00:41:40 UTC
oVirt gerrit 53659 0 master MERGED core: fix windows vm name length validator 2016-02-24 08:04:26 UTC
oVirt gerrit 53660 0 master MERGED core: limit sysprep net-bios name to 15 chars 2016-02-24 08:05:05 UTC
oVirt gerrit 53708 0 master MERGED ui: Windows VM name validation is limited to 15 chars in sysprep 2016-02-24 08:05:35 UTC
oVirt gerrit 53954 0 ovirt-engine-3.6 MERGED core: fix windows vm name length validator 2016-02-24 10:43:01 UTC
oVirt gerrit 53955 0 ovirt-engine-3.6 MERGED core: limit sysprep net-bios name to 15 chars 2016-02-24 10:44:34 UTC
oVirt gerrit 53956 0 ovirt-engine-3.6 MERGED ui: Windows VM name validation is limited to 15 chars in sysprep 2016-02-24 11:54:18 UTC

Internal Links: 1309612

Description tingting zheng 2016-02-16 03:07:15 UTC
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-16 03:08:19 UTC
Created attachment 1127486 [details]
engine log from rhevm server

Comment 2 Richard W.M. Jones 2016-02-16 09:06:28 UTC
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 09:22:36 UTC
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 09:24:37 UTC
(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 10:38:21 UTC
(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 10:44:50 UTC
Created attachment 1127559 [details]
vdsm log file

Comment 7 Richard W.M. Jones 2016-02-16 11:52:44 UTC
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 07:13:11 UTC
(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 13:26:19 UTC
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 14:08:44 UTC
3.6.5 released

Comment 11 Michal Skrivanek 2016-05-14 07:37:50 UTC
*** 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.