<div dir="ltr"><div>Nested hardware virtualization with KVM works on Travis, but not on GitHub actions.<br></div><div><br></div><div>I highly recommend we use it, even if it means maintaining some CI tests on travis rather than GHA.</div><div><br></div><div>I evaluated 2 other possible solutions on GitHub Actions: VirtualBox software virtualization, and qemu emulation.</div><div><br></div><div><div>I tested by creating prototype CI for Pulplift, and after spending many hours, had to resort to some manual testing of the other 2 alternatives' final steps. They do work though; they launch virtual/emulated machines.</div><div><a href="https://github.com/pulp/pulplift/pull/66">https://github.com/pulp/pulplift/pull/66</a></div></div><div><br></div><div>Test results:<br></div><div><br></div><div><div>Nested hardware virtualization with KVM works on Travis:</div><div>Pros:</div><div>- Fastest</div><div>- Very well featured<br></div><div>- Works with pulplift as-is</div><div>Cons:</div><div>- Cannot work on GHA, which use Azure legacy BIOS VMs, without nested Intel VT-X / AMD-V, as of Ubuntu 18.04. (Hoping for change with 20.04).<br></div><div>- May not work on Travis indefinitely. They use LXD now, but have no guarantees to keep using LXD with Intel VT-x / AMD-V enabled.<br></div><div><br></div><div>Software Virtualization with VirtualBox:</div><div>Pros:</div><div>- None really, just less slow than qemu</div><div>Cons:</div><div>- Limited to 32-bit x86 guest OS's. CentOS 7 32-bit x86 is unofficial, and Fedora 30 is the last 32-bit x86 Fedora. Neither are ideal for testing<br></div><div>- Slow: 1 vCPU, and slower than it was in the past (~2/3 of native CPU performance) back in 2006 or so when OS's used fewer hardware features.</div><div>- Support dropped as of VirtualBox 6.1, which just came out. 6.0 is only supported until 2020-07.<br></div><div>- Requires some changes to pulplift / box definitions to work<br></div><div><br></div><div>Emulation with Qemu:</div><div>Pros:</div><div></div><div>- Well-Supported</div><div>- Has all the other features of qemu-kvm, including emulated CPU count<br></div><div>- Needs only 1 easily-set setting needed for pulplift to work with it<br></div><div>Cons:</div><div>- Very slow. Rule of thumb is at best, 10% of native performance.</div><div><br></div><div>-Mike<br></div><div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 13, 2020 at 6:14 PM Mike DePaulo <<a href="mailto:mikedep333@redhat.com">mikedep333@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I've only tested Travis so far, but this is very promising.</div><div><br></div><div> Hardware KVM virtualization appears to be working on Travis, via pulplift (which uses vagrant, libvirt & KVM), without any hacks!<br></div><div><br></div><div>My current theory is that Travis uses either OpenVZ or KVM, and that the "svm" warning is a limitation of nested virtualization working properly.<br></div><div><br></div><div>I'm going to investigate Travis a little further before trying out GHA. (Or test them in parallel with same commands.) Including making 100% sure it is not falling back to unaccelerated qemu emulation.<br></div><div><br></div><div>$ uname -a<br>Linux travis-job-7dcf26ac-24c0-462e-8418-69c466817f8e 5.0.0-1026-gcp #27~18.04.1-Ubuntu SMP Fri Nov 15 07:40:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux<br></div><div><br></div><div><div>$ sudo virt-what<br>kvm</div></div><div><br></div><div>$ sudo qemu-system-x86_64 -machine accel=kvm -vnc <a href="http://127.0.0.1:1" target="_blank">127.0.0.1:1</a><br>qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000001H:ECX.svm [bit 2]</div><div>^C<br></div><div><br></div>$ sudo vagrant ssh fedora31<br>Last login: Thu Feb 13 22:55:40 2020 from 192.168.121.1<br>$ uname -a<br>Linux localhost.localdomain 5.3.7-301.fc31.x86_64 #1 SMP Mon Oct 21 19:18:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux<br>$ cat /etc/redhat-release <br>Fedora release 31 (Thirty One)<br><div><br></div><div><div>-Mike<br></div></div><div><br></div><div>-- </div><div dir="ltr"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:capitalize"><span>Mike</span> <span>DePaulo</span><span style="text-transform:uppercase;color:rgb(170,170,170);margin:0px"></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px 0px 4px;text-transform:capitalize">He / Him / His</p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px;text-transform:capitalize"><span>Service Reliability Engineer, Pulp</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px 0px 4px;font-size:12px"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat<span></span></a></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-bottom:4px"></div><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;font-size:12px"><span>IM: <span>mikedep333</span></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px"><span>GPG: 51745404</span></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-top:12px"><table border="0"><tbody><tr><td width="100px"><a href="https://www.redhat.com/" target="_blank"><img src="https://marketing-outfit-prod-images.s3-us-west-2.amazonaws.com/f5445ae0c9ddafd5b2f1836854d7416a/Logo-RedHat-Email.png" width="90" height="auto"></a></td></tr></tbody></table></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:capitalize"><span>Mike</span> <span>DePaulo</span><span style="text-transform:uppercase;color:rgb(170,170,170);margin:0px"></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px 0px 4px;text-transform:capitalize">He / Him / His</p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px;text-transform:capitalize"><span>Service Reliability Engineer, Pulp</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px 0px 4px;font-size:12px"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat<span></span></a></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-bottom:4px"></div><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;font-size:12px"><span>IM: <span>mikedep333</span></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px"><span>GPG: 51745404</span></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-top:12px"><table border="0"><tbody><tr><td width="100px"><a href="https://www.redhat.com/" target="_blank"><img src="https://marketing-outfit-prod-images.s3-us-west-2.amazonaws.com/f5445ae0c9ddafd5b2f1836854d7416a/Logo-RedHat-Email.png" width="90" height="auto"></a></td></tr></tbody></table></div></div></div></div>