khos2ow commented on a change in pull request #2824: Fix SystemVMs running in 
Xen HVM mode are not configured (#2760)
URL: https://github.com/apache/cloudstack/pull/2824#discussion_r215125250
 
 

 ##########
 File path: systemvm/debian/opt/cloud/bin/setup/cloud-early-config
 ##########
 @@ -51,6 +45,19 @@ hypervisor() {
     fi
   fi
 
+  [ -x /usr/sbin/virt-what ] && local facts=( $(virt-what) )
+  if [ "$facts" != "" ]; then
+    # Xen HVM is recognized as Hyperv when Viridian extensions are enabled
+    if [ "${facts[-1]}" == "xen-domU" ] && [ "${facts[0]}" == "hyperv" ]; then
 
 Review comment:
   From XenServer only point of view, this block of code is redundant. Because 
result of `dmesg | grep -q "Xen HVM"` on HVM instance on XenServer, line 41, 
will work 100% of the time. The gotcha point of this function is to look for 
hvm on xen the first thing and if not a match let the rest of the function try 
to detect the _type_.
   
   A while back I had the same issue and did a non-conclusive investigation 
about how `virt-what` works, and was actually getting all sorts of 
results/order on HVM and PV instance on Xen Server. Essentially the workaround 
I came up with the same as mentioned above.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to