You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/11/20 20:55:03 UTC

[1/7] git commit: updated refs/heads/master to b3b56e2

Repository: cloudstack
Updated Branches:
  refs/heads/master 76f430cfc -> b3b56e2cd


CLOUDSTACK-9057 remove old system vm upgrade code

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

Branch: refs/heads/master
Commit: d6e77624d973062da6cefd5083b8479eec729617
Parents: f6db0a2
Author: Daan Hoogland <da...@onecht.net>
Authored: Wed Nov 11 15:02:28 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Nov 16 10:46:02 2015 +0000

----------------------------------------------------------------------
 .../com/cloud/upgrade/dao/Upgrade442to450.java  | 151 +------------------
 1 file changed, 1 insertion(+), 150 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d6e77624/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java
index 931e353..a9fb089 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java
@@ -25,16 +25,12 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
-
-import com.cloud.hypervisor.Hypervisor;
-import com.cloud.utils.crypt.DBEncryptionUtil;
 
 import org.apache.log4j.Logger;
 
+import com.cloud.utils.crypt.DBEncryptionUtil;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
@@ -68,7 +64,6 @@ public class Upgrade442to450 implements DbUpgrade {
 
     @Override
     public void performDataMigration(Connection conn) {
-        updateSystemVmTemplates(conn);
         dropInvalidKeyFromStoragePoolTable(conn);
         dropDuplicatedForeignKeyFromAsyncJobTable(conn);
         updateMaxRouterSizeConfig(conn);
@@ -152,150 +147,6 @@ public class Upgrade442to450 implements DbUpgrade {
         return new File[] {new File(script)};
     }
 
-    private void updateSystemVmTemplates(Connection conn) {
-        s_logger.debug("Updating System Vm template IDs");
-        //Get all hypervisors in use
-        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;
-                default:  // no action on cases Any, BareMetal, None, Ovm, Parralels, Simulator and VirtualBox:
-                    break;
-                }
-            }
-        } catch (SQLException e) {
-            s_logger.error("updateSystemVmTemplates:Exception while getting hypervisor types from clusters: "+e.getMessage());
-            throw new CloudRuntimeException("updateSystemVmTemplates:Exception while getting hypervisor types from clusters", e);
-        }
-
-        Map<Hypervisor.HypervisorType, String> NewTemplateNameList = new HashMap<Hypervisor.HypervisorType, String>() {
-            {
-                put(Hypervisor.HypervisorType.XenServer, "systemvm-xenserver-4.5");
-                put(Hypervisor.HypervisorType.VMware, "systemvm-vmware-4.5");
-                put(Hypervisor.HypervisorType.KVM, "systemvm-kvm-4.5");
-                put(Hypervisor.HypervisorType.LXC, "systemvm-lxc-4.5");
-                put(Hypervisor.HypervisorType.Hyperv, "systemvm-hyperv-4.5");
-            }
-        };
-
-        Map<Hypervisor.HypervisorType, String> routerTemplateConfigurationNames = new HashMap<Hypervisor.HypervisorType, String>() {
-            {
-                put(Hypervisor.HypervisorType.XenServer, "router.template.xen");
-                put(Hypervisor.HypervisorType.VMware, "router.template.vmware");
-                put(Hypervisor.HypervisorType.KVM, "router.template.kvm");
-                put(Hypervisor.HypervisorType.LXC, "router.template.lxc");
-                put(Hypervisor.HypervisorType.Hyperv, "router.template.hyperv");
-            }
-        };
-
-        Map<Hypervisor.HypervisorType, String> newTemplateUrl = new HashMap<Hypervisor.HypervisorType, String>() {
-            {
-                put(Hypervisor.HypervisorType.XenServer, "http://download.cloud.com/templates/4.5/systemvm64template-4.5-xen.vhd.bz2");
-                put(Hypervisor.HypervisorType.VMware, "http://download.cloud.com/templates/4.5/systemvm64template-4.5-vmware.ova");
-                put(Hypervisor.HypervisorType.KVM, "http://download.cloud.com/templates/4.5/systemvm64template-4.5-kvm.qcow2.bz2");
-                put(Hypervisor.HypervisorType.LXC, "http://download.cloud.com/templates/4.5/systemvm64template-4.5-kvm.qcow2.bz2");
-                put(Hypervisor.HypervisorType.Hyperv, "http://download.cloud.com/templates/4.5/systemvm64template-4.5-hyperv.vhd.zip");
-            }
-        };
-
-        Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new HashMap<Hypervisor.HypervisorType, String>() {
-            {
-                put(Hypervisor.HypervisorType.XenServer, "2b15ab4401c2d655264732d3fc600241");
-                put(Hypervisor.HypervisorType.VMware, "3106a79a4ce66cd7f6a7c50e93f2db57");
-                put(Hypervisor.HypervisorType.KVM, "aa9f501fecd3de1daeb9e2f357f6f002");
-                put(Hypervisor.HypervisorType.LXC, "aa9f501fecd3de1daeb9e2f357f6f002");
-                put(Hypervisor.HypervisorType.Hyperv, "70bd30ea02ee9ed67d2c6b85c179cee9");
-            }
-        };
-
-        for (Map.Entry<Hypervisor.HypervisorType, String> hypervisorAndTemplateName : NewTemplateNameList.entrySet()) {
-            s_logger.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.5.0 system Vm 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 (SQLException e)
-                {
-                    s_logger.error("updateSystemVmTemplates:Exception while getting ids of templates: "+e.getMessage());
-                    throw new CloudRuntimeException("updateSystemVmTemplates:Exception 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 (SQLException e)
-                    {
-                        s_logger.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 (Exception e)
-                    {
-                        s_logger.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 (SQLException e)
-                    {
-                        s_logger.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);
-                    }
-                } else {
-                    if (hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())){
-                        throw new CloudRuntimeException("4.5.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot upgrade system Vms");
-                    } else {
-                        s_logger.warn("4.5.0 " + 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 (SQLException e)
-                        {
-                            s_logger.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 (SQLException e) {
-                s_logger.error("updateSystemVmTemplates:Exception while getting ids of templates: "+e.getMessage());
-                throw new CloudRuntimeException("updateSystemVmTemplates:Exception while getting ids of templates", e);
-            }
-        }
-        s_logger.debug("Updating System Vm Template IDs Complete");
-    }
-
-
     private void dropInvalidKeyFromStoragePoolTable(Connection conn) {
         HashMap<String, List<String>> uniqueKeys = new HashMap<String, List<String>>();
         List<String> keys = new ArrayList<String>();


[6/7] git commit: updated refs/heads/master to b3b56e2

Posted by re...@apache.org.
Merge pull request #1073 from ustcweizhou/CLOUDSTACK-9055

CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networksThis issue happened when the KVM nodes is down.It might also happen when the cloudstack-agent is killed unexpectedly.

* pr/1073:
  CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networks

Signed-off-by: Remi Bergsma <gi...@remi.nl>


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

Branch: refs/heads/master
Commit: 238c483a7ca744191972e3bb3404a1a506dcb2e1
Parents: 401693e 66fc7c6
Author: Remi Bergsma <gi...@remi.nl>
Authored: Fri Nov 20 20:49:31 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri Nov 20 20:49:32 2015 +0100

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java        | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[7/7] git commit: updated refs/heads/master to b3b56e2

Posted by re...@apache.org.
Merge release branch 4.6 to master

* 4.6:
  CLOUDSTACK-9053 security upgrade as per COLLECTIONS-580
  CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networks
  CLOUDSTACK-9057 remove old system vm upgrade code


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

Branch: refs/heads/master
Commit: b3b56e2cd84a7d716735c4b684f271247192dff3
Parents: 76f430c 238c483
Author: Remi Bergsma <gi...@remi.nl>
Authored: Fri Nov 20 20:53:58 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri Nov 20 20:53:58 2015 +0100

----------------------------------------------------------------------
 .../com/cloud/upgrade/dao/Upgrade442to450.java  | 151 +------------------
 pom.xml                                         |   2 +-
 .../VirtualNetworkApplianceManagerImpl.java     |  10 +-
 3 files changed, 8 insertions(+), 155 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b56e2c/pom.xml
----------------------------------------------------------------------


[2/7] git commit: updated refs/heads/master to b3b56e2

Posted by re...@apache.org.
CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networks


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

Branch: refs/heads/master
Commit: 66fc7c62f4b21e770ecc6d6dfa99b3b06f410e89
Parents: f6db0a2
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Wed Nov 11 12:18:54 2015 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Mon Nov 16 11:46:26 2015 +0100

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java        | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66fc7c62/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index f0e5f09..ca1f67d 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1013,10 +1013,12 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
                         s_logger.warn("Unable to update router " + router.getHostName() + "'s status");
                     }
                     RedundantState state = RedundantState.UNKNOWN;
-                    if (answer != null && answer.getResult()) {
-                        state = answer.getState();
-                    } else {
-                        s_logger.info("Agent response doesn't seem to be correct ==> " + answer.getResult());
+                    if (answer != null) {
+                        if (answer.getResult()) {
+                            state = answer.getState();
+                        } else {
+                            s_logger.info("Agent response doesn't seem to be correct ==> " + answer.getResult());
+                        }
                     }
                     router.setRedundantState(state);
                     updated = true;


[3/7] git commit: updated refs/heads/master to b3b56e2

Posted by re...@apache.org.
CLOUDSTACK-9053 security upgrade as per COLLECTIONS-580

  cloustack is not vulnerable but as the classes are in they might
  be used in the future so we upgrade to prevent accidental
  vulnerabilities.

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

Branch: refs/heads/master
Commit: d40d3498a6faa62fb8dc0df4d4e14b07a8363cb3
Parents: 37cee33
Author: Daan Hoogland <da...@onecht.net>
Authored: Wed Nov 18 22:54:25 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Wed Nov 18 23:35:42 2015 +0100

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d40d3498/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2fe6547..8fb0ed2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,7 +60,7 @@
     <cs.pool.version>1.6</cs.pool.version>
     <cs.codec.version>1.10</cs.codec.version>
     <cs.configuration.version>1.10</cs.configuration.version>
-    <cs.collections.version>3.2.1</cs.collections.version>
+    <cs.collections.version>3.2.2</cs.collections.version>
     <cs.logging.version>1.1.1</cs.logging.version>
     <cs.discovery.version>0.5</cs.discovery.version>
     <cs.ejb.version>3.0</cs.ejb.version>


[5/7] git commit: updated refs/heads/master to b3b56e2

Posted by re...@apache.org.
Merge pull request #1089 from DaanHoogland/CLOUDSTACK-9053

CLOUDSTACK-9053 security upgrade as per COLLECTIONS-580  cloustack is not vulnerable but as the classes are in they might
  be used in the future so we upgrade to prevent accidental
  vulnerabilities.

unit tests in master succeeded. unit tests on 4.6 passed. integration tests going on.

* pr/1089:
  CLOUDSTACK-9053 security upgrade as per COLLECTIONS-580

Signed-off-by: Remi Bergsma <gi...@remi.nl>


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

Branch: refs/heads/master
Commit: 401693eafbe940c8fc349eec950779cf3e3f2717
Parents: 4df60db d40d349
Author: Remi Bergsma <gi...@remi.nl>
Authored: Fri Nov 20 10:41:57 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri Nov 20 10:41:57 2015 +0100

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[4/7] git commit: updated refs/heads/master to b3b56e2

Posted by re...@apache.org.
Merge pull request #1072 from DaanHoogland/CLOUDSTACK-9057

CLOUDSTACK-9057 remove old system vm upgrade codereplacing #1061 on release branch for 4.6

* pr/1072:
  CLOUDSTACK-9057 remove old system vm upgrade code

Signed-off-by: Remi Bergsma <gi...@remi.nl>


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

Branch: refs/heads/master
Commit: 4df60db7d94f2db6351d3f57f9ae8c6bbf03424e
Parents: 78e5518 d6e7762
Author: Remi Bergsma <gi...@remi.nl>
Authored: Fri Nov 20 10:31:36 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri Nov 20 10:31:37 2015 +0100

----------------------------------------------------------------------
 .../com/cloud/upgrade/dao/Upgrade442to450.java  | 151 +------------------
 1 file changed, 1 insertion(+), 150 deletions(-)
----------------------------------------------------------------------