Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CP-4321: Host edition upgrade rules

Free and XenDesktop licenses are left as is.
Advanced, Enterprise and Platinum licenses are converted to per-socket
license.
Anything else is made into a free license.

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information...
commit d47ca509864e98491fce84bd154031ce410f14d1 1 parent bbb01c4
@johnelse johnelse authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 ocaml/xapi/xapi_db_upgrade.ml
View
20 ocaml/xapi/xapi_db_upgrade.ml
@@ -46,6 +46,7 @@ let apply_upgrade_rules ~__context rules previous_version =
let george = Datamodel.george_release_schema_major_vsn, Datamodel.george_release_schema_minor_vsn
let cowley = Datamodel.cowley_release_schema_major_vsn, Datamodel.cowley_release_schema_minor_vsn
let boston = Datamodel.boston_release_schema_major_vsn, Datamodel.boston_release_schema_minor_vsn
+let tampa = Datamodel.tampa_release_schema_major_vsn, Datamodel.tampa_release_schema_minor_vsn
let upgrade_vm_memory_overheads = {
description = "Upgrade VM.memory_overhead fields";
@@ -311,6 +312,24 @@ let upgrade_pif_metrics = {
) phy_and_bond_pifs
}
+let upgrade_host_editions = {
+ description = "Upgrading host editions";
+ version = (fun x -> x <= tampa);
+ fn = fun ~__context ->
+ let hosts = Db.Host.get_all ~__context in
+ List.iter
+ (fun host ->
+ match Db.Host.get_edition ~__context ~self:host with
+ | "free" -> ()
+ | "enterprise-xd" ->
+ Db.Host.set_edition ~__context ~self:host ~value:"xendesktop"
+ | "advanced" | "enterprise" | "platinum" ->
+ Db.Host.set_edition ~__context ~self:host ~value:"per-socket"
+ | _ ->
+ Db.Host.set_edition ~__context ~self:host ~value:"free")
+ hosts
+}
+
let rules = [
upgrade_vm_memory_overheads;
upgrade_wlb_configuration;
@@ -323,6 +342,7 @@ let rules = [
upgrade_cpu_flags;
upgrade_auto_poweron;
upgrade_pif_metrics;
+ upgrade_host_editions;
]
(* Maybe upgrade most recent db *)
Please sign in to comment.
Something went wrong with that request. Please try again.