mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Removed vm_type update in DB 217 to 221 upgrade
This commit is contained in:
parent
6be1681647
commit
579a9294bf
@ -156,10 +156,10 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
pstmt.close();
|
pstmt.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void insertNic(Connection conn, long networkId, long instanceId, boolean running, String macAddress, String ipAddress, String netmask, String strategy, String gateway, String vnet, String guru, boolean defNic, int deviceId, String mode, String reservationId, String vmType) throws SQLException {
|
protected void insertNic(Connection conn, long networkId, long instanceId, boolean running, String macAddress, String ipAddress, String netmask, String strategy, String gateway, String vnet, String guru, boolean defNic, int deviceId, String mode, String reservationId) throws SQLException {
|
||||||
PreparedStatement pstmt = conn.prepareStatement(
|
PreparedStatement pstmt = conn.prepareStatement(
|
||||||
"INSERT INTO nics (instance_id, network_id, mac_address, ip4_address, netmask, strategy, ip_type, broadcast_uri, mode, reserver_name, reservation_id, device_id, update_time, isolation_uri, ip6_address, default_nic, created, removed, state, gateway, vm_type) " +
|
"INSERT INTO nics (instance_id, network_id, mac_address, ip4_address, netmask, strategy, ip_type, broadcast_uri, mode, reserver_name, reservation_id, device_id, update_time, isolation_uri, ip6_address, default_nic, created, removed, state, gateway) " +
|
||||||
"VALUES (?, ?, ?, ?, ?, ?, 'Ip4', ?, ?, ?, ?, ?, now(), ?, NULL, ?, now(), NULL, ?, ?, ?)");
|
"VALUES (?, ?, ?, ?, ?, ?, 'Ip4', ?, ?, ?, ?, ?, now(), ?, NULL, ?, now(), NULL, ?, ?)");
|
||||||
int i = 1;
|
int i = 1;
|
||||||
String isolationUri = null;
|
String isolationUri = null;
|
||||||
|
|
||||||
@ -187,7 +187,6 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
pstmt.setBoolean(i++, defNic);
|
pstmt.setBoolean(i++, defNic);
|
||||||
pstmt.setString(i++, running ? "Reserved" : "Allocated");
|
pstmt.setString(i++, running ? "Reserved" : "Allocated");
|
||||||
pstmt.setString(i++, gateway);
|
pstmt.setString(i++, gateway);
|
||||||
pstmt.setString(i++, vmType);
|
|
||||||
pstmt.executeUpdate();
|
pstmt.executeUpdate();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
}
|
}
|
||||||
@ -221,12 +220,12 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
pstmt.close();
|
pstmt.close();
|
||||||
|
|
||||||
if (zoneType.equalsIgnoreCase("Basic")) {
|
if (zoneType.equalsIgnoreCase("Basic")) {
|
||||||
insertNic(conn, controlNetworkId, domrId, running, privateMac, privateIp, privateNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 1, "Static", privateIp != null ? (domrId + privateIp) : null, type);
|
insertNic(conn, controlNetworkId, domrId, running, privateMac, privateIp, privateNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 1, "Static", privateIp != null ? (domrId + privateIp) : null);
|
||||||
insertNic(conn, guestNetworkId, domrId, running, guestMac, guestIp, guestNetmask, "Start", gateway, vnet, "DirectPodBasedNetworkGuru", false, 0, "Static", null, type);
|
insertNic(conn, guestNetworkId, domrId, running, guestMac, guestIp, guestNetmask, "Start", gateway, vnet, "DirectPodBasedNetworkGuru", false, 0, "Static", null);
|
||||||
} else {
|
} else {
|
||||||
insertNic(conn, publicNetworkId, domrId, running, publicMac, publicIp, publicNetmask, "Create", gateway, null, "PublicNetworkGuru", true, 2, "Static", null, type);
|
insertNic(conn, publicNetworkId, domrId, running, publicMac, publicIp, publicNetmask, "Create", gateway, null, "PublicNetworkGuru", true, 2, "Static", null);
|
||||||
insertNic(conn, controlNetworkId, domrId, running, privateMac, privateIp, privateNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 1, "Static", privateIp != null ? (domrId + privateIp) : null, type);
|
insertNic(conn, controlNetworkId, domrId, running, privateMac, privateIp, privateNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 1, "Static", privateIp != null ? (domrId + privateIp) : null);
|
||||||
insertNic(conn, guestNetworkId, domrId, running, guestMac, guestIp, guestNetmask, "Start", null, vnet, "GuestNetworkGuru", false, 0, "Static", null, type);
|
insertNic(conn, guestNetworkId, domrId, running, guestMac, guestIp, guestNetmask, "Start", null, vnet, "GuestNetworkGuru", false, 0, "Static", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -276,14 +275,14 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
s_logger.debug("Gateway is " + podGateway);
|
s_logger.debug("Gateway is " + podGateway);
|
||||||
|
|
||||||
if (zoneType.equalsIgnoreCase("Basic")) {
|
if (zoneType.equalsIgnoreCase("Basic")) {
|
||||||
insertNic(conn, publicNetworkId, ssvmId, running, publicMac, publicIp, publicNetmask, "Start", gateway, null, "DirectPodBasedNetworkGuru", true, 2, "Static", null, type);
|
insertNic(conn, publicNetworkId, ssvmId, running, publicMac, publicIp, publicNetmask, "Start", gateway, null, "DirectPodBasedNetworkGuru", true, 2, "Static", null);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
insertNic(conn, publicNetworkId, ssvmId, running, publicMac, publicIp, publicNetmask, "Create", gateway, null, "PublicNetworkGuru", true, 2, "Static", null, type);
|
insertNic(conn, publicNetworkId, ssvmId, running, publicMac, publicIp, publicNetmask, "Create", gateway, null, "PublicNetworkGuru", true, 2, "Static", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
insertNic(conn, controlNetworkId, ssvmId, running, guestMac, guestIp, guestNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 0, "Static", guestIp != null ? (ssvmId + guestIp) : null, type);
|
insertNic(conn, controlNetworkId, ssvmId, running, guestMac, guestIp, guestNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 0, "Static", guestIp != null ? (ssvmId + guestIp) : null);
|
||||||
insertNic(conn, managementNetworkId, ssvmId, running, privateMac, privateIp, privateNetmask, "Start", podGateway, null, "PodBasedNetworkGuru", false, 1, "Static", null, type);
|
insertNic(conn, managementNetworkId, ssvmId, running, privateMac, privateIp, privateNetmask, "Start", podGateway, null, "PodBasedNetworkGuru", false, 1, "Static", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void upgradeConsoleProxy(Connection conn, long cpId, long publicNetworkId, long managementNetworkId, long controlNetworkId, String zoneType) throws SQLException {
|
protected void upgradeConsoleProxy(Connection conn, long cpId, long publicNetworkId, long managementNetworkId, long controlNetworkId, String zoneType) throws SQLException {
|
||||||
@ -327,13 +326,13 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
|
|
||||||
|
|
||||||
if (zoneType.equalsIgnoreCase("Basic")) {
|
if (zoneType.equalsIgnoreCase("Basic")) {
|
||||||
insertNic(conn, publicNetworkId, cpId, running, publicMac, publicIp, publicNetmask, "Start", gateway, null, "DirectPodBasedNetworkGuru", true, 2, "Static", null, type);
|
insertNic(conn, publicNetworkId, cpId, running, publicMac, publicIp, publicNetmask, "Start", gateway, null, "DirectPodBasedNetworkGuru", true, 2, "Static", null);
|
||||||
} else {
|
} else {
|
||||||
insertNic(conn, publicNetworkId, cpId, running, publicMac, publicIp, publicNetmask, "Create", gateway, null, "PublicNetworkGuru", true, 2, "Static", null, type);
|
insertNic(conn, publicNetworkId, cpId, running, publicMac, publicIp, publicNetmask, "Create", gateway, null, "PublicNetworkGuru", true, 2, "Static", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
insertNic(conn, controlNetworkId, cpId, running, guestMac, guestIp, guestNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 0, "Static", guestIp != null ? (cpId + guestIp) : null, type);
|
insertNic(conn, controlNetworkId, cpId, running, guestMac, guestIp, guestNetmask, "Start", "169.254.0.1", null, "ControlNetworkGuru", false, 0, "Static", guestIp != null ? (cpId + guestIp) : null);
|
||||||
insertNic(conn, managementNetworkId, cpId, running, privateMac, privateIp, privateNetmask, "Start", podGateway, null, "PodBasedNetworkGuru", false, 1, "Static", null, type);
|
insertNic(conn, managementNetworkId, cpId, running, privateMac, privateIp, privateNetmask, "Start", podGateway, null, "PodBasedNetworkGuru", false, 1, "Static", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void upgradeVirtualUserVms(Connection conn, long domainRouterId, long networkId, String gateway, String vnet) throws SQLException {
|
protected void upgradeVirtualUserVms(Connection conn, long domainRouterId, long networkId, String gateway, String vnet) throws SQLException {
|
||||||
@ -348,7 +347,6 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
vm[2] = rs.getString(3); // ip address
|
vm[2] = rs.getString(3); // ip address
|
||||||
vm[3] = rs.getString(4); // netmask
|
vm[3] = rs.getString(4); // netmask
|
||||||
vm[4] = rs.getString(5); // vm state
|
vm[4] = rs.getString(5); // vm state
|
||||||
vm[5] = rs.getString(6); // vm type
|
|
||||||
vms.add(vm);
|
vms.add(vm);
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
@ -364,7 +362,7 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
running = true;
|
running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
insertNic(conn, networkId, (Long)vm[0], running, (String)vm[1], (String)vm[2], (String)vm[3], "Start", gateway, vnet, "GuestNetworkGuru", true, 0, "Dhcp", null, (String)vm[5]);
|
insertNic(conn, networkId, (Long)vm[0], running, (String)vm[1], (String)vm[2], (String)vm[3], "Start", gateway, vnet, "GuestNetworkGuru", true, 0, "Dhcp", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,7 +394,7 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||||||
if (state.equals("Running") || state.equals("Starting") || state.equals("Stopping")) {
|
if (state.equals("Running") || state.equals("Starting") || state.equals("Stopping")) {
|
||||||
running = true;
|
running = true;
|
||||||
}
|
}
|
||||||
insertNic(conn, networkId, (Long)vm[0], running, (String)vm[1], (String)vm[2], (String)vm[3], "Start", gateway, vnet, "DirectPodBasedNetworkGuru", true, 0, "Dhcp", null, (String)vm[5]);
|
insertNic(conn, networkId, (Long)vm[0], running, (String)vm[1], (String)vm[2], (String)vm[3], "Start", gateway, vnet, "DirectPodBasedNetworkGuru", true, 0, "Dhcp", null);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -164,7 +164,6 @@ CREATE TABLE `cloud`.`nics` (
|
|||||||
`isolation_uri` varchar(255) COMMENT 'id for isolation',
|
`isolation_uri` varchar(255) COMMENT 'id for isolation',
|
||||||
`ip6_address` char(40) COMMENT 'ip6 address',
|
`ip6_address` char(40) COMMENT 'ip6 address',
|
||||||
`default_nic` tinyint NOT NULL COMMENT "None",
|
`default_nic` tinyint NOT NULL COMMENT "None",
|
||||||
`vm_type` varchar(32) COMMENT 'type of vm: System or User vm',
|
|
||||||
`created` datetime NOT NULL COMMENT 'date created',
|
`created` datetime NOT NULL COMMENT 'date created',
|
||||||
`removed` datetime COMMENT 'date removed if not null',
|
`removed` datetime COMMENT 'date removed if not null',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
@ -521,6 +520,7 @@ CREATE TABLE `cloud`.`ovs_vm_flow_log` (
|
|||||||
`created` datetime NOT NULL COMMENT 'time the entry was requested',
|
`created` datetime NOT NULL COMMENT 'time the entry was requested',
|
||||||
`logsequence` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies flow update',
|
`logsequence` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies flow update',
|
||||||
`vm_name` varchar(255) NOT NULL COMMENT 'vm name',
|
`vm_name` varchar(255) NOT NULL COMMENT 'vm name',
|
||||||
|
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user