diff -Nru landscape-client-16.03/debian/changelog landscape-client-16.03/debian/changelog --- landscape-client-16.03/debian/changelog 2017-11-24 18:05:52.000000000 +0000 +++ landscape-client-16.03/debian/changelog 2018-01-23 15:55:35.000000000 +0000 @@ -1,3 +1,13 @@ +landscape-client (16.03-0ubuntu2.16.04.3) xenial; urgency=medium + + * d/p/set-vm-info-to-kvm-for-aws-C5-instances.patch: + Sets vm_info to kvm for new AWS EC2 C5 instances. (LP: #1742531) + + * d/p/set-vm-info-to-kvm-for-digitalocean-instances.patch: + Sets vm_info to kvm for digitalocean instances. (LP: #1743232) + + -- Eric Desrochers Tue, 23 Jan 2018 10:53:42 -0500 + landscape-client (16.03-0ubuntu2.16.04.2) xenial; urgency=medium [ Simon Poirier ] diff -Nru landscape-client-16.03/debian/patches/series landscape-client-16.03/debian/patches/series --- landscape-client-16.03/debian/patches/series 2017-11-24 18:05:52.000000000 +0000 +++ landscape-client-16.03/debian/patches/series 2018-01-23 15:55:35.000000000 +0000 @@ -4,3 +4,5 @@ iso-configuration-1699789.diff autoremovable-report-1208393.diff config-no-reregister-1618483.diff +set-vm-info-to-kvm-for-aws-C5-instances.patch +set-vm-info-to-kvm-for-digitalocean-instances.patch diff -Nru landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-aws-C5-instances.patch landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-aws-C5-instances.patch --- landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-aws-C5-instances.patch 1970-01-01 00:00:00.000000000 +0000 +++ landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-aws-C5-instances.patch 2018-01-23 15:55:35.000000000 +0000 @@ -0,0 +1,41 @@ +Description: New Amazon AWS C5 instances are not recognised as kvm. + The new Amazon AWS C5 instance type is not a recognised VM type in + Landscape and thus won't allow use of a Virtual Guest asset to register with. + The C5 instance type is a new type that uses a KVM-family hypervisor instead + of Xen (displaying "Amazon EC2" in sys_vendor which landscape-client doesn't + recognise, thus cannot associate/map to kvm). +Author: Simon Poirier +Origin: upstream, https://github.com/CanonicalLtd/landscape-client/commit/10bf98b860d2efed98f47ab510d8784df5da346c +Bug: https://bugs.launchpad.net/bugs/1742531 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1742531 +Index: landscape-client-16.03/landscape/lib/tests/test_vm_info.py +=================================================================== +--- landscape-client-16.03.orig/landscape/lib/tests/test_vm_info.py ++++ landscape-client-16.03/landscape/lib/tests/test_vm_info.py +@@ -76,6 +76,14 @@ class GetVMInfoTest(LandscapeTest): + + self.assertEqual("", get_vm_info(root_path=self.root_path)) + ++ def test_get_vm_info_with_ec2_sys_vendor(self): ++ """ ++ get_vm_info should return "kvm" when sys_vendor is "Amazon EC2", ++ which is the case for C5 instances which are based on KVM. ++ """ ++ self.make_sys_vendor("Amazon EC2") ++ self.assertEqual("kvm", get_vm_info(root_path=self.root_path)) ++ + def test_get_vm_info_with_bochs_sys_vendor(self): + """ + L{get_vm_info} should return "kvm" when we detect the sys_vendor is +Index: landscape-client-16.03/landscape/lib/vm_info.py +=================================================================== +--- landscape-client-16.03.orig/landscape/lib/vm_info.py ++++ landscape-client-16.03/landscape/lib/vm_info.py +@@ -66,6 +66,7 @@ def _get_vm_by_vendor(sys_vendor_path): + vendor = read_file(sys_vendor_path).lower() + # Use lower-key string for vendors, since we do case-insentive match. + content_vendors_map = ( ++ ("amazon ec2", "kvm"), + ("bochs", "kvm"), + ("google", "gce"), + ("innotek", "virtualbox"), diff -Nru landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-digitalocean-instances.patch landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-digitalocean-instances.patch --- landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-digitalocean-instances.patch 1970-01-01 00:00:00.000000000 +0000 +++ landscape-client-16.03/debian/patches/set-vm-info-to-kvm-for-digitalocean-instances.patch 2018-01-23 15:55:35.000000000 +0000 @@ -0,0 +1,47 @@ +Description: Some digitalocean instances are not recognised as kvm. + Some digiticalocean instance type is not a recognised VM type in + Landscape and thus won't allow use of a Virtual Guest asset to register with. + The digitalocean instance type uses a KVM-family hypervisor with a custom naming: + "DigitalOcean" in sys_vendor which landscape-client doesn't recognise, + thus cannot associate/map to kvm). +Author: Simon Poirier +Origin: upstream, https://github.com/CanonicalLtd/landscape-client/commit/6231b9b +Bug: https://bugs.launchpad.net/bugs/1743232 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1743232 +Index: landscape-client-16.03/landscape/lib/tests/test_vm_info.py +=================================================================== +--- landscape-client-16.03.orig/landscape/lib/tests/test_vm_info.py ++++ landscape-client-16.03/landscape/lib/tests/test_vm_info.py +@@ -84,6 +84,13 @@ class GetVMInfoTest(LandscapeTest): + self.make_sys_vendor("Amazon EC2") + self.assertEqual("kvm", get_vm_info(root_path=self.root_path)) + ++ def test_get_vm_info_with_digitalocean_sys_vendor(self): ++ """ ++ get_vm_info should return "kvm" when sys_vendor is "DigitalOcean". ++ """ ++ self.make_sys_vendor("DigitalOcean") ++ self.assertEqual("kvm", get_vm_info(root_path=self.root_path)) ++ + def test_get_vm_info_with_bochs_sys_vendor(self): + """ + L{get_vm_info} should return "kvm" when we detect the sys_vendor is +Index: landscape-client-16.03/landscape/lib/vm_info.py +=================================================================== +--- landscape-client-16.03.orig/landscape/lib/vm_info.py ++++ landscape-client-16.03/landscape/lib/vm_info.py +@@ -65,9 +65,14 @@ def _get_vm_by_vendor(sys_vendor_path): + """Return the VM type string (possibly empty) based on the vendor.""" + vendor = read_file(sys_vendor_path).lower() + # Use lower-key string for vendors, since we do case-insentive match. ++ ++ # 2018-01: AWS and DO are now returning custom sys_vendor names ++ # instead of qemu. If this becomes a trend, it may be worth also checking ++ # dmi/id/chassis_vendor which seems to unchanged (bochs). + content_vendors_map = ( + ("amazon ec2", "kvm"), + ("bochs", "kvm"), ++ ("digitalocean", "kvm"), + ("google", "gce"), + ("innotek", "virtualbox"), + ("microsoft", "hyperv"),