| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 612b4ae commit 488c178
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,8 +68,93 @@ public void performDataMigration(Connection conn) { | |||
| 68 | 68 | updateSystemVmTemplates(conn); | |
| 69 | 69 | dropInvalidKeyFromStoragePoolTable(conn); | |
| 70 | 70 | dropDuplicatedForeignKeyFromAsyncJobTable(conn); | |
| 71 | + upgradeMemoryOfVirtualRoutervmOffering(conn); | ||
| 72 | + upgradeMemoryOfInternalLoadBalancervmOffering(conn); | ||
| 71 | 73 | } | |
| 72 | 74 | ||
| 75 | + private void upgradeMemoryOfVirtualRoutervmOffering(Connection conn) { | ||
| 76 | + PreparedStatement updatePstmt = null; | ||
| 77 | + PreparedStatement selectPstmt = null; | ||
| 78 | + ResultSet selectResultSet = null; | ||
| 79 | + int newRamSize = 256; //256MB | ||
| 80 | + long serviceOfferingId = 0; | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * Pick first row in service_offering table which has system vm type as domainrouter. User added offerings would start from 2nd row onwards. | ||
| 84 | + * We should not update/modify any user-defined offering. | ||
| 85 | + */ | ||
| 86 | + | ||
| 87 | + try { | ||
| 88 | + selectPstmt = conn.prepareStatement("SELECT id FROM `cloud`.`service_offering` WHERE vm_type='domainrouter'"); | ||
| 89 | + updatePstmt = conn.prepareStatement("UPDATE `cloud`.`service_offering` SET ram_size=? WHERE id=?"); | ||
| 90 | + selectResultSet = selectPstmt.executeQuery(); | ||
| 91 | + if(selectResultSet.next()) { | ||
| 92 | + serviceOfferingId = selectResultSet.getLong("id"); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + updatePstmt.setInt(1, newRamSize); | ||
| 96 | + updatePstmt.setLong(2, serviceOfferingId); | ||
| 97 | + updatePstmt.executeUpdate(); | ||
| 98 | + } catch (SQLException e) { | ||
| 99 | + throw new CloudRuntimeException("Unable to upgrade ram_size of service offering for domain router. ", e); | ||
| 100 | + } finally { | ||
| 101 | + try { | ||
| 102 | + if (selectPstmt != null) { | ||
| 103 | + selectPstmt.close(); | ||
| 104 | + } | ||
| 105 | + if (selectResultSet != null) { | ||
| 106 | + selectResultSet.close(); | ||
| 107 | + } | ||
| 108 | + if (updatePstmt != null) { | ||
| 109 | + updatePstmt.close(); | ||
| 110 | + } | ||
| 111 | + } catch (SQLException e) { | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + s_logger.debug("Done upgrading RAM for service offering of domain router to " + newRamSize); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + private void upgradeMemoryOfInternalLoadBalancervmOffering(Connection conn) { | ||
| 118 | + PreparedStatement updatePstmt = null; | ||
| 119 | + PreparedStatement selectPstmt = null; | ||
| 120 | + ResultSet selectResultSet = null; | ||
| 121 | + int newRamSize = 256; //256MB | ||
| 122 | + long serviceOfferingId = 0; | ||
| 123 | + | ||
| 124 | + /** | ||
| 125 | + * Pick first row in service_offering table which has system vm type as internalloadbalancervm. User added offerings would start from 2nd row onwards. | ||
| 126 | + * We should not update/modify any user-defined offering. | ||
| 127 | + */ | ||
| 128 | + | ||
| 129 | + try { | ||
| 130 | + selectPstmt = conn.prepareStatement("SELECT id FROM `cloud`.`service_offering` WHERE vm_type='internalloadbalancervm'"); | ||
| 131 | + updatePstmt = conn.prepareStatement("UPDATE `cloud`.`service_offering` SET ram_size=? WHERE id=?"); | ||
| 132 | + selectResultSet = selectPstmt.executeQuery(); | ||
| 133 | + if(selectResultSet.next()) { | ||
| 134 | + serviceOfferingId = selectResultSet.getLong("id"); | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + updatePstmt.setInt(1, newRamSize); | ||
| 138 | + updatePstmt.setLong(2, serviceOfferingId); | ||
| 139 | + updatePstmt.executeUpdate(); | ||
| 140 | + } catch (SQLException e) { | ||
| 141 | + throw new CloudRuntimeException("Unable to upgrade ram_size of service offering for internal loadbalancer vm. ", e); | ||
| 142 | + } finally { | ||
| 143 | + try { | ||
| 144 | + if (selectPstmt != null) { | ||
| 145 | + selectPstmt.close(); | ||
| 146 | + } | ||
| 147 | + if (selectResultSet != null) { | ||
| 148 | + selectResultSet.close(); | ||
| 149 | + } | ||
| 150 | + if (updatePstmt != null) { | ||
| 151 | + updatePstmt.close(); | ||
| 152 | + } | ||
| 153 | + } catch (SQLException e) { | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + s_logger.debug("Done upgrading RAM for service offering of internal loadbalancer vm to " + newRamSize); | ||
| 157 | + } | ||
| 73 | 158 | ||
| 74 | 159 | @Override | |
| 75 | 160 | public File[] getCleanupScripts() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | 33 | public interface InternalLoadBalancerVMManager { | |
| 34 | 34 | //RAM/CPU for the system offering used by Internal LB VMs | |
| 35 | - public static final int DEFAULT_INTERNALLB_VM_RAMSIZE = 128; // 128 MB | ||
| 35 | + public static final int DEFAULT_INTERNALLB_VM_RAMSIZE = 256; // 256 MB | ||
| 36 | 36 | public static final int DEFAULT_INTERNALLB_VM_CPU_MHZ = 256; // 256 MHz | |
| 37 | 37 | ||
| 38 | 38 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1452,7 +1452,7 @@ public enum Config { | |||
| 1452 | 1452 | "SAML2 IDP Metadata Downloading and parsing etc. activity timeout in milliseconds", | |
| 1453 | 1453 | null), | |
| 1454 | 1454 | //NetworkType("Hidden", ManagementServer.class, String.class, "network.type", "vlan", "The type of network that this deployment will use.", "vlan,direct"), | |
| 1455 | - RouterRamSize("Hidden", NetworkOrchestrationService.class, Integer.class, "router.ram.size", "128", "Default RAM for router VM (in MB).", null), | ||
| 1455 | + RouterRamSize("Hidden", NetworkOrchestrationService.class, Integer.class, "router.ram.size", "256", "Default RAM for router VM (in MB).", null), | ||
| 1456 | 1456 | ||
| 1457 | 1457 | DefaultPageSize("Advanced", ManagementServer.class, Long.class, "default.page.size", "500", "Default page size for API list* commands", null), | |
| 1458 | 1458 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA | |||
| 61 | 61 | static final ConfigKey<Integer> RouterAlertsCheckInterval = new ConfigKey<Integer>(Integer.class, RouterAlertsCheckIntervalCK, "Advanced", "1800", | |
| 62 | 62 | "Interval (in seconds) to check for alerts in Virtual Router.", false, ConfigKey.Scope.Global, null); | |
| 63 | 63 | ||
| 64 | - public static final int DEFAULT_ROUTER_VM_RAMSIZE = 128; // 128M | ||
| 64 | + public static final int DEFAULT_ROUTER_VM_RAMSIZE = 256; // 256M | ||
| 65 | 65 | public static final int DEFAULT_ROUTER_CPU_MHZ = 500; // 500 MHz | |
| 66 | 66 | public static final boolean USE_POD_VLAN = false; | |
| 67 | 67 | public static final int DEFAULT_PRIORITY = 100; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -439,6 +439,8 @@ UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm,LXC,Hyperv' W | |||
| 439 | 439 | UPDATE `cloud`.`configuration` SET description="If set to true, will set guest VM's name as it appears on the hypervisor, to its hostname. The flag is supported for VMware hypervisor only" WHERE name='vm.instancename.flag'; | |
| 440 | 440 | INSERT IGNORE INTO `cloud`.`configuration`(category, instance, component, name, value, description, default_value) VALUES ('Advanced', 'DEFAULT', 'management-server', 'implicit.host.tags', 'GPU', 'Tag hosts at the time of host disovery based on the host properties/capabilities ', 'GPU'); | |
| 441 | 441 | ||
| 442 | + UPDATE `cloud`.`configuration` SET value='256' WHERE name='router.ram.size'; | ||
| 443 | + | ||
| 442 | 444 | DROP VIEW IF EXISTS `cloud`.`domain_router_view`; | |
| 443 | 445 | CREATE VIEW `cloud`.`domain_router_view` AS | |
| 444 | 446 | select | |
| Back | FazBrowse Home | New Git URL |
0 commit comments