rhtyd closed pull request #2799: systemvmtemplate: new 4.11.2 template and fixes
URL: https://github.com/apache/cloudstack/pull/2799
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/engine/schema/resources/META-INF/db/schema-41110to41120-cleanup.sql 
b/engine/schema/resources/META-INF/db/schema-41110to41120-cleanup.sql
new file mode 100644
index 00000000000..790b2d1f1ff
--- /dev/null
+++ b/engine/schema/resources/META-INF/db/schema-41110to41120-cleanup.sql
@@ -0,0 +1,20 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.11.1.0 to 4.11.2.0
+--;
diff --git a/engine/schema/resources/META-INF/db/schema-41110to41120.sql 
b/engine/schema/resources/META-INF/db/schema-41110to41120.sql
new file mode 100644
index 00000000000..4c85bd133e8
--- /dev/null
+++ b/engine/schema/resources/META-INF/db/schema-41110to41120.sql
@@ -0,0 +1,24 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.11.1.0 to 4.11.2.0
+--;
+
+-- XenServer 7.5
+INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, 
hypervisor_version, max_guests_limit, max_data_volumes_limit, 
storage_motion_supported) values (UUID(), 'XenServer', '7.5.0', 500, 13, 1);
+INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, 
hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) 
SELECT UUID(),'Xenserver', '7.5.0', guest_os_name, guest_os_id, 
utc_timestamp(), 0  FROM `cloud`.`guest_os_hypervisor` WHERE 
hypervisor_type='Xenserver' AND hypervisor_version='7.4.0';
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java 
b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index 158931b5758..ddf1b795324 100644
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -69,6 +69,7 @@
 import com.cloud.upgrade.dao.Upgrade4930to41000;
 import com.cloud.upgrade.dao.Upgrade41000to41100;
 import com.cloud.upgrade.dao.Upgrade41100to41110;
+import com.cloud.upgrade.dao.Upgrade41110to41120;
 import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
 import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
 import com.cloud.upgrade.dao.VersionDao;
@@ -121,7 +122,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(),
                 new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(),
                 new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(),
-                new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.1.8"),
             new DbUpgrade[] {new Upgrade218to22(), new Upgrade221to222(), new 
UpgradeSnapshot217to224(), new Upgrade222to224(), new 
Upgrade218to224DomainVlans(),
@@ -139,7 +140,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(),
                 new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(),
                 new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.1"),
             new DbUpgrade[] {new Upgrade221to222(), new 
UpgradeSnapshot223to224(), new Upgrade222to224(), new Upgrade224to225(), new 
Upgrade225to226(), new Upgrade227to228(),
@@ -147,7 +148,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade2214to30(), new Upgrade30to301(), new 
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new 
Upgrade410to420(), new Upgrade420to421(),
                 new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(),
                 new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.2"),
             new DbUpgrade[] {new Upgrade222to224(), new 
UpgradeSnapshot223to224(), new Upgrade224to225(), new Upgrade225to226(), new 
Upgrade227to228(), new Upgrade228to229(),
@@ -155,7 +156,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade30to301(), new Upgrade301to302(), new 
Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(),
                 new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(),
                 new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.3"),
             new DbUpgrade[] {new Upgrade222to224(), new 
UpgradeSnapshot223to224(), new Upgrade224to225(), new Upgrade225to226(), new 
Upgrade227to228(), new Upgrade228to229(),
@@ -163,7 +164,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade30to301(), new Upgrade301to302(), new 
Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(),
                 new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(),
                 new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.4"),
             new DbUpgrade[] {new Upgrade224to225(), new Upgrade225to226(), new 
Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new 
Upgrade2210to2211(),
@@ -171,7 +172,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(),
                 new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(),
                 new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.5"),
             new DbUpgrade[] {new Upgrade225to226(), new Upgrade227to228(), new 
Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(), new 
Upgrade2211to2212(),
@@ -179,7 +180,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(),
                 new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(),
                 new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(),
-                new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.6"),
             new DbUpgrade[] {new Upgrade227to228(), new Upgrade228to229(), new 
Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(), new 
Upgrade2212to2213(),
@@ -187,7 +188,7 @@ public DatabaseUpgradeChecker() {
                 new Upgrade420to421(), new Upgrade421to430(), new 
Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(),
                 new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(),
                 new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.7"),
             new DbUpgrade[] {new Upgrade227to228(), new Upgrade228to229(), new 
Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(), new 
Upgrade2212to2213(),
@@ -195,227 +196,230 @@ public DatabaseUpgradeChecker() {
                 new Upgrade420to421(), new Upgrade421to430(), new 
Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(),
                 new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(),
                 new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.8"),
             new DbUpgrade[] {new Upgrade228to229(), new Upgrade229to2210(), 
new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(), new 
Upgrade2213to2214(),
                 new Upgrade2214to30(), new Upgrade30to301(), new 
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new 
Upgrade410to420(), new Upgrade420to421(),
                 new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(),
                 new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.9"),
             new DbUpgrade[] {new Upgrade229to2210(), new Upgrade2210to2211(), 
new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(), new 
Upgrade2214to30(),
                 new Upgrade30to301(), new Upgrade301to302(), new 
Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(),
                 new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(),
                 new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.10"),
             new DbUpgrade[] {new Upgrade2210to2211(), new Upgrade2211to2212(), 
new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(), new 
Upgrade30to301(),
                 new Upgrade301to302(), new Upgrade302to40(), new 
Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(),
                 new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(),
                 new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.12"),
             new DbUpgrade[] {new Upgrade2212to2213(), new Upgrade2213to2214(), 
new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new 
Upgrade302to40(),
                 new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(),
                 new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(),
                 new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.13"),
             new DbUpgrade[] {new Upgrade2213to2214(), new Upgrade2214to30(), 
new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new 
Upgrade40to41(),
                 new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(),
                 new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(),
                 new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(),
-                new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.14"),
             new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(), new 
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new 
Upgrade410to420(),
                 new Upgrade420to421(), new Upgrade421to430(), new 
Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(),
                 new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(),
                 new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("3.0.0"),
             new DbUpgrade[] {new Upgrade30to301(), new Upgrade301to302(), new 
Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(),
                 new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(),
                 new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("3.0.1"),
             new DbUpgrade[] {new Upgrade301to302(), new Upgrade302to40(), new 
Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(),
                 new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(),
                 new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("3.0.2"),
             new DbUpgrade[] {new Upgrade302to40(), new Upgrade40to41(), new 
Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new 
Upgrade430to440(),
                 new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(),
                 new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.0.0"),
             new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(),
                 new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(),
                 new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.0.1"),
             new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(),
                 new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(),
                 new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.0.2"),
             new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(),
                 new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(),
                 new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.1.0"),
             new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(),
                 new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(),
                 new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.1.1"),
             new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(),
                 new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(),
                 new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.2.0"),
             new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(), new 
Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(),
                 new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(),
                 new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(),
-                new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.2.1"),
             new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(),
                 new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(),
                 new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.3.0"),
             new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(),
                 new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.3.1"),
             new DbUpgrade[] {new Upgrade431to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(),
                 new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.3.2"),
             new DbUpgrade[] {new Upgrade432to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(),
                 new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.4.0"),
             new DbUpgrade[] {new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(),
                 new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.4.1"),
             new DbUpgrade[] {new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(),
                 new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.4.2"),
             new DbUpgrade[] {new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(),
                 new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.4.3"),
             new DbUpgrade[] {new Upgrade443to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(),
                 new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.4.4"),
             new DbUpgrade[] {new Upgrade444to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(),
                 new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.5.0"),
             new DbUpgrade[] {new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(),
                 new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.5.1"),
             new DbUpgrade[] {new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(),
                 new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(),
-                new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.5.2"),
             new DbUpgrade[] {new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(),
                 new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                    new Upgrade41100to41110()});
+                    new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.5.3"),
             new DbUpgrade[] {new Upgrade453to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(),
                 new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.6.0"),
             new DbUpgrade[] {new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.6.1"),
             new DbUpgrade[] {new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.6.2"),
             new DbUpgrade[] {new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.7.0"),
             new DbUpgrade[] {new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.7.1"),
             new DbUpgrade[] {new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.7.2"),
             new DbUpgrade[] {new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(),
-                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.8.0"),
             new DbUpgrade[] {new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(),
-                new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.8.1"),
             new DbUpgrade[] {new Upgrade481to490(), new Upgrade490to4910(), 
new Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.8.2.0"),
             new DbUpgrade[] {new Upgrade481to490(), new Upgrade490to4910(), 
new Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.9.0"),
             new DbUpgrade[] {new Upgrade490to4910(), new Upgrade4910to4920(), 
new Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.9.1.0"),
-            new DbUpgrade[] {new Upgrade4910to4920(), new Upgrade4920to4930(), 
new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+            new DbUpgrade[] {new Upgrade4910to4920(), new Upgrade4920to4930(), 
new Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), 
new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.9.2.0"),
-            new DbUpgrade[] {new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+            new DbUpgrade[] {new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.9.3.0"),
-            new DbUpgrade[] {new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+            new DbUpgrade[] {new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.9.3.1"),
-                new DbUpgrade[] {new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new DbUpgrade[] {new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.10.0.0"),
-            new DbUpgrade[] {new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+            new DbUpgrade[] {new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("4.11.0.0"),
-            new DbUpgrade[] {new Upgrade41100to41110()});
+            new DbUpgrade[] {new Upgrade41100to41110(), new 
Upgrade41110to41120()});
+
+        _upgradeMap.put(CloudStackVersion.parse("4.11.1.0"),
+            new DbUpgrade[] {new Upgrade41110to41120()});
 
         //CP Upgrades
         _upgradeMap.put(CloudStackVersion.parse("3.0.3"),
@@ -423,45 +427,45 @@ public DatabaseUpgradeChecker() {
                 new Upgrade420to421(), new Upgrade421to430(), new 
Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(),
                 new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(),
                 new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(), new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(),
-                new Upgrade41100to41110()});
+                new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("3.0.4"),
             new DbUpgrade[] {new Upgrade304to305(), new Upgrade305to306(), new 
Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(), new 
Upgrade420to421(),
                 new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(),
                 new Upgrade452to460(), new Upgrade460to461(), new 
Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(),
-                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110()});
+                new Upgrade490to4910(), new Upgrade4910to4920(), new 
Upgrade4920to4930(), new Upgrade4930to41000(), new Upgrade41000to41100(), new 
Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("3.0.5"),
             new DbUpgrade[] {new Upgrade305to306(), new Upgrade306to307(), new 
Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(),
                 new Upgrade430to440(), new Upgrade440to441(), new 
Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new 
Upgrade451to452(), new Upgrade452to460(),
                 new Upgrade460to461(), new Upgrade461to470(), new 
Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new 
Upgrade481to490(), new Upgrade490to4910(),
-                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4910to4920(), new Upgrade4920to4930(), new 
Upgrade4930to41000(), new Upgrade41000to41100(), new Upgrade41100to41110(), new 
Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("3.0.6"),
             new DbUpgrade[] {new Upgrade306to307(), new Upgrade307to410(), new 
Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new 
Upgrade430to440(),
                 new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(),
                 new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("3.0.7"),
             new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(), new 
Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new 
Upgrade440to441(),
                 new Upgrade441to442(), new Upgrade442to450(), new 
Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new 
Upgrade460to461(), new Upgrade461to470(),
                 new Upgrade470to471(), new Upgrade471to480(), new 
Upgrade480to481(), new Upgrade481to490(), new Upgrade490to4910(), new 
Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.15"),
             new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(), new 
Upgrade301to302(), new Upgrade302to303(), new Upgrade303to304(), new 
Upgrade304to305(),
                 new Upgrade305to306(), new Upgrade306to307(), new 
Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(),
                 new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(),
                 new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         _upgradeMap.put(CloudStackVersion.parse("2.2.16"),
             new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(), new 
Upgrade301to302(), new Upgrade302to303(), new Upgrade303to304(), new 
Upgrade304to305(),
                 new Upgrade305to306(), new Upgrade306to307(), new 
Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(), new 
Upgrade421to430(), new Upgrade430to440(),
                 new Upgrade440to441(), new Upgrade441to442(), new 
Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new 
Upgrade452to460(), new Upgrade460to461(),
                 new Upgrade461to470(), new Upgrade470to471(), new 
Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490(), new 
Upgrade490to4910(), new Upgrade4910to4920(),
-                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110()});
+                new Upgrade4920to4930(), new Upgrade4930to41000(), new 
Upgrade41000to41100(), new Upgrade41100to41110(), new Upgrade41110to41120()});
 
         final List<CloudStackVersion> sortedVersions = 
newArrayList(_upgradeMap.keySet());
         sort(sortedVersions);
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41100to41110.java 
b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41100to41110.java
index 90e00016819..3703040771b 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41100to41110.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41100to41110.java
@@ -19,20 +19,16 @@
 
 package com.cloud.upgrade.dao;
 
-import com.cloud.hypervisor.Hypervisor;
-import com.cloud.utils.crypt.DBEncryptionUtil;
-import com.cloud.utils.exception.CloudRuntimeException;
-import org.apache.log4j.Logger;
-
 import java.io.InputStream;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.utils.crypt.DBEncryptionUtil;
+import com.cloud.utils.exception.CloudRuntimeException;
 
 public class Upgrade41100to41110 implements DbUpgrade {
     final static Logger LOG = Logger.getLogger(Upgrade41000to41100.class);
@@ -65,7 +61,6 @@ public boolean supportsRollingUpgrade() {
 
     @Override
     public void performDataMigration(Connection conn) {
-        updateSystemVmTemplates(conn);
         markUnnecessarySecureConfigsAsUnsecure(conn);
     }
 
@@ -138,174 +133,6 @@ private void uncrypt(Connection conn, String name)
         }
     }
 
-    @SuppressWarnings("serial")
-    private void updateSystemVmTemplates(final Connection conn) {
-        LOG.debug("Updating System Vm template IDs");
-        final Set<Hypervisor.HypervisorType> hypervisorsListInUse = new 
HashSet<Hypervisor.HypervisorType>();
-        try (PreparedStatement pstmt = conn.prepareStatement("select 
distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); 
ResultSet rs = pstmt.executeQuery()) {
-            while (rs.next()) {
-                switch (Hypervisor.HypervisorType.getType(rs.getString(1))) {
-                    case XenServer:
-                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.XenServer);
-                        break;
-                    case KVM:
-                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.KVM);
-                        break;
-                    case VMware:
-                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.VMware);
-                        break;
-                    case Hyperv:
-                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.Hyperv);
-                        break;
-                    case LXC:
-                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.LXC);
-                        break;
-                    case Ovm3:
-                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.Ovm3);
-                        break;
-                    default:
-                        break;
-                }
-            }
-        } catch (final SQLException e) {
-            LOG.error("updateSystemVmTemplates: Exception caught while getting 
hypervisor types from clusters: " + e.getMessage());
-            throw new CloudRuntimeException("updateSystemVmTemplates:Exception 
while getting hypervisor types from clusters", e);
-        }
-
-        final Map<Hypervisor.HypervisorType, String> NewTemplateNameList = new 
HashMap<Hypervisor.HypervisorType, String>() {
-            {
-                put(Hypervisor.HypervisorType.KVM, "systemvm-kvm-4.11.1");
-                put(Hypervisor.HypervisorType.VMware, 
"systemvm-vmware-4.11.1");
-                put(Hypervisor.HypervisorType.XenServer, 
"systemvm-xenserver-4.11.1");
-                put(Hypervisor.HypervisorType.Hyperv, 
"systemvm-hyperv-4.11.1");
-                put(Hypervisor.HypervisorType.LXC, "systemvm-lxc-4.11.1");
-                put(Hypervisor.HypervisorType.Ovm3, "systemvm-ovm3-4.11.1");
-            }
-        };
-
-        final Map<Hypervisor.HypervisorType, String> 
routerTemplateConfigurationNames = new HashMap<Hypervisor.HypervisorType, 
String>() {
-            {
-                put(Hypervisor.HypervisorType.KVM, "router.template.kvm");
-                put(Hypervisor.HypervisorType.VMware, 
"router.template.vmware");
-                put(Hypervisor.HypervisorType.XenServer, 
"router.template.xenserver");
-                put(Hypervisor.HypervisorType.Hyperv, 
"router.template.hyperv");
-                put(Hypervisor.HypervisorType.LXC, "router.template.lxc");
-                put(Hypervisor.HypervisorType.Ovm3, "router.template.ovm3");
-            }
-        };
-
-        final Map<Hypervisor.HypervisorType, String> newTemplateUrl = new 
HashMap<Hypervisor.HypervisorType, String>() {
-            {
-                put(Hypervisor.HypervisorType.KVM, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-kvm.qcow2.bz2";);
-                put(Hypervisor.HypervisorType.VMware, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-vmware.ova";);
-                put(Hypervisor.HypervisorType.XenServer, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-xen.vhd.bz2";);
-                put(Hypervisor.HypervisorType.Hyperv, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-hyperv.vhd.zip";);
-                put(Hypervisor.HypervisorType.LXC, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-kvm.qcow2.bz2";);
-                put(Hypervisor.HypervisorType.Ovm3, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-ovm.raw.bz2";);
-            }
-        };
-
-        final Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new 
HashMap<Hypervisor.HypervisorType, String>() {
-            {
-                put(Hypervisor.HypervisorType.KVM, 
"6019c2ed1a13669dcf334fe380c776b0");
-                put(Hypervisor.HypervisorType.XenServer, 
"f2245e912c856ab610d91f88c362a1f9");
-                put(Hypervisor.HypervisorType.VMware, 
"1dbcd051fcfcd0fd568ff6eb5294988a");
-                put(Hypervisor.HypervisorType.Hyperv, 
"e68ec90f0dc06821d94a2ee0e88fa646");
-                put(Hypervisor.HypervisorType.LXC, 
"6019c2ed1a13669dcf334fe380c776b0");
-                put(Hypervisor.HypervisorType.Ovm3, 
"cd2ac8dcdaf6c05d75e29cb39ee9a10f");
-            }
-        };
-
-        for (final Map.Entry<Hypervisor.HypervisorType, String> 
hypervisorAndTemplateName : NewTemplateNameList.entrySet()) {
-            LOG.debug("Updating " + hypervisorAndTemplateName.getKey() + " 
System Vms");
-            try (PreparedStatement pstmt = conn.prepareStatement("select id 
from `cloud`.`vm_template` where name = ? and removed is null order by id desc 
limit 1")) {
-                // Get 4.11.0 systemvm template id for corresponding hypervisor
-                long templateId = -1;
-                pstmt.setString(1, hypervisorAndTemplateName.getValue());
-                try (ResultSet rs = pstmt.executeQuery()) {
-                    if (rs.next()) {
-                        templateId = rs.getLong(1);
-                    }
-                } catch (final SQLException e) {
-                    LOG.error("updateSystemVmTemplates: Exception caught while 
getting ids of templates: " + e.getMessage());
-                    throw new CloudRuntimeException("updateSystemVmTemplates: 
Exception caught while getting ids of templates", e);
-                }
-
-                // change template type to SYSTEM
-                if (templateId != -1) {
-                    try (PreparedStatement templ_type_pstmt = 
conn.prepareStatement("update `cloud`.`vm_template` set type='SYSTEM' where id 
= ?");) {
-                        templ_type_pstmt.setLong(1, templateId);
-                        templ_type_pstmt.executeUpdate();
-                    } catch (final SQLException e) {
-                        LOG.error("updateSystemVmTemplates:Exception while 
updating template with id " + templateId + " to be marked as 'system': " + 
e.getMessage());
-                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while updating 
template with id " + templateId + " to be marked as 'system'", e);
-                    }
-                    // update template ID of system Vms
-                    try (PreparedStatement update_templ_id_pstmt = conn
-                            .prepareStatement("update `cloud`.`vm_instance` 
set vm_template_id = ? where type <> 'User' and hypervisor_type = ?");) {
-                        update_templ_id_pstmt.setLong(1, templateId);
-                        update_templ_id_pstmt.setString(2, 
hypervisorAndTemplateName.getKey().toString());
-                        update_templ_id_pstmt.executeUpdate();
-                    } catch (final Exception e) {
-                        LOG.error("updateSystemVmTemplates:Exception while 
setting template for " + hypervisorAndTemplateName.getKey().toString() + " to " 
+ templateId
-                                + ": " + e.getMessage());
-                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while setting template 
for " + hypervisorAndTemplateName.getKey().toString() + " to "
-                                + templateId, e);
-                    }
-
-                    // Change value of global configuration parameter
-                    // router.template.* for the corresponding hypervisor
-                    try (PreparedStatement update_pstmt = 
conn.prepareStatement("UPDATE `cloud`.`configuration` SET value = ? WHERE name 
= ?");) {
-                        update_pstmt.setString(1, 
hypervisorAndTemplateName.getValue());
-                        update_pstmt.setString(2, 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()));
-                        update_pstmt.executeUpdate();
-                    } catch (final SQLException e) {
-                        LOG.error("updateSystemVmTemplates:Exception while 
setting " + 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()) + " to 
"
-                                + hypervisorAndTemplateName.getValue() + ": " 
+ e.getMessage());
-                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while setting "
-                                + 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()) + " to 
" + hypervisorAndTemplateName.getValue(), e);
-                    }
-
-                    // Change value of global configuration parameter
-                    // minreq.sysvmtemplate.version for the ACS version
-                    try (PreparedStatement update_pstmt = 
conn.prepareStatement("UPDATE `cloud`.`configuration` SET value = ? WHERE name 
= ?");) {
-                        update_pstmt.setString(1, "4.11.1");
-                        update_pstmt.setString(2, 
"minreq.sysvmtemplate.version");
-                        update_pstmt.executeUpdate();
-                    } catch (final SQLException e) {
-                        LOG.error("updateSystemVmTemplates:Exception while 
setting 'minreq.sysvmtemplate.version' to 4.11.1: " + e.getMessage());
-                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while setting 
'minreq.sysvmtemplate.version' to 4.11.1", e);
-                    }
-                } else {
-                    if 
(hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())) {
-                        throw new CloudRuntimeException(getUpgradedVersion() + 
hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot 
upgrade system Vms");
-                    } else {
-                        LOG.warn(getUpgradedVersion() + 
hypervisorAndTemplateName.getKey() + " SystemVm template not found. " + 
hypervisorAndTemplateName.getKey()
-                                + " hypervisor is not used, so not failing 
upgrade");
-                        // Update the latest template URLs for corresponding
-                        // hypervisor
-                        try (PreparedStatement update_templ_url_pstmt = conn
-                                .prepareStatement("UPDATE 
`cloud`.`vm_template` SET url = ? , checksum = ? WHERE hypervisor_type = ? AND 
type = 'SYSTEM' AND removed is null order by id desc limit 1");) {
-                            update_templ_url_pstmt.setString(1, 
newTemplateUrl.get(hypervisorAndTemplateName.getKey()));
-                            update_templ_url_pstmt.setString(2, 
newTemplateChecksum.get(hypervisorAndTemplateName.getKey()));
-                            update_templ_url_pstmt.setString(3, 
hypervisorAndTemplateName.getKey().toString());
-                            update_templ_url_pstmt.executeUpdate();
-                        } catch (final SQLException e) {
-                            LOG.error("updateSystemVmTemplates:Exception while 
updating 'url' and 'checksum' for hypervisor type "
-                                    + 
hypervisorAndTemplateName.getKey().toString() + ": " + e.getMessage());
-                            throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while updating 'url' 
and 'checksum' for hypervisor type "
-                                    + 
hypervisorAndTemplateName.getKey().toString(), e);
-                        }
-                    }
-                }
-            } catch (final SQLException e) {
-                LOG.error("updateSystemVmTemplates:Exception while getting ids 
of templates: " + e.getMessage());
-                throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while getting ids of 
templates", e);
-            }
-        }
-        LOG.debug("Updating System Vm Template IDs Complete");
-    }
-
     @Override
     public InputStream[] getCleanupScripts() {
         final String scriptFile = 
"META-INF/db/schema-41100to41110-cleanup.sql";
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41110to41120.java 
b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41110to41120.java
new file mode 100644
index 00000000000..a35be45a8d9
--- /dev/null
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41110to41120.java
@@ -0,0 +1,247 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package com.cloud.upgrade.dao;
+
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.hypervisor.Hypervisor;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+public class Upgrade41110to41120 implements DbUpgrade {
+    final static Logger LOG = Logger.getLogger(Upgrade41110to41120.class);
+
+    @Override
+    public String[] getUpgradableVersionRange() {
+        return new String[]{"4.11.1.0", "4.11.2.0"};
+    }
+
+    @Override
+    public String getUpgradedVersion() {
+        return "4.11.2.0";
+    }
+
+    @Override
+    public boolean supportsRollingUpgrade() {
+        return false;
+    }
+
+    @Override
+    public InputStream[] getPrepareScripts() {
+        final String scriptFile = "META-INF/db/schema-41110to41120.sql";
+        final InputStream script = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find " + scriptFile);
+        }
+
+        return new InputStream[] {script};
+    }
+
+    @Override
+    public void performDataMigration(Connection conn) {
+        updateSystemVmTemplates(conn);
+    }
+
+    @SuppressWarnings("serial")
+    private void updateSystemVmTemplates(final Connection conn) {
+        LOG.debug("Updating System Vm template IDs");
+        final Set<Hypervisor.HypervisorType> hypervisorsListInUse = new 
HashSet<Hypervisor.HypervisorType>();
+        try (PreparedStatement pstmt = conn.prepareStatement("select 
distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); 
ResultSet rs = pstmt.executeQuery()) {
+            while (rs.next()) {
+                switch (Hypervisor.HypervisorType.getType(rs.getString(1))) {
+                    case XenServer:
+                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.XenServer);
+                        break;
+                    case KVM:
+                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.KVM);
+                        break;
+                    case VMware:
+                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.VMware);
+                        break;
+                    case Hyperv:
+                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.Hyperv);
+                        break;
+                    case LXC:
+                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.LXC);
+                        break;
+                    case Ovm3:
+                        
hypervisorsListInUse.add(Hypervisor.HypervisorType.Ovm3);
+                        break;
+                    default:
+                        break;
+                }
+            }
+        } catch (final SQLException e) {
+            LOG.error("updateSystemVmTemplates: Exception caught while getting 
hypervisor types from clusters: " + e.getMessage());
+            throw new CloudRuntimeException("updateSystemVmTemplates:Exception 
while getting hypervisor types from clusters", e);
+        }
+
+        final Map<Hypervisor.HypervisorType, String> NewTemplateNameList = new 
HashMap<Hypervisor.HypervisorType, String>() {
+            {
+                put(Hypervisor.HypervisorType.KVM, "systemvm-kvm-4.11.2");
+                put(Hypervisor.HypervisorType.VMware, 
"systemvm-vmware-4.11.2");
+                put(Hypervisor.HypervisorType.XenServer, 
"systemvm-xenserver-4.11.2");
+                put(Hypervisor.HypervisorType.Hyperv, 
"systemvm-hyperv-4.11.2");
+                put(Hypervisor.HypervisorType.LXC, "systemvm-lxc-4.11.2");
+                put(Hypervisor.HypervisorType.Ovm3, "systemvm-ovm3-4.11.2");
+            }
+        };
+
+        final Map<Hypervisor.HypervisorType, String> 
routerTemplateConfigurationNames = new HashMap<Hypervisor.HypervisorType, 
String>() {
+            {
+                put(Hypervisor.HypervisorType.KVM, "router.template.kvm");
+                put(Hypervisor.HypervisorType.VMware, 
"router.template.vmware");
+                put(Hypervisor.HypervisorType.XenServer, 
"router.template.xenserver");
+                put(Hypervisor.HypervisorType.Hyperv, 
"router.template.hyperv");
+                put(Hypervisor.HypervisorType.LXC, "router.template.lxc");
+                put(Hypervisor.HypervisorType.Ovm3, "router.template.ovm3");
+            }
+        };
+
+        final Map<Hypervisor.HypervisorType, String> newTemplateUrl = new 
HashMap<Hypervisor.HypervisorType, String>() {
+            {
+                put(Hypervisor.HypervisorType.KVM, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-kvm.qcow2.bz2";);
+                put(Hypervisor.HypervisorType.VMware, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-vmware.ova";);
+                put(Hypervisor.HypervisorType.XenServer, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-xen.vhd.bz2";);
+                put(Hypervisor.HypervisorType.Hyperv, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-hyperv.vhd.zip";);
+                put(Hypervisor.HypervisorType.LXC, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-kvm.qcow2.bz2";);
+                put(Hypervisor.HypervisorType.Ovm3, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.2-ovm.raw.bz2";);
+            }
+        };
+
+        final Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new 
HashMap<Hypervisor.HypervisorType, String>() {
+            {
+                put(Hypervisor.HypervisorType.KVM, 
"f44242570ae4a0b16c4c2eb2cb71fe45");
+                put(Hypervisor.HypervisorType.XenServer, 
"afcc31ab9f7635885cd83600eafbbe7f");
+                put(Hypervisor.HypervisorType.VMware, 
"54449e31530f14af930c80a3155a308f");
+                put(Hypervisor.HypervisorType.Hyperv, 
"7785df30fdbbacdead5acbfc15ae2c98");
+                put(Hypervisor.HypervisorType.LXC, 
"f44242570ae4a0b16c4c2eb2cb71fe45");
+                put(Hypervisor.HypervisorType.Ovm3, 
"81a6cd8d07fad910824f040f73ce03e3");
+            }
+        };
+
+        for (final Map.Entry<Hypervisor.HypervisorType, String> 
hypervisorAndTemplateName : NewTemplateNameList.entrySet()) {
+            LOG.debug("Updating " + hypervisorAndTemplateName.getKey() + " 
System Vms");
+            try (PreparedStatement pstmt = conn.prepareStatement("select id 
from `cloud`.`vm_template` where name = ? and removed is null order by id desc 
limit 1")) {
+                // Get 4.11 systemvm template id for corresponding hypervisor
+                long templateId = -1;
+                pstmt.setString(1, hypervisorAndTemplateName.getValue());
+                try (ResultSet rs = pstmt.executeQuery()) {
+                    if (rs.next()) {
+                        templateId = rs.getLong(1);
+                    }
+                } catch (final SQLException e) {
+                    LOG.error("updateSystemVmTemplates: Exception caught while 
getting ids of templates: " + e.getMessage());
+                    throw new CloudRuntimeException("updateSystemVmTemplates: 
Exception caught while getting ids of templates", e);
+                }
+
+                // change template type to SYSTEM
+                if (templateId != -1) {
+                    try (PreparedStatement templ_type_pstmt = 
conn.prepareStatement("update `cloud`.`vm_template` set type='SYSTEM' where id 
= ?");) {
+                        templ_type_pstmt.setLong(1, templateId);
+                        templ_type_pstmt.executeUpdate();
+                    } catch (final SQLException e) {
+                        LOG.error("updateSystemVmTemplates:Exception while 
updating template with id " + templateId + " to be marked as 'system': " + 
e.getMessage());
+                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while updating 
template with id " + templateId + " to be marked as 'system'", e);
+                    }
+                    // update template ID of system Vms
+                    try (PreparedStatement update_templ_id_pstmt = conn
+                            .prepareStatement("update `cloud`.`vm_instance` 
set vm_template_id = ? where type <> 'User' and hypervisor_type = ? and removed 
is NULL");) {
+                        update_templ_id_pstmt.setLong(1, templateId);
+                        update_templ_id_pstmt.setString(2, 
hypervisorAndTemplateName.getKey().toString());
+                        update_templ_id_pstmt.executeUpdate();
+                    } catch (final Exception e) {
+                        LOG.error("updateSystemVmTemplates:Exception while 
setting template for " + hypervisorAndTemplateName.getKey().toString() + " to " 
+ templateId
+                                + ": " + e.getMessage());
+                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while setting template 
for " + hypervisorAndTemplateName.getKey().toString() + " to "
+                                + templateId, e);
+                    }
+
+                    // Change value of global configuration parameter
+                    // router.template.* for the corresponding hypervisor
+                    try (PreparedStatement update_pstmt = 
conn.prepareStatement("UPDATE `cloud`.`configuration` SET value = ? WHERE name 
= ?");) {
+                        update_pstmt.setString(1, 
hypervisorAndTemplateName.getValue());
+                        update_pstmt.setString(2, 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()));
+                        update_pstmt.executeUpdate();
+                    } catch (final SQLException e) {
+                        LOG.error("updateSystemVmTemplates:Exception while 
setting " + 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()) + " to 
"
+                                + hypervisorAndTemplateName.getValue() + ": " 
+ e.getMessage());
+                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while setting "
+                                + 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()) + " to 
" + hypervisorAndTemplateName.getValue(), e);
+                    }
+
+                    // Change value of global configuration parameter
+                    // minreq.sysvmtemplate.version for the ACS version
+                    try (PreparedStatement update_pstmt = 
conn.prepareStatement("UPDATE `cloud`.`configuration` SET value = ? WHERE name 
= ?");) {
+                        update_pstmt.setString(1, "4.11.2");
+                        update_pstmt.setString(2, 
"minreq.sysvmtemplate.version");
+                        update_pstmt.executeUpdate();
+                    } catch (final SQLException e) {
+                        LOG.error("updateSystemVmTemplates:Exception while 
setting 'minreq.sysvmtemplate.version' to 4.11.2: " + e.getMessage());
+                        throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while setting 
'minreq.sysvmtemplate.version' to 4.11.2", e);
+                    }
+                } else {
+                    if 
(hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())) {
+                        throw new CloudRuntimeException(getUpgradedVersion() + 
hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot 
upgrade system Vms");
+                    } else {
+                        LOG.warn(getUpgradedVersion() + 
hypervisorAndTemplateName.getKey() + " SystemVm template not found. " + 
hypervisorAndTemplateName.getKey()
+                                + " hypervisor is not used, so not failing 
upgrade");
+                        // Update the latest template URLs for corresponding
+                        // hypervisor
+                        try (PreparedStatement update_templ_url_pstmt = conn
+                                .prepareStatement("UPDATE 
`cloud`.`vm_template` SET url = ? , checksum = ? WHERE hypervisor_type = ? AND 
type = 'SYSTEM' AND removed is null order by id desc limit 1");) {
+                            update_templ_url_pstmt.setString(1, 
newTemplateUrl.get(hypervisorAndTemplateName.getKey()));
+                            update_templ_url_pstmt.setString(2, 
newTemplateChecksum.get(hypervisorAndTemplateName.getKey()));
+                            update_templ_url_pstmt.setString(3, 
hypervisorAndTemplateName.getKey().toString());
+                            update_templ_url_pstmt.executeUpdate();
+                        } catch (final SQLException e) {
+                            LOG.error("updateSystemVmTemplates:Exception while 
updating 'url' and 'checksum' for hypervisor type "
+                                    + 
hypervisorAndTemplateName.getKey().toString() + ": " + e.getMessage());
+                            throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while updating 'url' 
and 'checksum' for hypervisor type "
+                                    + 
hypervisorAndTemplateName.getKey().toString(), e);
+                        }
+                    }
+                }
+            } catch (final SQLException e) {
+                LOG.error("updateSystemVmTemplates:Exception while getting ids 
of templates: " + e.getMessage());
+                throw new 
CloudRuntimeException("updateSystemVmTemplates:Exception while getting ids of 
templates", e);
+            }
+        }
+        LOG.debug("Updating System Vm Template IDs Complete");
+    }
+
+    @Override
+    public InputStream[] getCleanupScripts() {
+        final String scriptFile = 
"META-INF/db/schema-41110to41120-cleanup.sql";
+        final InputStream script = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find " + scriptFile);
+        }
+
+        return new InputStream[] {script};
+    }
+}
diff --git a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config 
b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
index 99acb86e5dd..2c277ae78ed 100755
--- a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
+++ b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
@@ -150,21 +150,6 @@ get_boot_params() {
   esac
 }
 
-get_systemvm_type() {
-  for str in $(cat $CMDLINE)
-    do
-      KEY=$(echo $str | cut -d= -f1)
-      VALUE=$(echo $str | cut -d= -f2)
-      case $KEY in
-        type)
-          export TYPE=$VALUE
-          ;;
-        *)
-          ;;
-      esac
-  done
-}
-
 patch() {
   local PATCH_MOUNT=/media/cdrom
   local patchfile=$PATCH_MOUNT/cloud-scripts.tgz
@@ -231,11 +216,11 @@ start() {
 
   config_guest
   get_boot_params
-  get_systemvm_type
   patch
   sync
   sysctl -p
 
+  export TYPE=$(grep -Po 'type=\K[a-zA-Z]*' $CMDLINE)
   log_it "Configuring systemvm type=$TYPE"
 
   if [ -f "/opt/cloud/bin/setup/$TYPE.sh" ]; then
diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh 
b/systemvm/debian/opt/cloud/bin/setup/common.sh
index f26ff5b4c35..e24642fc603 100755
--- a/systemvm/debian/opt/cloud/bin/setup/common.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/common.sh
@@ -141,6 +141,11 @@ enable_fwding() {
   [ -f /etc/iptables/iptables.conf ] && sed  -i 
"s/ENABLE_ROUTING=.*$/ENABLE_ROUTING=$enabled/" /etc/iptables/iptables.conf && 
return
 }
 
+enable_passive_ftp() {
+  log_it "cloud: enabling passive FTP for guest VMs"
+  echo "$1" > /proc/sys/net/netfilter/nf_conntrack_helper
+}
+
 disable_rpfilter() {
   log_it "cloud: disable rp_filter"
   log_it "disable rpfilter"
@@ -578,24 +583,13 @@ setup_ntp() {
 }
 
 routing_svcs() {
-   systemctl disable --now cloud
-   systemctl disable --now nfs-common
-   systemctl disable --now portmap
-   systemctl enable apache2
-   systemctl enable haproxy
    echo "haproxy apache2" > /var/cache/cloud/enabled_svcs
    echo "cloud nfs-common portmap" > /var/cache/cloud/disabled_svcs
    if [ "$RROUTER" -eq "1" ]
    then
-       systemctl disable --now dnsmasq
-       systemctl enable conntrackd
-       systemctl enable keepalived
        echo "keepalived conntrackd" >> /var/cache/cloud/enabled_svcs
        echo "dnsmasq" >> /var/cache/cloud/disabled_svcs
    else
-       systemctl disable --now conntrackd
-       systemctl disable --now keepalived
-       systemctl enable dnsmasq
        echo "dnsmasq" >> /var/cache/cloud/enabled_svcs
        echo "keepalived conntrackd " >> /var/cache/cloud/disabled_svcs
    fi
diff --git a/systemvm/debian/opt/cloud/bin/setup/postinit.sh 
b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
index de7f259d826..5132d5e85d4 100755
--- a/systemvm/debian/opt/cloud/bin/setup/postinit.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
@@ -21,48 +21,25 @@
 # Eject cdrom if any
 eject || true
 
-# Setup router
-CMDLINE=/var/cache/cloud/cmdline
-for str in $(cat $CMDLINE)
-  do
-    KEY=$(echo $str | cut -d= -f1)
-    VALUE=$(echo $str | cut -d= -f2)
-    case $KEY in
-      type)
-        export TYPE=$VALUE
-        ;;
-      *)
-        ;;
-    esac
-done
-
+TYPE=$(grep -Po 'type=\K[a-zA-Z]*' $CMDLINE)
 if [ "$TYPE" == "router" ] || [ "$TYPE" == "vpcrouter" ] || [ "$TYPE" == 
"dhcpsrvr" ]
 then
   if [ -x /opt/cloud/bin/update_config.py ]
   then
       /opt/cloud/bin/update_config.py cmd_line.json || true
-      logger -t cloud "postinit: Updated config cmd_line.json"
   fi
 fi
 
-if [ "$TYPE" == "router" ]
-then
-    python /opt/cloud/bin/baremetal-vr.py &
-    logger -t cloud "Started baremetal-vr service"
-fi
-
 [ ! -f /var/cache/cloud/enabled_svcs ] && touch /var/cache/cloud/enabled_svcs
 for svc in $(cat /var/cache/cloud/enabled_svcs)
 do
-   logger -t cloud "Starting $svc"
-   systemctl enable --no-block --now $svc
+   systemctl enable --now --no-block $svc
 done
 
 [ ! -f /var/cache/cloud/disabled_svcs ] && touch /var/cache/cloud/disabled_svcs
 for svc in $(cat /var/cache/cloud/disabled_svcs)
 do
-   logger -t cloud "Stopping $svc"
-   systemctl disable --no-block --now $svc
+   systemctl disable --now --no-block $svc
 done
 
 # Restore the persistent iptables nat, rules and filters for IPv4 and IPv6 if 
they exist
@@ -78,8 +55,12 @@ then
    ip6tables-restore < $ipv6
 fi
 
-# Enable SSH by default
-systemctl enable --no-block --now ssh
+# Enable SSH
+systemctl enable --now --no-block ssh
 
 date > /var/cache/cloud/boot_up_done
-logger -t cloud "Boot up process done"
+
+if [ "$TYPE" == "router" ]
+then
+    python /opt/cloud/bin/baremetal-vr.py &
+fi
diff --git a/systemvm/debian/opt/cloud/bin/setup/router.sh 
b/systemvm/debian/opt/cloud/bin/setup/router.sh
index 2a8a4ad5d56..6bb3b6f2146 100755
--- a/systemvm/debian/opt/cloud/bin/setup/router.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/router.sh
@@ -18,35 +18,46 @@
 
 . /opt/cloud/bin/setup/common.sh
 
-setup_router() {
-  log_it "Setting up virtual router system vm"
+check_reboot_vmware() {
+  if [ "$HYPERVISOR" != "vmware" ]; then
+    return
+  fi
+
+  if [ -n "$MGMTNET" ]; then
+    MGMT_GW=$(echo $MGMTNET | awk -F "." '{print $1"."$2"."$3".1"}')
+    if ping -n -c 1 -W 3 $MGMT_GW &> /dev/null; then
+      log_it "Management gateway pingable, skipping VR reboot"
+      return
+    fi
+  fi
+
+  log_it "Management gateway not pingable, rebooting VR"
+  sync
+  reboot
+}
 
-  #To save router public interface and gw ip information
+setup_router() {
+  # To save router public interface and gw ip information
   touch /var/cache/cloud/ifaceGwIp
 
   oldmd5=
   [ -f "/etc/udev/rules.d/70-persistent-net.rules" ] && oldmd5=$(md5sum 
"/etc/udev/rules.d/70-persistent-net.rules" | awk '{print $1}')
 
-  if [ -n "$ETH2_IP" ]
-  then
-      setup_common eth0 eth1 eth2
-
-      if [ -n "$EXTRA_PUBNICS" ]
-      then
-        for((i = 3; i < 3 + $EXTRA_PUBNICS; i++))
-        do
-            setup_interface "$i" "0.0.0.0" "255.255.255.255" $GW "force"
-        done
-      fi
+  if [ -n "$ETH2_IP" ]; then
+    setup_common eth0 eth1 eth2
+
+    if [ -n "$EXTRA_PUBNICS" ]; then
+      for ((i = 3; i < 3 + $EXTRA_PUBNICS; i++)); do
+        setup_interface "$i" "0.0.0.0" "255.255.255.255" $GW "force"
+      done
+    fi
   else
     setup_common eth0 eth1
-      if [ -n "$EXTRA_PUBNICS" ]
-      then
-        for((i = 2; i < 2 + $EXTRA_PUBNICS; i++))
-        do
-            setup_interface "$i" "0.0.0.0" "255.255.255.255" $GW "force"
-        done
-      fi
+    if [ -n "$EXTRA_PUBNICS" ]; then
+      for ((i = 2; i < 2 + $EXTRA_PUBNICS; i++)); do
+        setup_interface "$i" "0.0.0.0" "255.255.255.255" $GW "force"
+      done
+    fi
   fi
 
   log_it "Checking udev NIC assignment order changes"
@@ -61,10 +72,7 @@ setup_router() {
     then
       log_it "Reloading udev for new udev NIC assignment"
       udevadm control --reload-rules && udevadm trigger
-      if [ "$HYPERVISOR" == "vmware" ]; then
-          sync
-          reboot
-      fi
+      check_reboot_vmware
     fi
   fi
 
@@ -79,14 +87,15 @@ setup_router() {
   disable_rpfilter_domR
   enable_fwding 1
   enable_rpsrfs 1
+  enable_passive_ftp 1
   cp /etc/iptables/iptables-router /etc/iptables/rules.v4
   setup_sshd $ETH1_IP "eth1"
 
-  #Only allow DNS service for current network
+  # Only allow DNS service for current network
   sed -i "s/-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT/-A INPUT -i 
eth0 -p udp -m udp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" 
/etc/iptables/rules.v4
   sed -i "s/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT/-A INPUT -i 
eth0 -p tcp -m tcp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" 
/etc/iptables/rules.v4
 
-  #setup hourly logrotate
+  # Setup hourly logrotate
   mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1
 }
 
diff --git a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh 
b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh
index 220a2ea8747..af111adc6ba 100755
--- a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh
@@ -84,6 +84,7 @@ EOF
   enable_vpc_rpsrfs 1
   disable_rpfilter
   enable_fwding 1
+  enable_passive_ftp 1
   cp /etc/iptables/iptables-vpcrouter /etc/iptables/rules.v4
   setup_sshd $ETH0_IP "eth0"
   cp /etc/vpcdnsmasq.conf /etc/dnsmasq.conf
diff --git a/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh 
b/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh
index b6de480c4e2..cedbb1c10b4 100644
--- a/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh
+++ b/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh
@@ -19,12 +19,12 @@
 set -e
 set -x
 
-# Perform fsck check on every 2nd boot
+# Perform fsck check on every 3rd boot
 function fix_tune2fs() {
   for partition in $(blkid -o list | grep ext | awk '{print $1}')
   do
     tune2fs -m 0 $partition
-    tune2fs -c 3 $partition
+    tune2fs -c 4 $partition
   done
   fdisk -l
   df -h


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to