From 69cbb9445de049741a8c619570ef73dbf64c2628 Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Wed, 13 Jan 2016 13:26:37 +0000 Subject: [PATCH 1/2] CA-187681: xs-tools ISO doesn't get mounted on dlvm xva(Centos 7 HVM) There were times when "HasUpgradeSupportInManagementAgent" was needed, but not anymore, so this commit is changing code to use only VirtualisationStatus.MANAGEMENT_INSTALLED again. --- XenAdmin/TabPages/GeneralTabPage.cs | 6 +----- XenModel/XenAPI-Extensions/VM.cs | 12 ------------ 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/XenAdmin/TabPages/GeneralTabPage.cs b/XenAdmin/TabPages/GeneralTabPage.cs index ab449e49d..f30d6f73d 100644 --- a/XenAdmin/TabPages/GeneralTabPage.cs +++ b/XenAdmin/TabPages/GeneralTabPage.cs @@ -1304,11 +1304,7 @@ namespace XenAdmin.TabPages var gm = vm.Connection.Resolve(vm.guest_metrics); bool isIoOptimized = gm != null && gm.network_paths_optimized && gm.storage_paths_optimized; - - //vmtype is not yet implemented (will likely have different name) in XAPI, but this is the type that refers to the windows update readyness/capability of the VM and is expected to have the following values: yes, no, dontknow, got_it - bool isManagementAgentInstalled = vm.HasUpgradeSupportInManagementAgent //&& vmtype != no" - || vm.HasRDP; //&& vmtype == no; - + bool isManagementAgentInstalled = vm.GetVirtualisationStatus.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED); bool canInstallIoDriversAndManagementAgent = InstallToolsCommand.CanExecute(vm) && !isIoOptimized; bool canInstallManagementAgentOnly = InstallToolsCommand.CanExecute(vm) && isIoOptimized && !isManagementAgentInstalled; //canInstallIoDriversOnly is missing - management agent communicates with XS using the I/O drivers diff --git a/XenModel/XenAPI-Extensions/VM.cs b/XenModel/XenAPI-Extensions/VM.cs index c3ef5013c..e2b2fcc84 100644 --- a/XenModel/XenAPI-Extensions/VM.cs +++ b/XenModel/XenAPI-Extensions/VM.cs @@ -458,18 +458,6 @@ namespace XenAPI } } - public bool HasUpgradeSupportInManagementAgent - { - get - { - var metrics = Connection.Resolve(this.guest_metrics); - if (metrics == null) - return false; - - return 0 != IntKey(metrics.other, "feature-supports-driver-update", 0); - } - } - /// Returns true if /// 1) the guest is HVM and /// 2a) the allow-gpu-passthrough restriction is absent or From 89a91bd2475df59c3b2d0f4b815a2e1de9d0ecae Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Wed, 20 Jan 2016 12:13:35 +0000 Subject: [PATCH 2/2] CA-187681: Improvement for VM.IsWindows property vm.guest_metrics.PV_drivers_up_to_date is obsolete (and can be wrong) for new type Windows VMs and this led to early escape from this action. --- XenModel/Actions/VM/InstallPVToolsAction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XenModel/Actions/VM/InstallPVToolsAction.cs b/XenModel/Actions/VM/InstallPVToolsAction.cs index f1a62d273..d309b5cdd 100644 --- a/XenModel/Actions/VM/InstallPVToolsAction.cs +++ b/XenModel/Actions/VM/InstallPVToolsAction.cs @@ -92,7 +92,7 @@ namespace XenAdmin.Actions // Check the version (if any) of the PV tools already on this host... VM_guest_metrics guestMetrics = Connection.Resolve(VM.guest_metrics); - if (guestMetrics != null && guestMetrics.PV_drivers_up_to_date) + if (guestMetrics != null && !VM.HasNewVirtualisationStates && guestMetrics.PV_drivers_up_to_date) { this.Description = Messages.INSTALLTOOLS_EXIST; return;