cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [3/3] git commit: updated refs/heads/stage-451 to 9ffc8d7
Date Wed, 11 Mar 2015 11:58:09 GMT
engine: Add Upgrade path from 4.5.0 to 4.5.1

Encrypts:
- Remote access vpn preshared key
- StoragePool's user info
- Keystore's key

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9ffc8d7a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9ffc8d7a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9ffc8d7a

Branch: refs/heads/stage-451
Commit: 9ffc8d7aa0bb74dfae9e84bff5b558aed376933c
Parents: 9a76d4d
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Wed Mar 11 14:55:26 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Wed Mar 11 17:27:13 2015 +0530

----------------------------------------------------------------------
 .../cloud/network/dao/RemoteAccessVpnVO.java    |   7 +-
 .../cloud/upgrade/DatabaseUpgradeChecker.java   |  81 +++++----
 .../com/cloud/upgrade/dao/Upgrade450to451.java  | 178 +++++++++++++++++++
 .../engine/cloud/entity/api/db/VMEntityVO.java  |  27 ++-
 .../storage/datastore/db/StoragePoolVO.java     |  21 +--
 .../framework/security/keystore/KeystoreVO.java |   6 +-
 setup/db/db/schema-450to451-cleanup.sql         |  20 +++
 setup/db/db/schema-450to451.sql                 |  26 +++
 8 files changed, 298 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
index 0616939..fdb98b9 100644
--- a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
+++ b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
@@ -16,7 +16,8 @@
 // under the License.
 package com.cloud.network.dao;
 
-import java.util.UUID;
+import com.cloud.network.RemoteAccessVpn;
+import com.cloud.utils.db.Encrypt;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -24,8 +25,7 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
-
-import com.cloud.network.RemoteAccessVpn;
+import java.util.UUID;
 
 @Entity
 @Table(name = ("remote_access_vpn"))
@@ -48,6 +48,7 @@ public class RemoteAccessVpnVO implements RemoteAccessVpn {
     @Column(name = "ip_range")
     private String ipRange;
 
+    @Encrypt
     @Column(name = "ipsec_psk")
     private String ipsecPresharedKey;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index a8d1513..d6e55f8 100755
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -71,6 +71,7 @@ import com.cloud.upgrade.dao.Upgrade432to440;
 import com.cloud.upgrade.dao.Upgrade440to441;
 import com.cloud.upgrade.dao.Upgrade441to442;
 import com.cloud.upgrade.dao.Upgrade442to450;
+import com.cloud.upgrade.dao.Upgrade450to451;
 import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
 import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
 import com.cloud.upgrade.dao.VersionDao;
@@ -101,7 +102,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
             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 Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.1.8", new DbUpgrade[] {new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
             new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(),
new Upgrade225to226(),
@@ -109,7 +110,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
             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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.1.9", new DbUpgrade[] {new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
             new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(),
new Upgrade225to226(),
@@ -117,139 +118,141 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
             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 Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.2.1", new DbUpgrade[] {new Upgrade221to222(), new UpgradeSnapshot223to224(),
new Upgrade222to224(),
             new Upgrade224to225(), new Upgrade225to226(), new Upgrade227to228(), 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 Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.2.2", new DbUpgrade[] {new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
             new Upgrade225to226(), new Upgrade227to228(), 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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.2.3", new DbUpgrade[] {new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
             new Upgrade225to226(), new Upgrade227to228(), 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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.2.4", new DbUpgrade[] {new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(),
             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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.2.5", new DbUpgrade[] {new Upgrade225to226(), new Upgrade227to228(),
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 Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(),
new Upgrade450to451()});
 
         _upgradeMap.put("2.2.6", new DbUpgrade[] {new Upgrade227to228(), 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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("2.2.7", new DbUpgrade[] {new Upgrade227to228(), 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 Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(),
new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(),
new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("3.0.2", new DbUpgrade[] {new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
-            new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450()});
+            new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(),
new Upgrade450to451()});
 
-        _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.0.1", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.0.1", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.0.2", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.0.2", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.1.0", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450()});
+        _upgradeMap.put("4.1.0", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.1.1", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450()});
+        _upgradeMap.put("4.1.1", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(),
new Upgrade450to451()});
 
-        _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.3.1", new DbUpgrade[] {new Upgrade431to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.3.1", new DbUpgrade[] {new Upgrade431to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.3.2", new DbUpgrade[] {new Upgrade432to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("4.3.2", new DbUpgrade[] {new Upgrade432to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.4.0", new DbUpgrade[] {new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450()});
+        _upgradeMap.put("4.4.0", new DbUpgrade[] {new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
-        _upgradeMap.put("4.4.1", new DbUpgrade[] {new Upgrade441to442(), new Upgrade442to450()
});
+        _upgradeMap.put("4.4.1", new DbUpgrade[] {new Upgrade441to442(), new Upgrade442to450(),
new Upgrade450to451() });
 
-        _upgradeMap.put("4.4.2", new DbUpgrade[] {new Upgrade442to450()});
+        _upgradeMap.put("4.4.2", new DbUpgrade[] {new Upgrade442to450(), new Upgrade450to451()});
+
+        _upgradeMap.put("4.5.0", new DbUpgrade[] {new Upgrade450to451()});
 
         //CP Upgrades
         _upgradeMap.put("3.0.3", new DbUpgrade[] {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 Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(),
new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("3.0.6", new DbUpgrade[] {new Upgrade306to307(), new Upgrade307to410(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
-            new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450()});
+            new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(),
new Upgrade450to451()});
 
-        _upgradeMap.put("3.0.7", new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450()});
+        _upgradeMap.put("3.0.7", new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
 
         _upgradeMap.put("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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451()});
     }
 
     protected void runScript(Connection conn, File file) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java
new file mode 100644
index 0000000..89fe5ec
--- /dev/null
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java
@@ -0,0 +1,178 @@
+// 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 com.cloud.utils.crypt.DBEncryptionUtil;
+import com.cloud.utils.db.TransactionLegacy;
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
+import org.apache.log4j.Logger;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Upgrade450to451 implements DbUpgrade {
+        final static Logger s_logger = Logger.getLogger(Upgrade450to451.class);
+
+    @Override
+    public String[] getUpgradableVersionRange() {
+        return new String[] {"4.5.0", "4.5.1"};
+    }
+
+    @Override
+    public String getUpgradedVersion() {
+        return "4.5.1";
+    }
+
+    @Override
+    public boolean supportsRollingUpgrade() {
+        return false;
+    }
+
+    @Override
+    public File[] getPrepareScripts() {
+        String script = Script.findScript("", "db/schema-450to451.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-450to451.sql");
+        }
+        return new File[] {new File(script)};
+    }
+
+    @Override
+    public File[] getCleanupScripts() {
+        String script = Script.findScript("", "db/schema-450to451-cleanup.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-450to451-cleanup.sql");
+        }
+
+        return new File[] {new File(script)};
+    }
+
+    @Override
+    public void performDataMigration(Connection conn) {
+        encryptKeyInKeyStore(conn);
+        encryptIpSecPresharedKeysOfRemoteAccessVpn(conn);
+        encryptStoragePoolUserInfo(conn);
+    }
+
+    private void encryptKeyInKeyStore(Connection conn) {
+        PreparedStatement selectStatement = null;
+        ResultSet selectResultSet = null;
+        PreparedStatement updateStatement = null;
+        try {
+            selectStatement = conn.prepareStatement("SELECT ks.id, ks.key FROM cloud.keystore
ks WHERE ks.key IS NOT null");
+            selectResultSet = selectStatement.executeQuery();
+            while (selectResultSet.next()) {
+                updateStatement = conn.prepareStatement("UPDATE cloud.keystore ks SET ks.key
= ? WHERE ks.id = ?");
+                updateStatement.setString(1, DBEncryptionUtil.encrypt(selectResultSet.getString(2)));
+                updateStatement.setLong(2, selectResultSet.getLong(1));
+                updateStatement.executeUpdate();
+                updateStatement.close();
+            }
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Exception while encrypting key column in keystore
table", e);
+        } finally {
+            if (selectResultSet != null)
+                try {
+                    selectResultSet.close();
+                } catch (SQLException e) {
+                }
+            if (selectStatement != null)
+                try {
+                    selectStatement.close();
+                } catch (SQLException e) {
+                }
+            if (updateStatement != null)
+                try {
+                    updateStatement.close();
+                } catch (SQLException e) {
+                }
+        }
+        s_logger.debug("Done encrypting keystore's key column");
+    }
+
+    private void encryptIpSecPresharedKeysOfRemoteAccessVpn(Connection conn) {
+        PreparedStatement selectStatement = null;
+        PreparedStatement updateStatement = null;
+        ResultSet resultSet = null;
+        try {
+            selectStatement = conn.prepareStatement("SELECT id, ipsec_psk FROM `cloud`.`remote_access_vpn`");
+            resultSet = selectStatement.executeQuery();
+            while (resultSet.next()) {
+                String preSharedKey = resultSet.getString(2);
+                updateStatement = conn.prepareStatement("UPDATE `cloud`.`remote_access_vpn`
SET ipsec_psk=? WHERE id=?");
+                updateStatement.setString(1, DBEncryptionUtil.encrypt(preSharedKey));
+                updateStatement.setLong(2, resultSet.getLong(1));
+                updateStatement.executeUpdate();
+                updateStatement.close();
+            }
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Unable to update the remote_access_vpn's preshared
key ipsec_psk column", e);
+        } finally {
+            try {
+                if (resultSet != null) {
+                    resultSet.close();
+                }
+                if ((selectStatement != null) && (!selectStatement.isClosed())) {
+                    selectStatement.close();
+                }
+                if ((updateStatement != null) && (!updateStatement.isClosed()))
+                    updateStatement.close();
+            } catch (SQLException e) {
+            }
+        }
+        s_logger.debug("Done encrypting remote_access_vpn's ipsec_psk column");
+    }
+
+    private void encryptStoragePoolUserInfo(Connection conn) {
+        List<PreparedStatement> listOfStatements = new ArrayList<PreparedStatement>();
+        try {
+            PreparedStatement preparedStatement = conn.prepareStatement("SELECT id, user_info
FROM `cloud`.`storage_pool` WHERE user_info IS NOT NULL");
+            listOfStatements.add(preparedStatement);
+            ResultSet resultSet = preparedStatement.executeQuery();
+            while (resultSet.next()) {
+                long id = resultSet.getLong(1);
+                String userInfo = resultSet.getString(2);
+                String encryptedUserInfo = DBEncryptionUtil.encrypt(userInfo);
+                preparedStatement = conn.prepareStatement("UPDATE `cloud`.`storage_pool`
SET user_info=? WHERE id=?");
+                listOfStatements.add(preparedStatement);
+                if (encryptedUserInfo == null)
+                    preparedStatement.setNull(1, 12);
+                else {
+                    preparedStatement.setBytes(1, encryptedUserInfo.getBytes("UTF-8"));
+                }
+                preparedStatement.setLong(2, id);
+                preparedStatement.executeUpdate();
+                preparedStatement.close();
+            }
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Unable encrypt storage pool user info ", e);
+        } catch (UnsupportedEncodingException e) {
+            throw new CloudRuntimeException("Unable encrypt storage pool user info ", e);
+        } finally {
+            TransactionLegacy.closePstmts(listOfStatements);
+        }
+        s_logger.debug("Done encrypting storage_pool's user_info column");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
index b20cae3..d7560e2 100644
--- a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
+++ b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
@@ -16,11 +16,13 @@
 // under the License.
 package org.apache.cloudstack.engine.cloud.entity.api.db;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.UUID;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.utils.db.Encrypt;
+import com.cloud.utils.db.GenericDao;
+import com.cloud.utils.db.StateMachine;
+import com.cloud.utils.fsm.FiniteStateObject;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachine.State;
 
 import javax.persistence.Column;
 import javax.persistence.DiscriminatorColumn;
@@ -36,14 +38,11 @@ import javax.persistence.TableGenerator;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.utils.db.Encrypt;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.db.StateMachine;
-import com.cloud.utils.fsm.FiniteStateObject;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachine.State;
+import java.security.SecureRandom;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
 
 @Entity
 @Table(name = "vm_instance")
@@ -190,7 +189,7 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State,
Virt
         this.type = type;
         this.guestOSId = guestOSId;
         this.haEnabled = haEnabled;
-        vncPassword = Long.toHexString(new Random().nextLong());
+        vncPassword = Long.toHexString(new SecureRandom().nextLong());
         state = State.Stopped;
         this.accountId = accountId;
         this.domainId = domainId;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
index 33e1d78..ad2ad41 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
@@ -16,8 +16,14 @@
 // under the License.
 package org.apache.cloudstack.storage.datastore.db;
 
-import java.util.Date;
-import java.util.UUID;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.ScopeType;
+import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.StoragePool;
+import com.cloud.storage.StoragePoolStatus;
+import com.cloud.utils.UriUtils;
+import com.cloud.utils.db.Encrypt;
+import com.cloud.utils.db.GenericDao;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -28,14 +34,8 @@ import javax.persistence.Table;
 import javax.persistence.TableGenerator;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.ScopeType;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
-import com.cloud.utils.UriUtils;
-import com.cloud.utils.db.GenericDao;
+import java.util.Date;
+import java.util.UUID;
 
 @Entity
 @Table(name = "storage_pool")
@@ -98,6 +98,7 @@ public class StoragePoolVO implements StoragePool {
     @Column(name = "port")
     private int port;
 
+    @Encrypt
     @Column(name = "user_info")
     private String userInfo;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreVO.java
----------------------------------------------------------------------
diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreVO.java
b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreVO.java
index 2e4b9fe..e243500 100644
--- a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreVO.java
+++ b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreVO.java
@@ -16,6 +16,9 @@
 // under the License.
 package org.apache.cloudstack.framework.security.keystore;
 
+import com.cloud.utils.db.Encrypt;
+import org.apache.cloudstack.api.InternalIdentity;
+
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
@@ -23,8 +26,6 @@ import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
-import org.apache.cloudstack.api.InternalIdentity;
-
 @Entity
 @Table(name = "keystore")
 public class KeystoreVO implements InternalIdentity {
@@ -39,6 +40,7 @@ public class KeystoreVO implements InternalIdentity {
     @Column(name = "certificate", length = 65535)
     private String certificate;
 
+    @Encrypt
     @Column(name = "key", length = 65535)
     private String key;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/setup/db/db/schema-450to451-cleanup.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-450to451-cleanup.sql b/setup/db/db/schema-450to451-cleanup.sql
new file mode 100644
index 0000000..6a8229a
--- /dev/null
+++ b/setup/db/db/schema-450to451-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 cleanup from 4.5.0 to 4.5.1;
+--;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ffc8d7a/setup/db/db/schema-450to451.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-450to451.sql b/setup/db/db/schema-450to451.sql
new file mode 100644
index 0000000..b16d40f
--- /dev/null
+++ b/setup/db/db/schema-450to451.sql
@@ -0,0 +1,26 @@
+-- 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.5.0 to 4.5.1;
+--;
+
+UPDATE IGNORE `cloud`.`configuration` SET `default_value`='PBKDF2,SHA256SALT,MD5,LDAP,SAML2,PLAINTEXT'
WHERE name='user.authenticators.order';
+UPDATE IGNORE `cloud`.`configuration` SET `value`='PBKDF2,SHA256SALT,MD5,LDAP,SAML2,PLAINTEXT'
WHERE name='user.authenticators.order';
+UPDATE IGNORE `cloud`.`configuration` SET `default_value`='PBKDF2,SHA256SALT,MD5,LDAP,SAML2,PLAINTEXT'
WHERE name='user.password.encoders.order';
+UPDATE IGNORE `cloud`.`configuration` SET `value`='PBKDF2,SHA256SALT,MD5,LDAP,SAML2,PLAINTEXT'
WHERE name='user.password.encoders.order';
+UPDATE IGNORE `cloud`.`configuration` SET `value`="MD5,LDAP,PLAINTEXT" WHERE `name`="user.password.encoders.exclude";


Mime
View raw message