Red Hat Bugzilla – Bug 1308778
Windows VM name validation is limited to 15 chars, no indication that sysinit VM hostname should be used
Last modified: 2016-05-14 03:37:50 EDT
Created attachment 1127485 [details]
sceenshot of "Invalid error" when import guests from export domain
Invalid name shows when try to import windows guest from export domain to data domain after virt-v2v
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.
Guest can be imported to rhev 3.6 successfully from export domain to data domain.
Tried rhev 3.5,windows guest can be imported from export domain to data domain successfully.
Created attachment 1127486 [details]
engine log from rhevm server
I think we're going to need /var/log/vdsm/vdsm.log from the SPM.
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
(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.
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
(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.
Created attachment 1127559 [details]
vdsm log file
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
(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.
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.
*** Bug 1336047 has been marked as a duplicate of this bug. ***