diff --git a/agent/pom.xml b/agent/pom.xml
index 1a6840c1c512..9ff0c5e23cfc 100644
--- a/agent/pom.xml
+++ b/agent/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
diff --git a/api/pom.xml b/api/pom.xml
index 8d813960fa2a..6b9c98f9c191 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
diff --git a/api/src/com/cloud/network/guru/NetworkGuruAdditionalFunctions.java b/api/src/com/cloud/network/guru/NetworkGuruAdditionalFunctions.java
new file mode 100644
index 000000000000..b31822195b9a
--- /dev/null
+++ b/api/src/com/cloud/network/guru/NetworkGuruAdditionalFunctions.java
@@ -0,0 +1,28 @@
+// 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.network.guru;
+
+import java.util.Map;
+
+public interface NetworkGuruAdditionalFunctions {
+
+ public static final String NSX_LSWITCH_UUID = "logicalswitch";
+ public static final String NSX_LSWITCHPORT_UUID = "logicalswitchport";
+
+ void finalizeNetworkDesign(long networkId, String vlanIdAsUUID);
+ Map listAdditionalNicParams(String nicUuid);
+}
diff --git a/api/src/com/cloud/vm/VmDetailConstants.java b/api/src/com/cloud/vm/VmDetailConstants.java
index d06ad67197eb..d34afc13a169 100644
--- a/api/src/com/cloud/vm/VmDetailConstants.java
+++ b/api/src/com/cloud/vm/VmDetailConstants.java
@@ -19,7 +19,7 @@
public interface VmDetailConstants {
public static final String KEYBOARD = "keyboard";
public static final String NIC_ADAPTER = "nicAdapter";
- public static final String ROOK_DISK_CONTROLLER = "rootDiskController";
+ public static final String ROOT_DISK_CONTROLLER = "rootDiskController";
public static final String NESTED_VIRTUALIZATION_FLAG = "nestedVirtualizationFlag";
public static final String HYPERVISOR_TOOLS_VERSION = "hypervisortoolsversion";
public static final String DATA_DISK_CONTROLLER = "dataDiskController";
diff --git a/api/src/com/cloud/vm/VmStats.java b/api/src/com/cloud/vm/VmStats.java
index 2b7943883e19..1c23c01ed8be 100644
--- a/api/src/com/cloud/vm/VmStats.java
+++ b/api/src/com/cloud/vm/VmStats.java
@@ -32,4 +32,10 @@ public interface VmStats {
public double getDiskWriteKBs();
+ public double getMemoryKBs();
+
+ public double getIntFreeMemoryKBs();
+
+ public double getTargetMemoryKBs();
+
}
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 934972cf3192..ef4ff9a0fe9f 100644
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -499,6 +499,7 @@ public class ApiConstants {
public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid";
public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename";
public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid";
+ public static final String NICIRA_NVP_L2_GATEWAYSERVICE_UUID = "l2gatewayserviceuuid";
public static final String S3_ACCESS_KEY = "accesskey";
public static final String S3_SECRET_KEY = "secretkey";
public static final String S3_END_POINT = "endpoint";
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java
index b8fbb02ad221..4708aff6ff40 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java
@@ -36,7 +36,7 @@
import com.cloud.storage.Snapshot;
import com.cloud.user.Account;
-@APICommand(name = "revertSnapshot", description = "revert a volume snapshot.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class},
+@APICommand(name = "revertSnapshot", description = "This is supposed to revert a volume snapshot. This command is only supported with KVM so far", responseObject = SnapshotResponse.class, entityType = {Snapshot.class},
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class RevertSnapshotCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(RevertSnapshotCmd.class.getName());
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
index 82c281dad467..7769ff8573b1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
@@ -474,7 +474,7 @@ public void execute() {
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
- throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to deploy vm");
+ throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to deploy vm uuid:"+getEntityUuid());
}
}
@@ -556,7 +556,7 @@ public void create() throws ResourceAllocationException {
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, templateId);
// Make sure a valid template ID was specified
if (template == null) {
- throw new InvalidParameterValueException("Unable to use template " + templateId);
+ throw new InvalidParameterValueException("Unable to find the template " + templateId);
}
DiskOffering diskOffering = null;
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
index 0fb496cc0433..e1131092f02b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
@@ -51,7 +51,7 @@ public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.STRING, required = true, description = "guest cidr list of the customer gateway")
private String peerCidrList;
- @Parameter(name = ApiConstants.IPSEC_PSK, type = CommandType.STRING, required = true, description = "IPsec Preshared-Key of the customer gateway")
+ @Parameter(name = ApiConstants.IPSEC_PSK, type = CommandType.STRING, required = true, description = "IPsec Preshared-Key of the customer gateway. Cannot contain newline or double quotes.")
private String ipsecPsk;
@Parameter(name = ApiConstants.IKE_POLICY, type = CommandType.STRING, required = true, description = "IKE policy of the customer gateway")
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
index 3b188b85ca99..bb5914111b4d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
@@ -57,7 +57,7 @@ public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.STRING, required = true, description = "guest cidr of the customer gateway")
private String guestCidrList;
- @Parameter(name = ApiConstants.IPSEC_PSK, type = CommandType.STRING, required = true, description = "IPsec Preshared-Key of the customer gateway")
+ @Parameter(name = ApiConstants.IPSEC_PSK, type = CommandType.STRING, required = true, description = "IPsec Preshared-Key of the customer gateway. Cannot contain newline or double quotes.")
private String ipsecPsk;
@Parameter(name = ApiConstants.IKE_POLICY, type = CommandType.STRING, required = true, description = "IKE policy of the customer gateway")
diff --git a/api/src/org/apache/cloudstack/api/response/NicResponse.java b/api/src/org/apache/cloudstack/api/response/NicResponse.java
index 2f79d7ff4778..73358360a058 100644
--- a/api/src/org/apache/cloudstack/api/response/NicResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NicResponse.java
@@ -102,6 +102,14 @@ public class NicResponse extends BaseResponse {
@Param(description = "Id of the vm to which the nic belongs")
private String vmId;
+ @SerializedName("nsxlogicalswitch")
+ @Param(description = "Id of the NSX Logical Switch (if NSX based), null otherwise", since="4.6.0")
+ private String nsxLogicalSwitch;
+
+ @SerializedName("nsxlogicalswitchport")
+ @Param(description = "Id of the NSX Logical Switch Port (if NSX based), null otherwise", since="4.6.0")
+ private String nsxLogicalSwitchPort;
+
public void setVmId(String vmId) {
this.vmId = vmId;
}
@@ -205,4 +213,12 @@ public void setSecondaryIps(List ipList) {
this.secondaryIps = ipList;
}
+ public void setNsxLogicalSwitch(String nsxLogicalSwitch) {
+ this.nsxLogicalSwitch = nsxLogicalSwitch;
+ }
+
+ public void setNsxLogicalSwitchPort(String nsxLogicalSwitchPort) {
+ this.nsxLogicalSwitchPort = nsxLogicalSwitchPort;
+ }
+
}
diff --git a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
index e8d1a9ed890c..f1119ddbfbf8 100644
--- a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
@@ -196,6 +196,18 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
@Param(description = "the write (bytes) of disk on the vm")
private Long diskKbsWrite;
+ @SerializedName("memorykbs")
+ @Param(description = "the memory used by the vm")
+ private Long memoryKBs;
+
+ @SerializedName("memoryintfreekbs")
+ @Param(description = "the internal memory thats free in vm")
+ private Long memoryIntFreeKBs;
+
+ @SerializedName("memorytargetkbs")
+ @Param(description = "the target memory in vm")
+ private Long memoryTargetKBs;
+
@SerializedName("diskioread")
@Param(description = "the read (io) of disk on the vm")
private Long diskIORead;
@@ -466,6 +478,18 @@ public Long getDiskKbsWrite() {
return diskKbsWrite;
}
+ public Long getMemoryKBs() {
+ return memoryKBs;
+ }
+
+ public Long getMemoryIntFreeKBs() {
+ return memoryIntFreeKBs;
+ }
+
+ public Long getMemoryTargetKBs() {
+ return memoryTargetKBs;
+ }
+
public Long getDiskIORead() {
return diskIORead;
}
@@ -645,6 +669,18 @@ public void setDiskIORead(Long diskIORead) {
this.diskIORead = diskIORead;
}
+ public void setMemoryKBs(Long memoryKBs) {
+ this.memoryKBs = memoryKBs;
+ }
+
+ public void setMemoryIntFreeKBs(Long memoryIntFreeKBs) {
+ this.memoryIntFreeKBs = memoryIntFreeKBs;
+ }
+
+ public void setMemoryTargetKBs(Long memoryTargetKBs) {
+ this.memoryTargetKBs = memoryTargetKBs;
+ }
+
public void setDiskIOWrite(Long diskIOWrite) {
this.diskIOWrite = diskIOWrite;
}
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index 3219b2666c26..fbdedda5c2db 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -942,6 +942,7 @@ label.nfs.storage=NFS Storage
label.nfs=NFS
label.nic.adapter.type=NIC adapter type
label.nicira.controller.address=Controller Address
+label.nicira.l2gatewayserviceuuid=L2 Gateway Service Uuid
label.nicira.l3gatewayserviceuuid=L3 Gateway Service Uuid
label.nicira.transportzoneuuid=Transport Zone Uuid
label.brocade.vcs.address=Vcs Switch Address
diff --git a/client/pom.xml b/client/pom.xml
index 163282c4f692..5cafd832d208 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -17,7 +17,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
diff --git a/core/pom.xml b/core/pom.xml
index c54900872415..60dc02ff576e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
diff --git a/core/src/com/cloud/agent/api/BackupSnapshotCommand.java b/core/src/com/cloud/agent/api/BackupSnapshotCommand.java
index 2a46610117f8..d93c32f99086 100644
--- a/core/src/com/cloud/agent/api/BackupSnapshotCommand.java
+++ b/core/src/com/cloud/agent/api/BackupSnapshotCommand.java
@@ -39,6 +39,7 @@ public class BackupSnapshotCommand extends SnapshotCommand {
private S3TO s3;
StorageFilerTO pool;
private Long secHostId;
+ private String nfsVersion;
protected BackupSnapshotCommand() {
@@ -107,4 +108,12 @@ public Long getSnapshotId() {
public Long getSecHostId() {
return secHostId;
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/core/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java b/core/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java
index 7ac2ddedd2e3..5a09994ab728 100644
--- a/core/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java
+++ b/core/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java
@@ -28,6 +28,7 @@ public class CreatePrivateTemplateFromSnapshotCommand extends SnapshotCommand {
private String origTemplateInstallPath;
private Long newTemplateId;
private String templateName;
+ private String nfsVersion;
protected CreatePrivateTemplateFromSnapshotCommand() {
@@ -72,4 +73,12 @@ public Long getNewTemplateId() {
public String getTemplateName() {
return templateName;
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/core/src/com/cloud/agent/api/CreatePrivateTemplateFromVolumeCommand.java b/core/src/com/cloud/agent/api/CreatePrivateTemplateFromVolumeCommand.java
index 3025147a3044..b6cc6ac4475a 100644
--- a/core/src/com/cloud/agent/api/CreatePrivateTemplateFromVolumeCommand.java
+++ b/core/src/com/cloud/agent/api/CreatePrivateTemplateFromVolumeCommand.java
@@ -32,6 +32,7 @@ public class CreatePrivateTemplateFromVolumeCommand extends SnapshotCommand {
StorageFilerTO _primaryPool;
// For XenServer
private String _secondaryStorageUrl;
+ private String nfsVersion;
public CreatePrivateTemplateFromVolumeCommand() {
}
@@ -99,4 +100,12 @@ public Long getAccountId() {
public void setTemplateId(long templateId) {
_templateId = templateId;
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/core/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java b/core/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java
index fa9a4d584613..933be0360686 100644
--- a/core/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java
+++ b/core/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java
@@ -26,6 +26,8 @@
*/
public class CreateVolumeFromSnapshotCommand extends SnapshotCommand {
+ private String nfsVersion;
+
protected CreateVolumeFromSnapshotCommand() {
}
@@ -50,4 +52,12 @@ public CreateVolumeFromSnapshotCommand(StoragePool pool, String secondaryStorage
super(pool, secondaryStoragePoolURL, backedUpSnapshotUuid, backedUpSnapshotName, dcId, accountId, volumeId);
setWait(wait);
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/core/src/com/cloud/agent/api/GetStorageStatsCommand.java b/core/src/com/cloud/agent/api/GetStorageStatsCommand.java
index 23e8f9e3e55d..84b54264511c 100644
--- a/core/src/com/cloud/agent/api/GetStorageStatsCommand.java
+++ b/core/src/com/cloud/agent/api/GetStorageStatsCommand.java
@@ -30,6 +30,7 @@ public class GetStorageStatsCommand extends Command {
private StoragePoolType pooltype;
private String secUrl;
private DataStoreTO store;
+ private String nfsVersion;
public String getSecUrl() {
return secUrl;
@@ -54,6 +55,11 @@ public GetStorageStatsCommand(DataStoreTO store) {
this.store = store;
}
+ public GetStorageStatsCommand(DataStoreTO store, String nfsVersion) {
+ this.store = store;
+ this.nfsVersion = nfsVersion;
+ }
+
public GetStorageStatsCommand(String secUrl) {
this.secUrl = secUrl;
}
@@ -81,6 +87,14 @@ public DataStoreTO getStore() {
return this.store;
}
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/core/src/com/cloud/agent/api/SecStorageSetupCommand.java b/core/src/com/cloud/agent/api/SecStorageSetupCommand.java
index 28e55c2f4efc..316e4698dc50 100644
--- a/core/src/com/cloud/agent/api/SecStorageSetupCommand.java
+++ b/core/src/com/cloud/agent/api/SecStorageSetupCommand.java
@@ -28,6 +28,7 @@ public class SecStorageSetupCommand extends Command {
private String secUrl;
private KeystoreManager.Certificates certs;
private String postUploadKey;
+ private String nfsVersion;
public SecStorageSetupCommand() {
@@ -74,4 +75,12 @@ public String getPostUploadKey() {
public void setPostUploadKey(String postUploadKey) {
this.postUploadKey = postUploadKey;
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/core/src/com/cloud/agent/api/VmStatsEntry.java b/core/src/com/cloud/agent/api/VmStatsEntry.java
index 0f30b6af5302..e6063b9ab5b0 100644
--- a/core/src/com/cloud/agent/api/VmStatsEntry.java
+++ b/core/src/com/cloud/agent/api/VmStatsEntry.java
@@ -30,13 +30,19 @@ public class VmStatsEntry implements VmStats {
double diskWriteIOs;
double diskReadKBs;
double diskWriteKBs;
+ double memoryKBs;
+ double intfreememoryKBs;
+ double targetmemoryKBs;
int numCPUs;
String entityType;
public VmStatsEntry() {
}
- public VmStatsEntry(double cpuUtilization, double networkReadKBs, double networkWriteKBs, int numCPUs, String entityType) {
+ public VmStatsEntry(double memoryKBs,double intfreememoryKBs,double targetmemoryKBs, double cpuUtilization, double networkReadKBs, double networkWriteKBs, int numCPUs, String entityType) {
+ this.memoryKBs = memoryKBs;
+ this.intfreememoryKBs = intfreememoryKBs;
+ this.targetmemoryKBs = targetmemoryKBs;
this.cpuUtilization = cpuUtilization;
this.networkReadKBs = networkReadKBs;
this.networkWriteKBs = networkWriteKBs;
@@ -117,6 +123,33 @@ public void setDiskWriteKBs(double diskWriteKBs) {
this.diskWriteKBs = diskWriteKBs;
}
+ @Override
+ public double getMemoryKBs() {
+ return memoryKBs;
+ }
+
+ public void setMemoryKBs(double memoryKBs) {
+ this.memoryKBs = memoryKBs;
+ }
+
+ @Override
+ public double getIntFreeMemoryKBs() {
+ return intfreememoryKBs;
+ }
+
+ public void setIntFreeMemoryKBs(double intfreememoryKBs) {
+ this.intfreememoryKBs = intfreememoryKBs;
+ }
+
+ @Override
+ public double getTargetMemoryKBs() {
+ return targetmemoryKBs;
+ }
+
+ public void setTargetMemoryKBs(double targetmemoryKBs) {
+ this.targetmemoryKBs = targetmemoryKBs;
+ }
+
public int getNumCPUs() {
return numCPUs;
}
diff --git a/core/src/com/cloud/agent/api/storage/CopyVolumeCommand.java b/core/src/com/cloud/agent/api/storage/CopyVolumeCommand.java
index 43c84ee2bc0b..7ab822c03bc3 100644
--- a/core/src/com/cloud/agent/api/storage/CopyVolumeCommand.java
+++ b/core/src/com/cloud/agent/api/storage/CopyVolumeCommand.java
@@ -32,6 +32,7 @@ public class CopyVolumeCommand extends Command {
boolean toSecondaryStorage;
String vmName;
boolean executeInSequence = false;
+ String nfsVersion;
public CopyVolumeCommand() {
}
@@ -75,4 +76,12 @@ public boolean toSecondaryStorage() {
public String getVmName() {
return vmName;
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/core/src/com/cloud/agent/api/storage/ListTemplateCommand.java b/core/src/com/cloud/agent/api/storage/ListTemplateCommand.java
index 855095280d7d..bacc83aea50a 100644
--- a/core/src/com/cloud/agent/api/storage/ListTemplateCommand.java
+++ b/core/src/com/cloud/agent/api/storage/ListTemplateCommand.java
@@ -23,6 +23,7 @@
public class ListTemplateCommand extends StorageCommand {
private DataStoreTO store;
+ private String nfsVersion;
//private String secUrl;
@@ -34,6 +35,11 @@ public ListTemplateCommand(DataStoreTO store) {
// this.secUrl = url;
}
+ public ListTemplateCommand(DataStoreTO store, String nfsVersion) {
+ this.store = store;
+ this.nfsVersion = nfsVersion;
+ }
+
@Override
public boolean executeInSequence() {
return true;
@@ -43,6 +49,10 @@ public DataStoreTO getDataStore() {
return store;
}
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
// public String getSecUrl() {
// return secUrl;
// }
diff --git a/core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java b/core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
index ce8ed217a562..9dae513b989b 100644
--- a/core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
+++ b/core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
@@ -35,6 +35,7 @@ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
String secondaryStorageUrl;
String primaryStorageUrl;
+ String nfsVersion;
protected PrimaryStorageDownloadCommand() {
}
@@ -87,4 +88,12 @@ public String getPrimaryStorageUrl() {
public boolean executeInSequence() {
return true;
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/core/src/org/apache/cloudstack/storage/command/TemplateOrVolumePostUploadCommand.java b/core/src/org/apache/cloudstack/storage/command/TemplateOrVolumePostUploadCommand.java
index 5d1e56bd7733..bfcd9ae9b41d 100644
--- a/core/src/org/apache/cloudstack/storage/command/TemplateOrVolumePostUploadCommand.java
+++ b/core/src/org/apache/cloudstack/storage/command/TemplateOrVolumePostUploadCommand.java
@@ -53,6 +53,8 @@ public class TemplateOrVolumePostUploadCommand {
private long accountId;
+ private String nfsVersion;
+
public TemplateOrVolumePostUploadCommand(long entityId, String entityUUID, String absolutePath, String checksum, String type, String name, String imageFormat, String dataTo,
String dataToRole) {
this.entityId = entityId;
@@ -196,4 +198,12 @@ public void setAccountId(long accountId) {
public long getAccountId() {
return accountId;
}
+
+ public String getNfsVersion() {
+ return nfsVersion;
+ }
+
+ public void setNfsVersion(String nfsVersion) {
+ this.nfsVersion = nfsVersion;
+ }
}
diff --git a/debian/changelog b/debian/changelog
index a09834ea5863..04ae4f75373a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,16 +1,16 @@
-cloudstack (4.7.2-SNAPSHOT) unstable; urgency=low
+cloudstack (4.9.0-SNAPSHOT) unstable; urgency=low
[ Remi Bergsma ]
- * Update the version to 4.7.2-SNAPSHOT
+ * Update the version to 4.9.0.snapshot
- -- the Apache CloudStack project Tue, 26 Jan 2016 09:30:53 +0100
+ -- the Apache CloudStack project Wed, 20 Jan 2016 23:43:35 +0100
-cloudstack (4.7.2-SNAPSHOT) unstable; urgency=low
+cloudstack (4.8.0-SNAPSHOT) unstable; urgency=low
[ Remi Bergsma ]
- * Update the version to 4.7.2-SNAPSHOT
+ * Update the version to 4.8.0.snapshot
- -- the Apache CloudStack project Sun, 13 Dec 2015 21:09:53 +0100
+ -- the Apache CloudStack project Sun, 21 Dec 2015 22:11:55 +0100
cloudstack (4.7.0-SNAPSHOT) unstable; urgency=low
diff --git a/developer/pom.xml b/developer/pom.xml
index f5284ed6dd9e..b7d70004b064 100644
--- a/developer/pom.xml
+++ b/developer/pom.xml
@@ -18,7 +18,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
diff --git a/engine/api/pom.xml b/engine/api/pom.xml
index ee019f4c6dd6..01a6051a34ac 100644
--- a/engine/api/pom.xml
+++ b/engine/api/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
index b5601e9693cf..5d552c4013f6 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
@@ -30,10 +30,7 @@ public interface DataMotionStrategy {
StrategyPriority canHandle(Map volumeMap, Host srcHost, Host destHost);
- Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback);
-
- Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback);
-
- Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback);
+ void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback);
+ void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback);
}
diff --git a/engine/components-api/pom.xml b/engine/components-api/pom.xml
index 9021bd47e2d6..7ea56d66dc50 100644
--- a/engine/components-api/pom.xml
+++ b/engine/components-api/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/engine/components-api/src/com/cloud/network/NetworkStateListener.java b/engine/components-api/src/com/cloud/network/NetworkStateListener.java
index 0ed1d9ea7fd8..ef8dddc1f23f 100644
--- a/engine/components-api/src/com/cloud/network/NetworkStateListener.java
+++ b/engine/components-api/src/com/cloud/network/NetworkStateListener.java
@@ -24,38 +24,29 @@
import javax.inject.Inject;
-import com.cloud.utils.fsm.StateMachine2;
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.cloudstack.framework.events.EventBus;
import org.apache.cloudstack.framework.events.EventBusException;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import com.cloud.event.EventCategory;
-import com.cloud.event.dao.UsageEventDao;
import com.cloud.network.Network.Event;
import com.cloud.network.Network.State;
-import com.cloud.network.dao.NetworkDao;
import com.cloud.utils.component.ComponentContext;
import com.cloud.utils.fsm.StateListener;
+import com.cloud.utils.fsm.StateMachine2;
public class NetworkStateListener implements StateListener {
@Inject
- protected UsageEventDao _usageEventDao;
- @Inject
- protected NetworkDao _networkDao;
- @Inject
- protected ConfigurationDao _configDao;
+ private ConfigurationDao _configDao;
- protected static EventBus s_eventBus = null;
+ private static EventBus s_eventBus = null;
private static final Logger s_logger = Logger.getLogger(NetworkStateListener.class);
- public NetworkStateListener(UsageEventDao usageEventDao, NetworkDao networkDao, ConfigurationDao configDao) {
- _usageEventDao = usageEventDao;
- _networkDao = networkDao;
+ public NetworkStateListener(ConfigurationDao configDao) {
_configDao = configDao;
}
diff --git a/engine/network/pom.xml b/engine/network/pom.xml
index 5a803210cdf9..a41ed26275cc 100644
--- a/engine/network/pom.xml
+++ b/engine/network/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/engine/orchestration/pom.xml b/engine/orchestration/pom.xml
index 2287db6595dd..ee3bb34200e9 100755
--- a/engine/orchestration/pom.xml
+++ b/engine/orchestration/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 5c5838951f98..11c0b869dff7 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -983,7 +983,7 @@ public void orchestrateStart(final String vmUuid, final Map vmMetadatum) {
if(!found) {
VMInstanceVO vm = _vmDao.findVMByInstanceName(name);
- if(vm.getType() == VirtualMachine.Type.User) {
+ if(vm != null && vm.getType() == VirtualMachine.Type.User) {
updateVmMetaData(vm.getId(), platform);
}
}
@@ -3685,7 +3686,7 @@ public void setStoragePoolAllocators(final List storagePoo
//
@MessageHandler(topic = Topics.VM_POWER_STATE)
- private void HandlePowerStateReport(final String subject, final String senderAddress, final Object args) {
+ protected void HandlePowerStateReport(final String subject, final String senderAddress, final Object args) {
assert args != null;
final Long vmId = (Long)args;
@@ -4575,7 +4576,13 @@ private Pair orchestrateStart(final VmWorkStart work) th
}
assert vm != null;
- orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), _dpMgr.getDeploymentPlannerByName(work.getDeploymentPlanner()));
+ try{
+ orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), _dpMgr.getDeploymentPlannerByName(work.getDeploymentPlanner()));
+ }
+ catch (CloudRuntimeException e){
+ s_logger.info("Caught CloudRuntimeException, returning job failed");
+ return new Pair(JobInfo.Status.FAILED, null);
+ }
return new Pair(JobInfo.Status.SUCCEEDED, null);
}
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 5f442b3a1ccd..e4272720bc86 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -140,6 +140,7 @@
import com.cloud.network.element.StaticNatServiceProvider;
import com.cloud.network.element.UserDataServiceProvider;
import com.cloud.network.guru.NetworkGuru;
+import com.cloud.network.guru.NetworkGuruAdditionalFunctions;
import com.cloud.network.lb.LoadBalancingRulesManager;
import com.cloud.network.rules.FirewallManager;
import com.cloud.network.rules.FirewallRule;
@@ -169,6 +170,7 @@
import com.cloud.user.dao.AccountDao;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
+import com.cloud.utils.UuidUtils;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.component.ManagerBase;
import com.cloud.utils.concurrency.NamedThreadFactory;
@@ -576,7 +578,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
_agentMgr.registerForHostEvents(this, true, false, true);
- Network.State.getStateMachine().registerListener(new NetworkStateListener(_usageEventDao, _networksDao, _configDao));
+ Network.State.getStateMachine().registerListener(new NetworkStateListener(_configDao));
s_logger.info("Network Manager is configured.");
@@ -674,8 +676,14 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
vpcId, offering.getRedundantRouter());
vo.setDisplayNetwork(isDisplayNetworkEnabled == null ? true : isDisplayNetworkEnabled);
vo.setStrechedL2Network(offering.getSupportsStrechedL2());
- networks.add(_networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated,
- finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId())));
+ final NetworkVO networkPersisted = _networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated,
+ finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId()));
+ networks.add(networkPersisted);
+
+ if (predefined instanceof NetworkVO && guru instanceof NetworkGuruAdditionalFunctions){
+ final NetworkGuruAdditionalFunctions functions = (NetworkGuruAdditionalFunctions) guru;
+ functions.finalizeNetworkDesign(networkPersisted.getId(), ((NetworkVO)predefined).getVlanIdAsUUID());
+ }
if (domainId != null && aclType == ACLType.Domain) {
_networksDao.addDomainToNetwork(id, domainId, subdomainAccess == null ? true : subdomainAccess);
@@ -1024,6 +1032,9 @@ public Pair implementNetwork(final long networkId, final
} catch (final NoTransitionException e) {
s_logger.error(e.getMessage());
return null;
+ } catch (final CloudRuntimeException e) {
+ s_logger.error("Caught exception: " + e.getMessage());
+ return null;
} finally {
if (implemented.first() == null) {
s_logger.debug("Cleaning up because we're unable to implement the network " + network);
@@ -1478,7 +1489,7 @@ public void prepareAllNicsForMigration(final VirtualMachineProfile vm, final Dep
//Create nic profile for migration
s_logger.debug("Creating nic profile for migration. BroadcastUri: "+broadcastUri.toString()+" NetworkId: "+ntwkId+" Vm: "+vm.getId());
final NetworkVO network = _networksDao.findById(ntwkId);
- final Integer networkRate = _networkModel.getNetworkRate(network.getId(), vm.getId());
+ _networkModel.getNetworkRate(network.getId(), vm.getId());
final NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
final NicProfile profile = new NicProfile();
profile.setDeviceId(255); //dummyId
@@ -1915,43 +1926,45 @@ public Network createGuestNetwork(final long networkOfferingId, final String nam
throw new InvalidParameterValueException("The VLAN tag " + vlanId + " is already being used for dynamic vlan allocation for the guest network in zone "
+ zone.getName());
}
- final String uri = BroadcastDomainType.fromString(vlanId).toString();
- // For Isolated networks, don't allow to create network with vlan that already exists in the zone
- if (ntwkOff.getGuestType() == GuestType.Isolated) {
- if (_networksDao.countByZoneAndUri(zoneId, uri) > 0) {
- throw new InvalidParameterValueException("Network with vlan " + vlanId + " already exists in zone " + zoneId);
- } else {
- final List dcVnets = _datacenterVnetDao.findVnet(zoneId, vlanId.toString());
- //for the network that is created as part of private gateway,
- //the vnet is not coming from the data center vnet table, so the list can be empty
- if (!dcVnets.isEmpty()) {
- final DataCenterVnetVO dcVnet = dcVnets.get(0);
- // Fail network creation if specified vlan is dedicated to a different account
- if (dcVnet.getAccountGuestVlanMapId() != null) {
- final Long accountGuestVlanMapId = dcVnet.getAccountGuestVlanMapId();
- final AccountGuestVlanMapVO map = _accountGuestVlanMapDao.findById(accountGuestVlanMapId);
- if (map.getAccountId() != owner.getAccountId()) {
- throw new InvalidParameterValueException("Vlan " + vlanId + " is dedicated to a different account");
- }
- // Fail network creation if owner has a dedicated range of vlans but the specified vlan belongs to the system pool
- } else {
- final List maps = _accountGuestVlanMapDao.listAccountGuestVlanMapsByAccount(owner.getAccountId());
- if (maps != null && !maps.isEmpty()) {
- final int vnetsAllocatedToAccount = _datacenterVnetDao.countVnetsAllocatedToAccount(zoneId, owner.getAccountId());
- final int vnetsDedicatedToAccount = _datacenterVnetDao.countVnetsDedicatedToAccount(zoneId, owner.getAccountId());
- if (vnetsAllocatedToAccount < vnetsDedicatedToAccount) {
- throw new InvalidParameterValueException("Specified vlan " + vlanId + " doesn't belong" + " to the vlan range dedicated to the owner "
- + owner.getAccountName());
+ if (! UuidUtils.validateUUID(vlanId)){
+ final String uri = BroadcastDomainType.fromString(vlanId).toString();
+ // For Isolated networks, don't allow to create network with vlan that already exists in the zone
+ if (ntwkOff.getGuestType() == GuestType.Isolated) {
+ if (_networksDao.countByZoneAndUri(zoneId, uri) > 0) {
+ throw new InvalidParameterValueException("Network with vlan " + vlanId + " already exists in zone " + zoneId);
+ } else {
+ final List dcVnets = _datacenterVnetDao.findVnet(zoneId, vlanId.toString());
+ //for the network that is created as part of private gateway,
+ //the vnet is not coming from the data center vnet table, so the list can be empty
+ if (!dcVnets.isEmpty()) {
+ final DataCenterVnetVO dcVnet = dcVnets.get(0);
+ // Fail network creation if specified vlan is dedicated to a different account
+ if (dcVnet.getAccountGuestVlanMapId() != null) {
+ final Long accountGuestVlanMapId = dcVnet.getAccountGuestVlanMapId();
+ final AccountGuestVlanMapVO map = _accountGuestVlanMapDao.findById(accountGuestVlanMapId);
+ if (map.getAccountId() != owner.getAccountId()) {
+ throw new InvalidParameterValueException("Vlan " + vlanId + " is dedicated to a different account");
+ }
+ // Fail network creation if owner has a dedicated range of vlans but the specified vlan belongs to the system pool
+ } else {
+ final List maps = _accountGuestVlanMapDao.listAccountGuestVlanMapsByAccount(owner.getAccountId());
+ if (maps != null && !maps.isEmpty()) {
+ final int vnetsAllocatedToAccount = _datacenterVnetDao.countVnetsAllocatedToAccount(zoneId, owner.getAccountId());
+ final int vnetsDedicatedToAccount = _datacenterVnetDao.countVnetsDedicatedToAccount(zoneId, owner.getAccountId());
+ if (vnetsAllocatedToAccount < vnetsDedicatedToAccount) {
+ throw new InvalidParameterValueException("Specified vlan " + vlanId + " doesn't belong" + " to the vlan range dedicated to the owner "
+ + owner.getAccountName());
+ }
}
}
}
}
- }
- } else {
- // don't allow to creating shared network with given Vlan ID, if there already exists a isolated network or
- // shared network with same Vlan ID in the zone
- if (_networksDao.countByZoneUriAndGuestType(zoneId, uri, GuestType.Isolated) > 0 ) {
- throw new InvalidParameterValueException("There is a isolated/shared network with vlan id: " + vlanId + " already exists " + "in zone " + zoneId);
+ } else {
+ // don't allow to creating shared network with given Vlan ID, if there already exists a isolated network or
+ // shared network with same Vlan ID in the zone
+ if (_networksDao.countByZoneUriAndGuestType(zoneId, uri, GuestType.Isolated) > 0 ) {
+ throw new InvalidParameterValueException("There is a isolated/shared network with vlan id: " + vlanId + " already exists " + "in zone " + zoneId);
+ }
}
}
@@ -2042,7 +2055,14 @@ public Network doInTransaction(final TransactionStatus status) {
if (vlanIdFinal != null) {
if (isolatedPvlan == null) {
- final URI uri = BroadcastDomainType.fromString(vlanIdFinal);
+ URI uri = null;
+ if (UuidUtils.validateUUID(vlanIdFinal)){
+ //Logical router's UUID provided as VLAN_ID
+ userNetwork.setVlanIdAsUUID(vlanIdFinal); //Set transient field
+ }
+ else {
+ uri = BroadcastDomainType.fromString(vlanIdFinal);
+ }
userNetwork.setBroadcastUri(uri);
if (!vlanIdFinal.equalsIgnoreCase(Vlan.UNTAGGED)) {
userNetwork.setBroadcastDomainType(BroadcastDomainType.Vlan);
@@ -2656,6 +2676,27 @@ public List extends Nic> listVmNics(final long vmId, final Long nicId, final L
} else {
result = _nicDao.listByVmIdAndNicIdAndNtwkId(vmId, nicId, networkId);
}
+
+ for (final NicVO nic : result) {
+ if (_networkModel.isProviderForNetwork(Provider.NiciraNvp, nic.getNetworkId())) {
+ //For NSX Based networks, add nsxlogicalswitch, nsxlogicalswitchport to each result
+ s_logger.info("Listing NSX logical switch and logical switch por for each nic");
+ final NetworkVO network = _networksDao.findById(nic.getNetworkId());
+ final NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
+ final NetworkGuruAdditionalFunctions guruFunctions = (NetworkGuruAdditionalFunctions) guru;
+
+ final Map nsxParams = guruFunctions.listAdditionalNicParams(nic.getUuid());
+ if (nsxParams != null){
+ final String lswitchUuuid = nsxParams.containsKey(NetworkGuruAdditionalFunctions.NSX_LSWITCH_UUID)
+ ? (String) nsxParams.get(NetworkGuruAdditionalFunctions.NSX_LSWITCH_UUID) : null;
+ final String lswitchPortUuuid = nsxParams.containsKey(NetworkGuruAdditionalFunctions.NSX_LSWITCHPORT_UUID)
+ ? (String) nsxParams.get(NetworkGuruAdditionalFunctions.NSX_LSWITCHPORT_UUID) : null;
+ nic.setNsxLogicalSwitchUuid(lswitchUuuid);
+ nic.setNsxLogicalSwitchPortUuid(lswitchPortUuuid);
+ }
+ }
+ }
+
return result;
}
diff --git a/engine/pom.xml b/engine/pom.xml
index 3cac76c10a4d..c3c0b28e76bf 100644
--- a/engine/pom.xml
+++ b/engine/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/engine/schema/pom.xml b/engine/schema/pom.xml
index 4a0d4c356817..4d0b90d6de0d 100644
--- a/engine/schema/pom.xml
+++ b/engine/schema/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkVO.java b/engine/schema/src/com/cloud/network/dao/NetworkVO.java
index 65929d5c9245..5b8ded766499 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java
@@ -172,6 +172,17 @@ public class NetworkVO implements Network {
@Column(name = "streched_l2")
boolean strechedL2Network = false;
+ @Transient
+ transient String vlanIdAsUUID;
+
+ public String getVlanIdAsUUID() {
+ return vlanIdAsUUID;
+ }
+
+ public void setVlanIdAsUUID(String vlanIdAsUUID) {
+ this.vlanIdAsUUID = vlanIdAsUUID;
+ }
+
public NetworkVO() {
uuid = UUID.randomUUID().toString();
}
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index f24e853aede8..fc44c4f5e376 100644
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -61,7 +61,9 @@
import com.cloud.upgrade.dao.Upgrade460to461;
import com.cloud.upgrade.dao.Upgrade461to470;
import com.cloud.upgrade.dao.Upgrade470to471;
-import com.cloud.upgrade.dao.Upgrade471to472;
+import com.cloud.upgrade.dao.Upgrade471to480;
+import com.cloud.upgrade.dao.Upgrade480to481;
+import com.cloud.upgrade.dao.Upgrade481to490;
import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
import com.cloud.upgrade.dao.VersionDao;
@@ -109,7 +111,7 @@ public DatabaseUpgradeChecker() {
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 Upgrade471to472()});
+ new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
_upgradeMap.put("2.1.8", new DbUpgrade[] {new Upgrade218to22(), new Upgrade221to222(), new UpgradeSnapshot217to224(),
new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(), new Upgrade225to226(),
@@ -117,7 +119,7 @@ public DatabaseUpgradeChecker() {
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 Upgrade471to472()});
+ 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()});
_upgradeMap.put("2.1.9", new DbUpgrade[] {new Upgrade218to22(), new Upgrade221to222(), new UpgradeSnapshot217to224(),
new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(), new Upgrade225to226(),
@@ -125,161 +127,167 @@ public DatabaseUpgradeChecker() {
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 Upgrade471to472()});
+ new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
- _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("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 Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("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 Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("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 Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("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 Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("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 Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("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 Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("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 Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("4.4.0", new DbUpgrade[] {new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("4.4.1", new DbUpgrade[] {new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472() });
+ _upgradeMap.put("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() });
- _upgradeMap.put("4.4.2", new DbUpgrade[] {new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("4.4.3", new DbUpgrade[] {new Upgrade443to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("4.4.4", new DbUpgrade[] {new Upgrade444to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("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()});
- _upgradeMap.put("4.5.0", new DbUpgrade[] {new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.5.0", new DbUpgrade[] {new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.5.1", new DbUpgrade[] {new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.5.1", new DbUpgrade[] {new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.5.2", new DbUpgrade[] {new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.5.2", new DbUpgrade[] {new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.5.3", new DbUpgrade[] {new Upgrade453to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.5.3", new DbUpgrade[] {new Upgrade453to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.6.0", new DbUpgrade[] {new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.6.0", new DbUpgrade[] {new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.6.1", new DbUpgrade[] {new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.6.1", new DbUpgrade[] {new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.6.2", new DbUpgrade[] {new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.6.2", new DbUpgrade[] {new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.7.0", new DbUpgrade[] {new Upgrade470to471(), new Upgrade471to472()});
+ _upgradeMap.put("4.7.0", new DbUpgrade[] {new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
- _upgradeMap.put("4.7.1", new DbUpgrade[] {new Upgrade471to472()});
+ _upgradeMap.put("4.7.1", new DbUpgrade[] {new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
+
+ _upgradeMap.put("4.7.2", new DbUpgrade[] {new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
+
+ _upgradeMap.put("4.8.0", new DbUpgrade[] {new Upgrade480to481(), new Upgrade481to490()});
+
+ _upgradeMap.put("4.8.1", new DbUpgrade[] {new Upgrade481to490()});
//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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
- _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ _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(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to480(), new Upgrade480to481(), new Upgrade481to490()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
_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 Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460(), new Upgrade460to461(), new Upgrade461to470(), new Upgrade470to471(), new Upgrade471to472()});
+ 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()});
}
protected void runScript(Connection conn, File file) {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to472.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to480.java
similarity index 84%
rename from engine/schema/src/com/cloud/upgrade/dao/Upgrade471to472.java
rename to engine/schema/src/com/cloud/upgrade/dao/Upgrade471to480.java
index 7c36e0024761..bde4c0ff24e6 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to472.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to480.java
@@ -24,17 +24,17 @@
import java.io.File;
import java.sql.Connection;
-public class Upgrade471to472 implements DbUpgrade {
- final static Logger s_logger = Logger.getLogger(Upgrade471to472.class);
+public class Upgrade471to480 implements DbUpgrade {
+ final static Logger s_logger = Logger.getLogger(Upgrade471to480.class);
@Override
public String[] getUpgradableVersionRange() {
- return new String[] {"4.7.1", "4.7.2"};
+ return new String[] {"4.7.1", "4.8.0"};
}
@Override
public String getUpgradedVersion() {
- return "4.7.2";
+ return "4.8.0";
}
@Override
@@ -44,9 +44,9 @@ public boolean supportsRollingUpgrade() {
@Override
public File[] getPrepareScripts() {
- String script = Script.findScript("", "db/schema-471to472.sql");
+ String script = Script.findScript("", "db/schema-471to480.sql");
if (script == null) {
- throw new CloudRuntimeException("Unable to find db/schema-471to472.sql");
+ throw new CloudRuntimeException("Unable to find db/schema-471to480.sql");
}
return new File[] {new File(script)};
}
@@ -57,9 +57,9 @@ public void performDataMigration(Connection conn) {
@Override
public File[] getCleanupScripts() {
- String script = Script.findScript("", "db/schema-471to472-cleanup.sql");
+ String script = Script.findScript("", "db/schema-471to480-cleanup.sql");
if (script == null) {
- throw new CloudRuntimeException("Unable to find db/schema-471to472-cleanup.sql");
+ throw new CloudRuntimeException("Unable to find db/schema-471to480-cleanup.sql");
}
return new File[] {new File(script)};
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade480to481.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade480to481.java
new file mode 100644
index 000000000000..26e7d125ec84
--- /dev/null
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade480to481.java
@@ -0,0 +1,67 @@
+// 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.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
+import org.apache.log4j.Logger;
+
+import java.io.File;
+import java.sql.Connection;
+
+public class Upgrade480to481 implements DbUpgrade {
+ final static Logger s_logger = Logger.getLogger(Upgrade480to481.class);
+
+ @Override
+ public String[] getUpgradableVersionRange() {
+ return new String[] {"4.8.0", "4.8.1"};
+ }
+
+ @Override
+ public String getUpgradedVersion() {
+ return "4.8.1";
+ }
+
+ @Override
+ public boolean supportsRollingUpgrade() {
+ return false;
+ }
+
+ @Override
+ public File[] getPrepareScripts() {
+ String script = Script.findScript("", "db/schema-480to481.sql");
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find db/schema-480to481.sql");
+ }
+ return new File[] {new File(script)};
+ }
+
+ @Override
+ public void performDataMigration(Connection conn) {
+ }
+
+ @Override
+ public File[] getCleanupScripts() {
+ String script = Script.findScript("", "db/schema-480to481-cleanup.sql");
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find db/schema-480to481-cleanup.sql");
+ }
+
+ return new File[] {new File(script)};
+ }
+}
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade481to490.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade481to490.java
new file mode 100644
index 000000000000..9e5213478eb0
--- /dev/null
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade481to490.java
@@ -0,0 +1,67 @@
+// 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.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
+import org.apache.log4j.Logger;
+
+import java.io.File;
+import java.sql.Connection;
+
+public class Upgrade481to490 implements DbUpgrade {
+ final static Logger s_logger = Logger.getLogger(Upgrade481to490.class);
+
+ @Override
+ public String[] getUpgradableVersionRange() {
+ return new String[] {"4.8.1", "4.9.0"};
+ }
+
+ @Override
+ public String getUpgradedVersion() {
+ return "4.9.0";
+ }
+
+ @Override
+ public boolean supportsRollingUpgrade() {
+ return false;
+ }
+
+ @Override
+ public File[] getPrepareScripts() {
+ String script = Script.findScript("", "db/schema-481to490.sql");
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find db/schema-481to490.sql");
+ }
+ return new File[] {new File(script)};
+ }
+
+ @Override
+ public void performDataMigration(Connection conn) {
+ }
+
+ @Override
+ public File[] getCleanupScripts() {
+ String script = Script.findScript("", "db/schema-481to490-cleanup.sql");
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find db/schema-481to490-cleanup.sql");
+ }
+
+ return new File[] {new File(script)};
+ }
+}
diff --git a/engine/schema/src/com/cloud/vm/NicVO.java b/engine/schema/src/com/cloud/vm/NicVO.java
index 815429736090..2a7c6962cbd4 100644
--- a/engine/schema/src/com/cloud/vm/NicVO.java
+++ b/engine/schema/src/com/cloud/vm/NicVO.java
@@ -28,6 +28,7 @@
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
+import javax.persistence.Transient;
import com.cloud.network.Networks.AddressFormat;
import com.cloud.network.Networks.Mode;
@@ -123,6 +124,12 @@ protected NicVO() {
@Column(name = "secondary_ip")
boolean secondaryIp;
+ @Transient
+ transient String nsxLogicalSwitchUuid;
+
+ @Transient
+ transient String nsxLogicalSwitchPortUuid;
+
public NicVO(String reserver, Long instanceId, long configurationId, VirtualMachine.Type vmType) {
this.reserver = reserver;
this.instanceId = instanceId;
@@ -371,4 +378,20 @@ public void setSecondaryIp(boolean secondaryIp) {
public void setVmType(VirtualMachine.Type vmType) {
this.vmType = vmType;
}
+
+ public String getNsxLogicalSwitchUuid() {
+ return nsxLogicalSwitchUuid;
+ }
+
+ public void setNsxLogicalSwitchUuid(String nsxLogicalSwitchUuid) {
+ this.nsxLogicalSwitchUuid = nsxLogicalSwitchUuid;
+ }
+
+ public String getNsxLogicalSwitchPortUuid() {
+ return nsxLogicalSwitchPortUuid;
+ }
+
+ public void setNsxLogicalSwitchPortUuid(String nsxLogicalSwitchPortUuid) {
+ this.nsxLogicalSwitchPortUuid = nsxLogicalSwitchPortUuid;
+ }
}
diff --git a/engine/service/pom.xml b/engine/service/pom.xml
index 4a99f3353148..38b6035e8719 100644
--- a/engine/service/pom.xml
+++ b/engine/service/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
cloud-engine-service
war
diff --git a/engine/storage/cache/pom.xml b/engine/storage/cache/pom.xml
index a0da87ead90a..976a2e75a836 100644
--- a/engine/storage/cache/pom.xml
+++ b/engine/storage/cache/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/datamotion/pom.xml b/engine/storage/datamotion/pom.xml
index 9f0bbc58d6ce..3324270198c6 100644
--- a/engine/storage/datamotion/pom.xml
+++ b/engine/storage/datamotion/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index 24ecff57e9c6..3124666db19e 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -23,9 +23,6 @@
import javax.inject.Inject;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionStrategy;
@@ -41,7 +38,6 @@
import org.apache.cloudstack.engine.subsystem.api.storage.StorageAction;
import org.apache.cloudstack.engine.subsystem.api.storage.StorageCacheManager;
import org.apache.cloudstack.engine.subsystem.api.storage.StrategyPriority;
-import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
@@ -49,6 +45,8 @@
import org.apache.cloudstack.storage.RemoteHostEndPoint;
import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.storage.MigrateVolumeAnswer;
@@ -61,9 +59,9 @@
import com.cloud.configuration.Config;
import com.cloud.host.Host;
import com.cloud.storage.DataStoreRole;
+import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StoragePool;
import com.cloud.storage.VolumeVO;
-import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.dao.VolumeDao;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.db.DB;
@@ -99,22 +97,14 @@ protected boolean needCacheStorage(DataObject srcData, DataObject destData) {
DataStoreTO srcStoreTO = srcTO.getDataStore();
if (srcStoreTO instanceof NfsTO || srcStoreTO.getRole() == DataStoreRole.ImageCache) {
- //||
- // (srcStoreTO instanceof PrimaryDataStoreTO && ((PrimaryDataStoreTO)srcStoreTO).getPoolType() == StoragePoolType.NetworkFilesystem)) {
return false;
}
-
DataTO destTO = destData.getTO();
DataStoreTO destStoreTO = destTO.getDataStore();
if (destStoreTO instanceof NfsTO || destStoreTO.getRole() == DataStoreRole.ImageCache) {
return false;
}
-
- if (srcData.getType() == DataObjectType.TEMPLATE) {
- TemplateInfo template = (TemplateInfo)srcData;
- }
-
if (s_logger.isDebugEnabled()) {
s_logger.debug("needCacheStorage true, dest at " + destTO.getPath() + " dest role " + destStoreTO.getRole().toString() + srcTO.getPath() + " src role " +
srcStoreTO.getRole().toString());
@@ -429,7 +419,7 @@ protected Answer migrateVolumeToPool(DataObject srcData, DataObject destData) {
// Note: destHost is currently only used if the copyObject method is invoked
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
Answer answer = null;
String errMsg = null;
try {
@@ -465,12 +455,6 @@ public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, As
CopyCommandResult result = new CopyCommandResult(null, answer);
result.setResult(errMsg);
callback.complete(result);
- return null;
- }
-
- @Override
- public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) {
- return copyAsync(srcData, destData, null, callback);
}
@DB
@@ -569,11 +553,9 @@ protected Answer copySnapshot(DataObject srcData, DataObject destData) {
}
@Override
- public Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
CopyCommandResult result = new CopyCommandResult(null, null);
result.setResult("Unsupported operation requested for copying data.");
callback.complete(result);
-
- return null;
}
}
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
index 3c9334df73f1..cdcab754e91d 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
@@ -24,30 +24,29 @@
import javax.inject.Inject;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionStrategy;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities;
+import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.StrategyPriority;
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult;
import org.apache.cloudstack.framework.async.AsyncCallFuture;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CopyCmdAnswer;
+import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.to.DiskTO;
@@ -64,8 +63,8 @@
import com.cloud.storage.DataStoreRole;
import com.cloud.storage.DiskOfferingVO;
import com.cloud.storage.SnapshotVO;
-import com.cloud.storage.VolumeVO;
import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.DiskOfferingDao;
import com.cloud.storage.dao.SnapshotDao;
import com.cloud.storage.dao.SnapshotDetailsDao;
@@ -127,7 +126,7 @@ public StrategyPriority canHandle(Map volumeMap, Host src
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
if (srcData instanceof SnapshotInfo) {
SnapshotInfo snapshotInfo = (SnapshotInfo)srcData;
@@ -137,23 +136,22 @@ public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, As
if (canHandleSrc && destData instanceof TemplateInfo &&
(destData.getDataStore().getRole() == DataStoreRole.Image || destData.getDataStore().getRole() == DataStoreRole.ImageCache)) {
- return handleCreateTemplateFromSnapshot(snapshotInfo, (TemplateInfo)destData, callback);
+ handleCreateTemplateFromSnapshot(snapshotInfo, (TemplateInfo)destData, callback);
+ return;
}
if (destData instanceof VolumeInfo) {
VolumeInfo volumeInfo = (VolumeInfo)destData;
-
boolean canHandleDest = canHandle(destData.getDataStore());
if (canHandleSrc && canHandleDest) {
- return handleCreateVolumeFromSnapshotBothOnStorageSystem(snapshotInfo, volumeInfo, callback);
+ handleCreateVolumeFromSnapshotBothOnStorageSystem(snapshotInfo, volumeInfo, callback);
+ return;
}
-
if (canHandleSrc) {
throw new UnsupportedOperationException("This operation is not supported (DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT " +
"not supported by destination storage plug-in).");
}
-
if (canHandleDest) {
throw new UnsupportedOperationException("This operation is not supported (DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT " +
"not supported by source storage plug-in).");
@@ -413,18 +411,9 @@ public HostVO getHost(long dataStoreId) {
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) {
- return copyAsync(srcData, destData, null, callback);
- }
-
- @Override
- public Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
CopyCommandResult result = new CopyCommandResult(null, null);
-
result.setResult("Unsupported operation requested for copying data.");
-
callback.complete(result);
-
- return null;
}
}
diff --git a/engine/storage/image/pom.xml b/engine/storage/image/pom.xml
index a183fbdc6706..779f1399abdc 100644
--- a/engine/storage/image/pom.xml
+++ b/engine/storage/image/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml b/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
index db517dbd863d..51be9d99faa8 100644
--- a/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
+++ b/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
@@ -29,7 +29,7 @@
+ depends-on="dataObjectManagerImpl, dataStoreManagerImpl, dataMotionServiceImpl, objectInDataStoreManagerImpl, defaultEndPointSelector, templateDataFactoryImpl, imageStoreDetailsUtil" />
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
index 9ab35953711d..a1d10e328077 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
@@ -73,6 +73,7 @@
import com.cloud.exception.ResourceAllocationException;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.DataStoreRole;
+import com.cloud.storage.ImageStoreDetailsUtil;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.StoragePool;
@@ -135,6 +136,8 @@ public class TemplateServiceImpl implements TemplateService {
ConfigurationDao _configDao;
@Inject
StorageCacheManager _cacheMgr;
+ @Inject
+ ImageStoreDetailsUtil imageStoreDetailsUtil;
class TemplateOpContext extends AsyncRpcContext {
final TemplateObject template;
@@ -564,7 +567,7 @@ public void associateCrosszoneTemplatesToZone(long dcId) {
}
private Map listTemplate(DataStore ssStore) {
- ListTemplateCommand cmd = new ListTemplateCommand(ssStore.getTO());
+ ListTemplateCommand cmd = new ListTemplateCommand(ssStore.getTO(), imageStoreDetailsUtil.getNfsVersion(ssStore.getId()));
EndPoint ep = _epSelector.select(ssStore);
Answer answer = null;
if (ep == null) {
diff --git a/engine/storage/integration-test/pom.xml b/engine/storage/integration-test/pom.xml
index 832e4a1db46a..d64812957418 100644
--- a/engine/storage/integration-test/pom.xml
+++ b/engine/storage/integration-test/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/MockLocalNfsSecondaryStorageResource.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/MockLocalNfsSecondaryStorageResource.java
index 896342890c82..5c41dcab0ee5 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/MockLocalNfsSecondaryStorageResource.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/MockLocalNfsSecondaryStorageResource.java
@@ -51,7 +51,7 @@ public MockLocalNfsSecondaryStorageResource() {
}
@Override
- public String getRootDir(String secUrl) {
+ public String getRootDir(String secUrl, String nfsVersion) {
return "/mnt";
}
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockStorageMotionStrategy.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockStorageMotionStrategy.java
index accfeb5318e4..757d96cabad2 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockStorageMotionStrategy.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockStorageMotionStrategy.java
@@ -19,25 +19,17 @@
package org.apache.cloudstack.storage.test;
import java.util.Map;
-import java.util.UUID;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionStrategy;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.StrategyPriority;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
-import org.apache.cloudstack.storage.command.CopyCmdAnswer;
-import org.apache.cloudstack.storage.to.SnapshotObjectTO;
-import org.apache.cloudstack.storage.to.TemplateObjectTO;
-import com.cloud.agent.api.to.DataObjectType;
-import com.cloud.agent.api.to.DataTO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.host.Host;
-import com.cloud.storage.Storage;
public class MockStorageMotionStrategy implements DataMotionStrategy {
@@ -58,46 +50,13 @@ public StrategyPriority canHandle(Map volumeMap, Host src
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
throw new UnsupportedOperationException();
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) {
- CopyCmdAnswer answer = null;
- DataTO data = null;
- if (!success) {
- CopyCommandResult result = new CopyCommandResult(null, null);
- result.setResult("Failed");
- callback.complete(result);
- }
- if (destData.getType() == DataObjectType.SNAPSHOT) {
- SnapshotInfo srcSnapshot = (SnapshotInfo)srcData;
-
- SnapshotObjectTO newSnapshot = new SnapshotObjectTO();
- newSnapshot.setPath(UUID.randomUUID().toString());
- if (srcSnapshot.getParent() != null) {
- newSnapshot.setParentSnapshotPath(srcSnapshot.getParent().getPath());
- }
- data = newSnapshot;
- } else if (destData.getType() == DataObjectType.TEMPLATE) {
- TemplateObjectTO newTemplate = new TemplateObjectTO();
- newTemplate.setPath(UUID.randomUUID().toString());
- newTemplate.setFormat(Storage.ImageFormat.QCOW2);
- newTemplate.setSize(10L);
- newTemplate.setPhysicalSize(10L);
- data = newTemplate;
- }
- answer = new CopyCmdAnswer(data);
- CopyCommandResult result = new CopyCommandResult("something", answer);
- callback.complete(result);
- return null;
- }
-
- @Override
- public Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
CopyCommandResult result = new CopyCommandResult("something", null);
callback.complete(result);
- return null;
}
}
diff --git a/engine/storage/pom.xml b/engine/storage/pom.xml
index 73a2e94c52b1..cf9a8ea97372 100644
--- a/engine/storage/pom.xml
+++ b/engine/storage/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml b/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
index 8040d801b3e5..a45e4ee3e40c 100644
--- a/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
+++ b/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
@@ -69,5 +69,7 @@
+
+
diff --git a/engine/storage/snapshot/pom.xml b/engine/storage/snapshot/pom.xml
index 71054f9c636f..97ca7f21e33d 100644
--- a/engine/storage/snapshot/pom.xml
+++ b/engine/storage/snapshot/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/volume/pom.xml b/engine/storage/volume/pom.xml
index 7f9058d89658..e790df12dd9d 100644
--- a/engine/storage/volume/pom.xml
+++ b/engine/storage/volume/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-engine
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/framework/cluster/pom.xml b/framework/cluster/pom.xml
index 0cb801b20029..d14e5c455d13 100644
--- a/framework/cluster/pom.xml
+++ b/framework/cluster/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/config/pom.xml b/framework/config/pom.xml
index a511f5bdec1a..349e9f29d3ad 100644
--- a/framework/config/pom.xml
+++ b/framework/config/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/db/pom.xml b/framework/db/pom.xml
index a7797a3ae3ac..71b9af36b4d7 100644
--- a/framework/db/pom.xml
+++ b/framework/db/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/events/pom.xml b/framework/events/pom.xml
index 664401040ef4..a633a779fca5 100644
--- a/framework/events/pom.xml
+++ b/framework/events/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/ipc/pom.xml b/framework/ipc/pom.xml
index e4a09472c5e6..0341ff7dea49 100644
--- a/framework/ipc/pom.xml
+++ b/framework/ipc/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/jobs/pom.xml b/framework/jobs/pom.xml
index 3bed3244eb7c..ff17f483580a 100644
--- a/framework/jobs/pom.xml
+++ b/framework/jobs/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index 3e1ed9c017ae..121246bc11c9 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -1006,6 +1006,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
job.setStatus(JobInfo.Status.FAILED);
job.setResultCode(ApiErrorCode.INTERNAL_ERROR.getHttpCode());
job.setResult("job cancelled because of management server restart or shutdown");
+ job.setCompleteMsid(msid);
_jobDao.update(job.getId(), job);
if (s_logger.isDebugEnabled()) {
s_logger.debug("Purge queue item for cancelled job-" + job.getId());
diff --git a/framework/managed-context/pom.xml b/framework/managed-context/pom.xml
index 399b8788df24..e2058fe03f1a 100644
--- a/framework/managed-context/pom.xml
+++ b/framework/managed-context/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-maven-standard
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../maven-standard/pom.xml
diff --git a/framework/pom.xml b/framework/pom.xml
index d73ad1c65711..a60841c75055 100644
--- a/framework/pom.xml
+++ b/framework/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
install
diff --git a/framework/quota/pom.xml b/framework/quota/pom.xml
index 0b393e0dc560..82d43cdd4d5a 100644
--- a/framework/quota/pom.xml
+++ b/framework/quota/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java b/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java
index b039e26a9b57..ac14718fd4e9 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java
@@ -220,7 +220,9 @@ public void processQuotaBalanceForAccount(final AccountVO account, final List details;
+ Map details = new HashMap();
- // This flag is required to tell if the offering is dynamic once the cpu, memory and speed are set.
- // In some cases cpu, memory and speed are set to non-null values even if the offering is dynamic.
@Transient
boolean isDynamic;
@@ -90,7 +86,7 @@ protected ServiceOfferingVO() {
}
public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, String displayText,
- ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vmType, boolean defaultUse) {
+ ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vmType, boolean defaultUse) {
super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
this.cpu = cpu;
this.ramSize = ramSize;
@@ -105,7 +101,8 @@ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer spee
}
public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse,
- boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vmType, Long domainId) {
+ boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse,
+ VirtualMachine.Type vmType, Long domainId) {
super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true, domainId);
this.cpu = cpu;
this.ramSize = ramSize;
@@ -118,68 +115,26 @@ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer spee
this.vmType = vmType == null ? null : vmType.toString().toLowerCase();
}
- public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA,
- boolean limitResourceUse, boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse,
- VirtualMachine.Type vmType, Long domainId, String hostTag) {
- this(name,
- cpu,
- ramSize,
- speed,
- rateMbps,
- multicastRateMbps,
- offerHA,
- limitResourceUse,
- volatileVm,
- displayText,
- provisioningType,
- useLocalStorage,
- recreatable,
- tags,
- systemUse,
- vmType,
- domainId);
+ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse,
+ boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse,
+ VirtualMachine.Type vmType, Long domainId, String hostTag) {
+ this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, provisioningType, useLocalStorage, recreatable, tags,
+ systemUse, vmType, domainId);
this.hostTag = hostTag;
}
- public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA,
- boolean limitResourceUse, boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse,
- VirtualMachine.Type vmType, Long domainId, String hostTag, String deploymentPlanner) {
- this(name,
- cpu,
- ramSize,
- speed,
- rateMbps,
- multicastRateMbps,
- offerHA,
- limitResourceUse,
- volatileVm,
- displayText,
- provisioningType,
- useLocalStorage,
- recreatable,
- tags,
- systemUse,
- vmType,
- domainId,
- hostTag);
+ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse,
+ boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse,
+ VirtualMachine.Type vmType, Long domainId, String hostTag, String deploymentPlanner) {
+ this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, provisioningType, useLocalStorage, recreatable, tags,
+ systemUse, vmType, domainId, hostTag);
this.deploymentPlanner = deploymentPlanner;
}
public ServiceOfferingVO(ServiceOfferingVO offering) {
- super(offering.getId(),
- offering.getName(),
- offering.getDisplayText(),
- offering.getProvisioningType(),
- false,
- offering.getTags(),
- offering.isRecreatable(),
- offering.getUseLocalStorage(),
- offering.getSystemUse(),
- true,
- offering.isCustomizedIops()== null ? false:offering.isCustomizedIops(),
- offering.getDomainId(),
- offering.getMinIops(),
- offering.getMaxIops());
+ super(offering.getId(), offering.getName(), offering.getDisplayText(), offering.getProvisioningType(), false, offering.getTags(), offering.isRecreatable(),
+ offering.getUseLocalStorage(), offering.getSystemUse(), true, offering.isCustomizedIops() == null ? false : offering.isCustomizedIops(), offering.getDomainId(),
+ offering.getMinIops(), offering.getMaxIops());
cpu = offering.getCpu();
ramSize = offering.getRamSize();
speed = offering.getSpeed();
@@ -310,14 +265,10 @@ public Map getDetails() {
}
public String getDetail(String name) {
- assert (details != null) : "Did you forget to load the details?";
-
- return details != null ? details.get(name) : null;
+ return details.get(name);
}
- public void setDetail(String name, String value) {
- assert (details != null) : "Did you forget to load the details?";
-
+ public void addDetail(String name, String value) {
details.put(name, value);
}
diff --git a/framework/rest/pom.xml b/framework/rest/pom.xml
index e8c8707e7f7d..830b7ec94d5f 100644
--- a/framework/rest/pom.xml
+++ b/framework/rest/pom.xml
@@ -22,7 +22,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
cloud-framework-rest
diff --git a/framework/security/pom.xml b/framework/security/pom.xml
index 2e45a65e023c..cfe04de079c2 100644
--- a/framework/security/pom.xml
+++ b/framework/security/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/framework/spring/lifecycle/pom.xml b/framework/spring/lifecycle/pom.xml
index 3a3670d5fbc8..93160c472c75 100644
--- a/framework/spring/lifecycle/pom.xml
+++ b/framework/spring/lifecycle/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloud-maven-standard
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../../maven-standard/pom.xml
diff --git a/framework/spring/module/pom.xml b/framework/spring/module/pom.xml
index e259718668b3..6f89f53530b0 100644
--- a/framework/spring/module/pom.xml
+++ b/framework/spring/module/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-maven-standard
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../../maven-standard/pom.xml
diff --git a/maven-standard/pom.xml b/maven-standard/pom.xml
index a4b838dae77e..6f8530a0f517 100644
--- a/maven-standard/pom.xml
+++ b/maven-standard/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/plugins/acl/static-role-based/pom.xml b/plugins/acl/static-role-based/pom.xml
index 9b89ce4bb606..62ba16696ffd 100644
--- a/plugins/acl/static-role-based/pom.xml
+++ b/plugins/acl/static-role-based/pom.xml
@@ -26,7 +26,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/affinity-group-processors/explicit-dedication/pom.xml b/plugins/affinity-group-processors/explicit-dedication/pom.xml
index 10e09971b9f9..d4fc0f1a2c51 100644
--- a/plugins/affinity-group-processors/explicit-dedication/pom.xml
+++ b/plugins/affinity-group-processors/explicit-dedication/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/affinity-group-processors/host-anti-affinity/pom.xml b/plugins/affinity-group-processors/host-anti-affinity/pom.xml
index 3b065aa19dab..58e205d18b29 100644
--- a/plugins/affinity-group-processors/host-anti-affinity/pom.xml
+++ b/plugins/affinity-group-processors/host-anti-affinity/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/alert-handlers/snmp-alerts/pom.xml b/plugins/alert-handlers/snmp-alerts/pom.xml
index 5b9a6f8e6c25..7cbca893fd52 100644
--- a/plugins/alert-handlers/snmp-alerts/pom.xml
+++ b/plugins/alert-handlers/snmp-alerts/pom.xml
@@ -22,7 +22,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
4.0.0
diff --git a/plugins/alert-handlers/syslog-alerts/pom.xml b/plugins/alert-handlers/syslog-alerts/pom.xml
index 62cdede5aad9..e4616acd072a 100644
--- a/plugins/alert-handlers/syslog-alerts/pom.xml
+++ b/plugins/alert-handlers/syslog-alerts/pom.xml
@@ -22,7 +22,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
4.0.0
diff --git a/plugins/api/discovery/pom.xml b/plugins/api/discovery/pom.xml
index acf287446e2d..049061abfaae 100644
--- a/plugins/api/discovery/pom.xml
+++ b/plugins/api/discovery/pom.xml
@@ -26,7 +26,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/api/rate-limit/pom.xml b/plugins/api/rate-limit/pom.xml
index 3fe0ac42aff0..3e826c2b495d 100644
--- a/plugins/api/rate-limit/pom.xml
+++ b/plugins/api/rate-limit/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/api/solidfire-intg-test/pom.xml b/plugins/api/solidfire-intg-test/pom.xml
index 21f40ebb308e..a15d7b3e85f5 100644
--- a/plugins/api/solidfire-intg-test/pom.xml
+++ b/plugins/api/solidfire-intg-test/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/database/mysql-ha/pom.xml b/plugins/database/mysql-ha/pom.xml
index e9c2ade78463..c275743cefa3 100644
--- a/plugins/database/mysql-ha/pom.xml
+++ b/plugins/database/mysql-ha/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/database/quota/pom.xml b/plugins/database/quota/pom.xml
index 9c03c74b5e95..b429c0ddd9e4 100644
--- a/plugins/database/quota/pom.xml
+++ b/plugins/database/quota/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java b/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
index 1b6f400f4075..ab66289448b3 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
@@ -174,10 +174,12 @@ private QuotaSummaryResponse getQuotaSummaryResponse(final Account account) {
@Override
public QuotaBalanceResponse createQuotaBalanceResponse(List quotaBalance, Date startDate, Date endDate) {
if (quotaBalance == null || quotaBalance.isEmpty()) {
- new InvalidParameterValueException("The request period does not contain balance entries.");
+ throw new InvalidParameterValueException("The request period does not contain balance entries.");
}
Collections.sort(quotaBalance, new Comparator() {
public int compare(QuotaBalanceVO o1, QuotaBalanceVO o2) {
+ o1 = o1 == null ? new QuotaBalanceVO() : o1;
+ o2 = o2 == null ? new QuotaBalanceVO() : o2;
return o2.getUpdatedOn().compareTo(o1.getUpdatedOn()); // desc
}
});
@@ -186,7 +188,7 @@ public int compare(QuotaBalanceVO o1, QuotaBalanceVO o2) {
//check that there is at least one balance entry
for (Iterator it = quotaBalance.iterator(); it.hasNext();) {
QuotaBalanceVO entry = it.next();
- if (entry.getCreditsId() > 0) {
+ if (entry.isBalanceEntry()) {
have_balance_entries = true;
break;
}
diff --git a/plugins/database/quota/test/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java b/plugins/database/quota/test/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java
index 73ead4a71bf2..c113e551647b 100644
--- a/plugins/database/quota/test/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java
+++ b/plugins/database/quota/test/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java
@@ -118,7 +118,7 @@ private QuotaTariffVO makeTariffTestData() {
tariffVO.setUsageType(QuotaTypes.IP_ADDRESS);
tariffVO.setUsageName("ip address");
tariffVO.setUsageUnit("IP-Month");
- tariffVO.setCurrencyValue(new BigDecimal(100.19));
+ tariffVO.setCurrencyValue(BigDecimal.valueOf(100.19));
tariffVO.setEffectiveOn(new Date());
tariffVO.setUsageDiscriminator("");
return tariffVO;
diff --git a/plugins/dedicated-resources/pom.xml b/plugins/dedicated-resources/pom.xml
index d97da61db368..040e936d49ca 100644
--- a/plugins/dedicated-resources/pom.xml
+++ b/plugins/dedicated-resources/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../pom.xml
diff --git a/plugins/deployment-planners/implicit-dedication/pom.xml b/plugins/deployment-planners/implicit-dedication/pom.xml
index 8e989fd26ad6..f0f817ce9fb6 100644
--- a/plugins/deployment-planners/implicit-dedication/pom.xml
+++ b/plugins/deployment-planners/implicit-dedication/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/deployment-planners/user-concentrated-pod/pom.xml b/plugins/deployment-planners/user-concentrated-pod/pom.xml
index 7e4d67586402..d27188dcc878 100644
--- a/plugins/deployment-planners/user-concentrated-pod/pom.xml
+++ b/plugins/deployment-planners/user-concentrated-pod/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/deployment-planners/user-dispersing/pom.xml b/plugins/deployment-planners/user-dispersing/pom.xml
index f04cdd3318ef..413993f24f4e 100644
--- a/plugins/deployment-planners/user-dispersing/pom.xml
+++ b/plugins/deployment-planners/user-dispersing/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/event-bus/inmemory/pom.xml b/plugins/event-bus/inmemory/pom.xml
index 0001e89d3b8f..efbf29086df4 100644
--- a/plugins/event-bus/inmemory/pom.xml
+++ b/plugins/event-bus/inmemory/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/event-bus/kafka/pom.xml b/plugins/event-bus/kafka/pom.xml
index 951df6c599ff..b6827a176b0b 100644
--- a/plugins/event-bus/kafka/pom.xml
+++ b/plugins/event-bus/kafka/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/event-bus/rabbitmq/pom.xml b/plugins/event-bus/rabbitmq/pom.xml
index fbd57806e3c3..bc8f78cab507 100644
--- a/plugins/event-bus/rabbitmq/pom.xml
+++ b/plugins/event-bus/rabbitmq/pom.xml
@@ -24,14 +24,14 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
com.rabbitmq
amqp-client
- 3.4.2
+ 3.5.4
org.apache.cloudstack
diff --git a/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java b/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java
index eb989dd2871b..5c0d6ce60478 100644
--- a/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java
+++ b/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java
@@ -29,6 +29,8 @@
import javax.naming.ConfigurationException;
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.rabbitmq.client.BlockedListener;
import org.apache.log4j.Logger;
import com.rabbitmq.client.AMQP;
@@ -91,6 +93,7 @@ public static void setUseSsl(String useSsl) {
private ExecutorService executorService;
private static DisconnectHandler disconnectHandler;
+ private static BlockedConnectionHandler blockedConnectionHandler;
private static final Logger s_logger = Logger.getLogger(RabbitMQEventBus.class);
@Override
@@ -134,6 +137,7 @@ public boolean configure(String name, Map params) throws Configu
s_subscribers = new ConcurrentHashMap>();
executorService = Executors.newCachedThreadPool();
disconnectHandler = new DisconnectHandler();
+ blockedConnectionHandler = new BlockedConnectionHandler();
return true;
}
@@ -382,6 +386,7 @@ private synchronized Connection createConnection() throws Exception {
}
Connection connection = factory.newConnection();
connection.addShutdownListener(disconnectHandler);
+ connection.addBlockedListener(blockedConnectionHandler);
s_connection = connection;
return s_connection;
} catch (Exception e) {
@@ -505,6 +510,21 @@ public synchronized boolean stop() {
return true;
}
+ //logic to deal with blocked connection. connections are blocked for example when the rabbitmq server is out of space. https://www.rabbitmq.com/connection-blocked.html
+ private class BlockedConnectionHandler implements BlockedListener {
+
+ @Override
+ public void handleBlocked(String reason) throws IOException {
+ s_logger.error("rabbitmq connection is blocked with reason: " + reason);
+ closeConnection();
+ throw new CloudRuntimeException("unblocking the parent thread as publishing to rabbitmq server is blocked with reason: " + reason);
+ }
+
+ @Override
+ public void handleUnblocked() throws IOException {
+ s_logger.info("rabbitmq connection in unblocked");
+ }
+ }
// logic to deal with loss of connection to AMQP server
private class DisconnectHandler implements ShutdownListener {
diff --git a/plugins/file-systems/netapp/pom.xml b/plugins/file-systems/netapp/pom.xml
index 0c3fba7f4301..2b2c7bd92313 100644
--- a/plugins/file-systems/netapp/pom.xml
+++ b/plugins/file-systems/netapp/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/ha-planners/skip-heurestics/pom.xml b/plugins/ha-planners/skip-heurestics/pom.xml
index 6728719a41d1..1511f8da0d3f 100644
--- a/plugins/ha-planners/skip-heurestics/pom.xml
+++ b/plugins/ha-planners/skip-heurestics/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/host-allocators/random/pom.xml b/plugins/host-allocators/random/pom.xml
index be1267ea0627..62284c229fa0 100644
--- a/plugins/host-allocators/random/pom.xml
+++ b/plugins/host-allocators/random/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/baremetal/pom.xml b/plugins/hypervisors/baremetal/pom.xml
index 9187a4232ae6..6e569cf680be 100755
--- a/plugins/hypervisors/baremetal/pom.xml
+++ b/plugins/hypervisors/baremetal/pom.xml
@@ -21,7 +21,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
cloud-plugin-hypervisor-baremetal
diff --git a/plugins/hypervisors/hyperv/pom.xml b/plugins/hypervisors/hyperv/pom.xml
index 7d1bd799880b..d88fd141885e 100644
--- a/plugins/hypervisors/hyperv/pom.xml
+++ b/plugins/hypervisors/hyperv/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java b/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java
index 8a1c414fb464..19c655b8f21f 100644
--- a/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java
+++ b/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java
@@ -48,9 +48,9 @@
import com.cloud.exception.OperationTimedoutException;
import com.cloud.host.Host;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StoragePool;
import com.cloud.storage.VolumeVO;
-import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.dao.VolumeDao;
import com.cloud.utils.Pair;
import com.cloud.utils.exception.CloudRuntimeException;
@@ -82,21 +82,12 @@ public StrategyPriority canHandle(Map volumeMap, Host src
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
throw new UnsupportedOperationException();
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) {
- CopyCommandResult result = new CopyCommandResult(null, null);
- result.setResult("Unsupported operation requested for copying data.");
- callback.complete(result);
-
- return null;
- }
-
- @Override
- public Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
+ public void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
AsyncCompletionCallback callback) {
Answer answer = null;
String errMsg = null;
@@ -115,7 +106,6 @@ public Void copyAsync(Map volumeMap, VirtualMachineTO vmT
CopyCommandResult result = new CopyCommandResult(null, answer);
result.setResult(errMsg);
callback.complete(result);
- return null;
}
private Answer migrateVmWithVolumes(VMInstanceVO vm, VirtualMachineTO to, Host srcHost,
diff --git a/plugins/hypervisors/kvm/.pydevproject b/plugins/hypervisors/kvm/.pydevproject
deleted file mode 100644
index d4a984a39095..000000000000
--- a/plugins/hypervisors/kvm/.pydevproject
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-Default
-python 2.7
-
diff --git a/plugins/hypervisors/kvm/pom.xml b/plugins/hypervisors/kvm/pom.xml
index aa26e7a38e24..f8100a50c067 100644
--- a/plugins/hypervisors/kvm/pom.xml
+++ b/plugins/hypervisors/kvm/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
old mode 100755
new mode 100644
index 883c8c99429d..02cf872d9271
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -57,6 +57,7 @@
import org.libvirt.Domain;
import org.libvirt.DomainBlockStats;
import org.libvirt.DomainInfo;
+import org.libvirt.MemoryStatistic;
import org.libvirt.DomainInfo.DomainState;
import org.libvirt.DomainInterfaceStats;
import org.libvirt.LibvirtException;
@@ -190,6 +191,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
private long _hvVersion;
private long _kernelVersion;
private int _timeout;
+ private static final int NUMMEMSTATS =2;
private KVMHAMonitor _monitor;
public static final String SSHKEYSPATH = "/root/.ssh";
@@ -3018,6 +3020,9 @@ private class VmStats {
long _ioWrote;
long _bytesRead;
long _bytesWrote;
+ long _intmemfree;
+ long _memory;
+ long _maxmemory;
Calendar _timestamp;
}
@@ -3026,11 +3031,16 @@ public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws Li
try {
dm = getDomain(conn, vmName);
final DomainInfo info = dm.getInfo();
+ final MemoryStatistic[] mems = dm.memoryStats(NUMMEMSTATS); //number of memory statistics required.
final VmStatsEntry stats = new VmStatsEntry();
+
stats.setNumCPUs(info.nrVirtCpu);
stats.setEntityType("vm");
+ stats.setMemoryKBs(info.maxMem);
+ stats.setTargetMemoryKBs(info.memory);
+ stats.setIntFreeMemoryKBs((double) mems[0].getValue());
/* get cpu utilization */
VmStats oldStats = null;
@@ -3115,6 +3125,9 @@ public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws Li
newStat._bytesRead = bytes_rd;
newStat._bytesWrote = bytes_wr;
newStat._timestamp = now;
+ newStat._intmemfree = mems[0].getValue();
+ newStat._memory = info.memory;
+ newStat._maxmemory = info.maxMem;
_vmStats.put(vmName, newStat);
return stats;
} finally {
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
index 04a27f3d8c70..47b9c40b8802 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
@@ -66,6 +66,8 @@
import org.libvirt.LibvirtException;
import org.libvirt.NodeInfo;
import org.libvirt.StorageVol;
+import org.libvirt.MemoryStatistic;
+
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
@@ -417,7 +419,10 @@ public void testGetVmStat() throws LibvirtException {
final Connect connect = Mockito.mock(Connect.class);
final Domain domain = Mockito.mock(Domain.class);
final DomainInfo domainInfo = new DomainInfo();
+ final MemoryStatistic[] domainMem = new MemoryStatistic[2];
+ domainMem[0] = Mockito.mock(MemoryStatistic.class);
Mockito.when(domain.getInfo()).thenReturn(domainInfo);
+ Mockito.when(domain.memoryStats(2)).thenReturn(domainMem);
Mockito.when(connect.domainLookupByName(VMNAME)).thenReturn(domain);
final NodeInfo nodeInfo = new NodeInfo();
nodeInfo.cpus = 8;
@@ -484,6 +489,10 @@ public List getDisks(final Connect conn, final String vmName) {
// IO traffic as generated by the logic above, must be greater than zero
Assert.assertTrue(vmStat.getDiskReadKBs() > 0);
Assert.assertTrue(vmStat.getDiskWriteKBs() > 0);
+ // Memory limit of VM must be greater than zero
+ Assert.assertTrue(vmStat.getIntFreeMemoryKBs() >= 0);
+ Assert.assertTrue(vmStat.getMemoryKBs() >= 0);
+ Assert.assertTrue(vmStat.getTargetMemoryKBs() >= vmStat.getMemoryKBs());
}
@Test
@@ -5021,4 +5030,4 @@ public void testIsInterface () {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtUtilitiesHelperTest.java b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtUtilitiesHelperTest.java
index bb7a3f53fa0e..a43b342228fa 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtUtilitiesHelperTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtUtilitiesHelperTest.java
@@ -16,6 +16,7 @@
// under the License.
package com.cloud.hypervisor.kvm.resource.wrapper;
+import java.io.File;
import java.util.UUID;
import com.cloud.utils.script.Script;
@@ -37,8 +38,8 @@ public void testSSHKeyPaths() {
* Hardcoded paths are not what we want in the longer run
*/
assertEquals("/root/.ssh", helper.retrieveSshKeysPath());
- assertEquals("/root/.ssh/id_rsa.pub.cloud", helper.retrieveSshPubKeyPath());
- assertEquals("/root/.ssh/id_rsa.cloud", helper.retrieveSshPrvKeyPath());
+ assertEquals("/root/.ssh" + File.separator + "id_rsa.pub.cloud", helper.retrieveSshPubKeyPath());
+ assertEquals("/root/.ssh" + File.separator + "id_rsa.cloud", helper.retrieveSshPrvKeyPath());
}
public void testBashScriptPath() {
diff --git a/plugins/hypervisors/ovm/pom.xml b/plugins/hypervisors/ovm/pom.xml
index a495630f05d8..e754e632a8da 100644
--- a/plugins/hypervisors/ovm/pom.xml
+++ b/plugins/hypervisors/ovm/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/ovm3/pom.xml b/plugins/hypervisors/ovm3/pom.xml
index 301051249ac2..8da1430137cb 100644
--- a/plugins/hypervisors/ovm3/pom.xml
+++ b/plugins/hypervisors/ovm3/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/simulator/pom.xml b/plugins/hypervisors/simulator/pom.xml
index 9f3de6c1611e..dbebba0146cf 100644
--- a/plugins/hypervisors/simulator/pom.xml
+++ b/plugins/hypervisors/simulator/pom.xml
@@ -22,7 +22,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
cloud-plugin-hypervisor-simulator
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
index 6602e1f1ad07..9863b22dd84a 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
@@ -319,7 +319,7 @@ public Answer getVmStats(final GetVmStatsCommand cmd) {
final HashMap vmStatsNameMap = new HashMap();
final List vmNames = cmd.getVmNames();
for (final String vmName : vmNames) {
- final VmStatsEntry entry = new VmStatsEntry(0, 0, 0, 0, "vm");
+ final VmStatsEntry entry = new VmStatsEntry(0, 0, 0, 0, 0, 0, 0, "vm");
entry.setNetworkReadKBs(32768); // default values 256 KBps
entry.setNetworkWriteKBs(16384);
entry.setCPUUtilization(10);
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/AgentStorageResource.java b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentStorageResource.java
index 751da9e3d2a3..9b1f091db71b 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/AgentStorageResource.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentStorageResource.java
@@ -109,7 +109,7 @@ public boolean configure(String name, Map params) throws Configu
}
@Override
- public String getRootDir(String url) {
+ public String getRootDir(String url, String nfsVersion) {
// TODO Auto-generated method stub
return null;
}
diff --git a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/motion/SimulatorDataMotionStrategy.java b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/motion/SimulatorDataMotionStrategy.java
index 40909629c705..5e72babf0810 100644
--- a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/motion/SimulatorDataMotionStrategy.java
+++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/motion/SimulatorDataMotionStrategy.java
@@ -43,21 +43,13 @@ public StrategyPriority canHandle(Map volumeMap, Host src
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
throw new UnsupportedOperationException();
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) {
+ public void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
CopyCommandResult result = new CopyCommandResult("something", null);
callback.complete(result);
- return null;
- }
-
- @Override
- public Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
- CopyCommandResult result = new CopyCommandResult("something", null);
- callback.complete(result);
- return null;
}
}
diff --git a/plugins/hypervisors/ucs/pom.xml b/plugins/hypervisors/ucs/pom.xml
index 7ec0256fa5fa..c8a14d19b07d 100755
--- a/plugins/hypervisors/ucs/pom.xml
+++ b/plugins/hypervisors/ucs/pom.xml
@@ -15,7 +15,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
cloud-plugin-hypervisor-ucs
diff --git a/plugins/hypervisors/vmware/pom.xml b/plugins/hypervisors/vmware/pom.xml
index 35ccaa4b878e..455fb5819d63 100644
--- a/plugins/hypervisors/vmware/pom.xml
+++ b/plugins/hypervisors/vmware/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index fd96bc8357cc..986000aa9389 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -200,10 +200,10 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) {
}
}
- String diskDeviceType = details.get(VmDetailConstants.ROOK_DISK_CONTROLLER);
+ String diskDeviceType = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
if (userVm) {
if (diskDeviceType == null) {
- details.put(VmDetailConstants.ROOK_DISK_CONTROLLER, _vmwareMgr.getRootDiskController());
+ details.put(VmDetailConstants.ROOT_DISK_CONTROLLER, _vmwareMgr.getRootDiskController());
}
}
String diskController = details.get(VmDetailConstants.DATA_DISK_CONTROLLER);
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
index 72ee2184e399..65590500a07f 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
@@ -36,7 +36,7 @@ public interface VmwareManager {
String getSystemVMDefaultNicAdapterType();
- void prepareSecondaryStorageStore(String strStorageUrl);
+ void prepareSecondaryStorageStore(String strStorageUrl, Long storeId);
void setupResourceStartupParams(Map params);
@@ -48,7 +48,7 @@ public interface VmwareManager {
String getManagementPortGroupName();
- String getSecondaryStorageStoreUrl(long dcId);
+ Pair getSecondaryStorageStoreUrlAndId(long dcId);
File getSystemVMKeyFile();
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index 575801fa6034..f27e938e7334 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -105,6 +105,7 @@
import com.cloud.org.Cluster.ClusterType;
import com.cloud.secstorage.CommandExecLogDao;
import com.cloud.server.ConfigurationServer;
+import com.cloud.storage.ImageStoreDetailsUtil;
import com.cloud.storage.JavaStorageLayer;
import com.cloud.storage.StorageLayer;
import com.cloud.utils.FileUtil;
@@ -167,6 +168,8 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
private ManagementServerHostPeerDao _mshostPeerDao;
@Inject
private ClusterManager _clusterMgr;
+ @Inject
+ private ImageStoreDetailsUtil imageStoreDetailsUtil;
private String _mountParent;
private StorageLayer _storage;
@@ -439,12 +442,14 @@ public List addHostToPodCluster(VmwareContext serviceCon
}
@Override
- public String getSecondaryStorageStoreUrl(long dcId) {
+ public Pair getSecondaryStorageStoreUrlAndId(long dcId) {
String secUrl = null;
+ Long secId = null;
DataStore secStore = _dataStoreMgr.getImageStore(dcId);
if (secStore != null) {
secUrl = secStore.getUri();
+ secId = secStore.getId();
}
if (secUrl == null) {
@@ -453,12 +458,13 @@ public String getSecondaryStorageStoreUrl(long dcId) {
DataStore cacheStore = _dataStoreMgr.getImageCacheStore(dcId);
if (cacheStore != null) {
secUrl = cacheStore.getUri();
+ secId = cacheStore.getId();
} else {
s_logger.warn("No staging storage is found when non-NFS secondary storage is used");
}
}
- return secUrl;
+ return new Pair(secUrl, secId);
}
@Override
@@ -546,8 +552,8 @@ public boolean needRecycle(String workerTag) {
}
@Override
- public void prepareSecondaryStorageStore(String storageUrl) {
- String mountPoint = getMountPoint(storageUrl);
+ public void prepareSecondaryStorageStore(String storageUrl, Long storeId) {
+ String mountPoint = getMountPoint(storageUrl, imageStoreDetailsUtil.getNfsVersion(storeId));
GlobalLock lock = GlobalLock.getInternLock("prepare.systemvm");
try {
@@ -655,7 +661,7 @@ public void run() {
}
@Override
- public String getMountPoint(String storageUrl) {
+ public String getMountPoint(String storageUrl, String nfsVersion) {
String mountPoint = null;
synchronized (_storageMounts) {
mountPoint = _storageMounts.get(storageUrl);
@@ -670,7 +676,8 @@ public String getMountPoint(String storageUrl) {
s_logger.error("Invalid storage URL format ", e);
throw new CloudRuntimeException("Unable to create mount point due to invalid storage URL format " + storageUrl);
}
- mountPoint = mount(uri.getHost() + ":" + uri.getPath(), _mountParent);
+
+ mountPoint = mount(uri.getHost() + ":" + uri.getPath(), _mountParent, nfsVersion);
if (mountPoint == null) {
s_logger.error("Unable to create mount point for " + storageUrl);
return "/mnt/sec"; // throw new CloudRuntimeException("Unable to create mount point for " + storageUrl);
@@ -745,7 +752,7 @@ private void shutdownCleanup() {
}
}
- protected String mount(String path, String parent) {
+ protected String mount(String path, String parent, String nfsVersion) {
String mountPoint = setupMountPoint(parent);
if (mountPoint == null) {
s_logger.warn("Unable to create a mount point");
@@ -756,6 +763,9 @@ protected String mount(String path, String parent) {
String result = null;
Script command = new Script(true, "mount", _timeout, s_logger);
command.add("-t", "nfs");
+ if (nfsVersion != null){
+ command.add("-o", "vers=" + nfsVersion);
+ }
// command.add("-o", "soft,timeo=133,retrans=2147483647,tcp,acdirmax=0,acdirmin=0");
if ("Mac OS X".equalsIgnoreCase(System.getProperty("os.name"))) {
command.add("-o", "resvport");
@@ -1234,4 +1244,5 @@ public boolean hasNexusVSM(Long clusterId) {
return true;
}
}
+
}
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index 4109ff2345b9..c7c53bacba99 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -92,6 +92,9 @@
import com.cloud.vm.snapshot.VMSnapshot;
public class VmwareStorageManagerImpl implements VmwareStorageManager {
+
+ private String _nfsVersion;
+
@Override
public boolean execute(VmwareHostService hostService, CreateEntityDownloadURLCommand cmd) {
DataTO data = cmd.getData();
@@ -138,6 +141,12 @@ public VmwareStorageManagerImpl(VmwareStorageMount mountService) {
_mountService = mountService;
}
+ public VmwareStorageManagerImpl(VmwareStorageMount mountService, String nfsVersion) {
+ assert (mountService != null);
+ _mountService = mountService;
+ _nfsVersion = nfsVersion;
+ }
+
public void configure(Map params) {
s_logger.info("Configure VmwareStorageManagerImpl");
@@ -156,7 +165,7 @@ public String createOvaForTemplate(TemplateObjectTO template) {
String secStorageUrl = nfsStore.getUrl();
assert (secStorageUrl != null);
String installPath = template.getPath();
- String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl, _nfsVersion);
String installFullPath = secondaryMountPoint + "/" + installPath;
try {
if (installFullPath.endsWith(".ova")) {
@@ -194,7 +203,7 @@ public String createOvaForVolume(VolumeObjectTO volume) {
String installPath = volume.getPath();
int index = installPath.lastIndexOf(File.separator);
String volumeUuid = installPath.substring(index + 1);
- String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl, _nfsVersion);
//The real volume path
String volumePath = installPath + File.separator + volumeUuid + ".ova";
String installFullPath = secondaryMountPoint + "/" + installPath;
@@ -271,7 +280,8 @@ public Answer execute(VmwareHostService hostService, PrimaryStorageDownloadComma
assert (morDs != null);
DatastoreMO primaryStorageDatastoreMo = new DatastoreMO(context, morDs);
- copyTemplateFromSecondaryToPrimary(hyperHost, primaryStorageDatastoreMo, secondaryStorageUrl, mountPoint, templateName, templateUuidName);
+ copyTemplateFromSecondaryToPrimary(hyperHost, primaryStorageDatastoreMo, secondaryStorageUrl, mountPoint, templateName, templateUuidName,
+ cmd.getNfsVersion());
} else {
s_logger.info("Template " + templateName + " has already been setup, skip the template setup process in primary storage");
}
@@ -345,7 +355,7 @@ public Answer execute(VmwareHostService hostService, BackupSnapshotCommand cmd)
snapshotBackupUuid =
backupSnapshotToSecondaryStorage(vmMo, accountId, volumeId, cmd.getVolumePath(), snapshotUuid, secondaryStorageUrl, prevSnapshotUuid, prevBackupUuid,
- hostService.getWorkerName(context, cmd, 1));
+ hostService.getWorkerName(context, cmd, 1), cmd.getNfsVersion());
success = (snapshotBackupUuid != null);
if (success) {
@@ -413,7 +423,7 @@ public Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromVo
Ternary result =
createTemplateFromVolume(vmMo, accountId, templateId, cmd.getUniqueName(), secondaryStoragePoolURL, volumePath,
- hostService.getWorkerName(context, cmd, 0));
+ hostService.getWorkerName(context, cmd, 0), cmd.getNfsVersion());
return new CreatePrivateTemplateAnswer(cmd, true, null, result.first(), result.third(), result.second(), cmd.getUniqueName(), ImageFormat.OVA);
@@ -441,7 +451,8 @@ public Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromSn
VmwareContext context = hostService.getServiceContext(cmd);
try {
- Ternary result = createTemplateFromSnapshot(accountId, newTemplateId, uniqeName, secondaryStorageUrl, volumeId, backedUpSnapshotUuid);
+ Ternary result = createTemplateFromSnapshot(accountId, newTemplateId, uniqeName, secondaryStorageUrl, volumeId, backedUpSnapshotUuid,
+ cmd.getNfsVersion());
return new CreatePrivateTemplateAnswer(cmd, true, null, result.first(), result.third(), result.second(), uniqeName, ImageFormat.OVA);
} catch (Throwable e) {
@@ -471,7 +482,7 @@ public Answer execute(VmwareHostService hostService, CopyVolumeCommand cmd) {
if (cmd.toSecondaryStorage()) {
result =
copyVolumeToSecStorage(hostService, hyperHost, cmd, vmName, volumeId, cmd.getPool().getUuid(), volumePath, secondaryStorageURL,
- hostService.getWorkerName(context, cmd, 0));
+ hostService.getWorkerName(context, cmd, 0), cmd.getNfsVersion());
} else {
StorageFilerTO poolTO = cmd.getPool();
@@ -484,8 +495,9 @@ public Answer execute(VmwareHostService hostService, CopyVolumeCommand cmd) {
}
}
- result = copyVolumeFromSecStorage(hyperHost, volumeId, new DatastoreMO(context, morDatastore), secondaryStorageURL, volumePath);
- deleteVolumeDirOnSecondaryStorage(volumeId, secondaryStorageURL);
+ result = copyVolumeFromSecStorage(hyperHost, volumeId, new DatastoreMO(context, morDatastore), secondaryStorageURL, volumePath,
+ cmd.getNfsVersion());
+ deleteVolumeDirOnSecondaryStorage(volumeId, secondaryStorageURL, cmd.getNfsVersion());
}
return new CopyVolumeAnswer(cmd, true, null, result.first(), result.second());
} catch (Throwable e) {
@@ -523,7 +535,8 @@ public Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCom
}
DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs);
- details = createVolumeFromSnapshot(hyperHost, primaryDsMo, newVolumeName, accountId, volumeId, secondaryStorageUrl, backedUpSnapshotUuid);
+ details = createVolumeFromSnapshot(hyperHost, primaryDsMo, newVolumeName, accountId, volumeId, secondaryStorageUrl, backedUpSnapshotUuid,
+ cmd.getNfsVersion());
if (details == null) {
success = true;
}
@@ -542,12 +555,12 @@ public Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCom
// templateName: name in secondary storage
// templateUuid: will be used at hypervisor layer
private void copyTemplateFromSecondaryToPrimary(VmwareHypervisorHost hyperHost, DatastoreMO datastoreMo, String secondaryStorageUrl,
- String templatePathAtSecondaryStorage, String templateName, String templateUuid) throws Exception {
+ String templatePathAtSecondaryStorage, String templateName, String templateUuid, String nfsVersion) throws Exception {
s_logger.info("Executing copyTemplateFromSecondaryToPrimary. secondaryStorage: " + secondaryStorageUrl + ", templatePathAtSecondaryStorage: " +
templatePathAtSecondaryStorage + ", templateName: " + templateName);
- String secondaryMountPoint = _mountService.getMountPoint(secondaryStorageUrl);
+ String secondaryMountPoint = _mountService.getMountPoint(secondaryStorageUrl, nfsVersion);
s_logger.info("Secondary storage mount point: " + secondaryMountPoint);
String srcOVAFileName = secondaryMountPoint + "/" + templatePathAtSecondaryStorage + templateName + "." + ImageFormat.OVA.getFileExtension();
@@ -598,9 +611,9 @@ private void copyTemplateFromSecondaryToPrimary(VmwareHypervisorHost hyperHost,
}
private Ternary createTemplateFromVolume(VirtualMachineMO vmMo, long accountId, long templateId, String templateUniqueName, String secStorageUrl,
- String volumePath, String workerVmName) throws Exception {
+ String volumePath, String workerVmName, String nfsVersion) throws Exception {
- String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl, nfsVersion);
String installPath = getTemplateRelativeDirInSecStorage(accountId, templateId);
String installFullPath = secondaryMountPoint + "/" + installPath;
synchronized (installPath.intern()) {
@@ -663,9 +676,9 @@ private Ternary createTemplateFromVolume(VirtualMachineMO vm
}
private Ternary createTemplateFromSnapshot(long accountId, long templateId, String templateUniqueName, String secStorageUrl, long volumeId,
- String backedUpSnapshotUuid) throws Exception {
+ String backedUpSnapshotUuid, String nfsVersion) throws Exception {
- String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl, nfsVersion);
String installPath = getTemplateRelativeDirInSecStorage(accountId, templateId);
String installFullPath = secondaryMountPoint + "/" + installPath;
String installFullOVAName = installFullPath + "/" + templateUniqueName + ".ova"; //Note: volss for tmpl
@@ -847,16 +860,16 @@ private void writeMetaOvaForTemplate(String installFullPath, String ovfFilename,
}
private String createVolumeFromSnapshot(VmwareHypervisorHost hyperHost, DatastoreMO primaryDsMo, String newVolumeName, long accountId, long volumeId,
- String secStorageUrl, String snapshotBackupUuid) throws Exception {
+ String secStorageUrl, String snapshotBackupUuid, String nfsVersion) throws Exception {
- restoreVolumeFromSecStorage(hyperHost, primaryDsMo, newVolumeName, secStorageUrl, getSnapshotRelativeDirInSecStorage(accountId, volumeId), snapshotBackupUuid);
+ restoreVolumeFromSecStorage(hyperHost, primaryDsMo, newVolumeName, secStorageUrl, getSnapshotRelativeDirInSecStorage(accountId, volumeId), snapshotBackupUuid, nfsVersion);
return null;
}
private void restoreVolumeFromSecStorage(VmwareHypervisorHost hyperHost, DatastoreMO primaryDsMo, String newVolumeName, String secStorageUrl, String secStorageDir,
- String backupName) throws Exception {
+ String backupName, String nfsVersion) throws Exception {
- String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl, nfsVersion);
String srcOVAFileName = secondaryMountPoint + "/" + secStorageDir + "/" + backupName + "." + ImageFormat.OVA.getFileExtension();
String snapshotDir = "";
if (backupName.contains("/")) {
@@ -914,17 +927,17 @@ private void restoreVolumeFromSecStorage(VmwareHypervisorHost hyperHost, Datasto
}
private String backupSnapshotToSecondaryStorage(VirtualMachineMO vmMo, long accountId, long volumeId, String volumePath, String snapshotUuid, String secStorageUrl,
- String prevSnapshotUuid, String prevBackupUuid, String workerVmName) throws Exception {
+ String prevSnapshotUuid, String prevBackupUuid, String workerVmName, String nfsVersion) throws Exception {
String backupUuid = UUID.randomUUID().toString();
- exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl, getSnapshotRelativeDirInSecStorage(accountId, volumeId), backupUuid, workerVmName);
+ exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl, getSnapshotRelativeDirInSecStorage(accountId, volumeId), backupUuid, workerVmName, nfsVersion);
return backupUuid + "/" + backupUuid;
}
private void exportVolumeToSecondaryStroage(VirtualMachineMO vmMo, String volumePath, String secStorageUrl, String secStorageDir, String exportName,
- String workerVmName) throws Exception {
+ String workerVmName, String nfsVersion) throws Exception {
- String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl, nfsVersion);
String exportPath = secondaryMountPoint + "/" + secStorageDir + "/" + exportName;
synchronized (exportPath.intern()) {
@@ -967,7 +980,7 @@ private void exportVolumeToSecondaryStroage(VirtualMachineMO vmMo, String volume
}
private Pair copyVolumeToSecStorage(VmwareHostService hostService, VmwareHypervisorHost hyperHost, CopyVolumeCommand cmd, String vmName,
- long volumeId, String poolId, String volumePath, String secStorageUrl, String workerVmName) throws Exception {
+ long volumeId, String poolId, String volumePath, String secStorageUrl, String workerVmName, String nfsVersion) throws Exception {
String volumeFolder = String.valueOf(volumeId) + "/";
VirtualMachineMO workerVm = null;
@@ -1004,7 +1017,7 @@ private Pair copyVolumeToSecStorage(VmwareHostService hostServic
vmMo.createSnapshot(exportName, "Temporary snapshot for copy-volume command", false, false);
exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl, "volumes/" + volumeFolder, exportName,
- hostService.getWorkerName(hyperHost.getContext(), cmd, 1));
+ hostService.getWorkerName(hyperHost.getContext(), cmd, 1), nfsVersion);
return new Pair(volumeFolder, exportName);
} finally {
@@ -1025,12 +1038,12 @@ private String getVolumePathInDatastore(DatastoreMO dsMo, String volumeFileName)
return datastoreVolumePath;
}
- private Pair copyVolumeFromSecStorage(VmwareHypervisorHost hyperHost, long volumeId, DatastoreMO dsMo, String secStorageUrl, String exportName)
+ private Pair copyVolumeFromSecStorage(VmwareHypervisorHost hyperHost, long volumeId, DatastoreMO dsMo, String secStorageUrl, String exportName, String nfsVersion)
throws Exception {
String volumeFolder = String.valueOf(volumeId) + "/";
String newVolume = UUID.randomUUID().toString().replaceAll("-", "");
- restoreVolumeFromSecStorage(hyperHost, dsMo, newVolume, secStorageUrl, "volumes/" + volumeFolder, exportName);
+ restoreVolumeFromSecStorage(hyperHost, dsMo, newVolume, secStorageUrl, "volumes/" + volumeFolder, exportName, nfsVersion);
return new Pair(volumeFolder, newVolume);
}
@@ -1445,8 +1458,8 @@ public RevertToVMSnapshotAnswer execute(VmwareHostService hostService, RevertToV
}
}
- private String deleteVolumeDirOnSecondaryStorage(long volumeId, String secStorageUrl) throws Exception {
- String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
+ private String deleteVolumeDirOnSecondaryStorage(long volumeId, String secStorageUrl, String nfsVersion) throws Exception {
+ String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl, nfsVersion);
String volumeMountRoot = secondaryMountPoint + "/" + getVolumeRelativeDirInSecStroage(volumeId);
return deleteDir(volumeMountRoot);
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java
index dd07029766c4..54b52f6dff4c 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java
@@ -17,5 +17,5 @@
package com.cloud.hypervisor.vmware.manager;
public interface VmwareStorageMount {
- String getMountPoint(String storageUrl);
+ String getMountPoint(String storageUrl, String nfsVersion);
}
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index fdbc244997d0..4d04abca4fa7 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -94,11 +94,13 @@
import com.vmware.vim25.VirtualMachineRelocateSpec;
import com.vmware.vim25.VirtualMachineRelocateSpecDiskLocator;
import com.vmware.vim25.VirtualMachineRuntimeInfo;
+import com.vmware.vim25.VirtualMachineVideoCard;
import com.vmware.vim25.VmwareDistributedVirtualSwitchVlanIdSpec;
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
import org.apache.cloudstack.storage.to.TemplateObjectTO;
import org.apache.cloudstack.storage.to.VolumeObjectTO;
+import org.apache.commons.lang.math.NumberUtils;
import com.cloud.agent.IAgentControl;
import com.cloud.agent.api.Answer;
@@ -1412,7 +1414,7 @@ protected StartAnswer execute(StartCommand cmd) {
String vmInternalCSName = names.first();
String vmNameOnVcenter = names.second();
String dataDiskController = vmSpec.getDetails().get(VmDetailConstants.DATA_DISK_CONTROLLER);
- String rootDiskController = vmSpec.getDetails().get(VmDetailConstants.ROOK_DISK_CONTROLLER);
+ String rootDiskController = vmSpec.getDetails().get(VmDetailConstants.ROOT_DISK_CONTROLLER);
// If root disk controller is scsi, then data disk controller would also be scsi instead of using 'osdefault'
// This helps avoid mix of different scsi subtype controllers in instance.
@@ -1636,12 +1638,14 @@ protected StartAnswer execute(StartCommand cmd) {
// prepare systemvm patch ISO
if (vmSpec.getType() != VirtualMachine.Type.User) {
// attach ISO (for patching of system VM)
- String secStoreUrl = mgr.getSecondaryStorageStoreUrl(Long.parseLong(_dcId));
+ Pair secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId));
+ String secStoreUrl = secStoreUrlAndId.first();
+ Long secStoreId = secStoreUrlAndId.second();
if (secStoreUrl == null) {
String msg = "secondary storage for dc " + _dcId + " is not ready yet?";
throw new Exception(msg);
}
- mgr.prepareSecondaryStorageStore(secStoreUrl);
+ mgr.prepareSecondaryStorageStore(secStoreUrl, secStoreId);
ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl);
if (morSecDs == null) {
@@ -1895,6 +1899,8 @@ protected StartAnswer execute(StartCommand cmd) {
postDiskConfigBeforeStart(vmMo, vmSpec, sortedDisks, ideControllerKey, scsiControllerKey, iqnToPath, hyperHost, context);
+ postVideoCardMemoryConfigBeforeStart(vmMo, vmSpec);
+
//
// Power-on VM
//
@@ -1943,6 +1949,79 @@ protected StartAnswer execute(StartCommand cmd) {
}
}
+ /**
+ * Sets video card memory to the one provided in detail svga.vramSize (if provided).
+ * 64MB was always set before.
+ * Size must be in KB.
+ * @param vmMo virtual machine mo
+ * @param vmSpec virtual machine specs
+ */
+ protected void postVideoCardMemoryConfigBeforeStart(VirtualMachineMO vmMo, VirtualMachineTO vmSpec) {
+ String paramVRamSize = "svga.vramSize";
+ if (vmSpec.getDetails().containsKey(paramVRamSize)){
+ String value = vmSpec.getDetails().get(paramVRamSize);
+ try {
+ long svgaVmramSize = Long.parseLong(value);
+ setNewVRamSizeVmVideoCard(vmMo, svgaVmramSize);
+ }
+ catch (NumberFormatException e){
+ s_logger.error("Unexpected value, cannot parse " + value + " to long due to: " + e.getMessage());
+ }
+ catch (Exception e){
+ s_logger.error("Error while reconfiguring vm due to: " + e.getMessage());
+ }
+ }
+ }
+
+ /**
+ * Search for vm video card iterating through vm device list
+ * @param vmMo virtual machine mo
+ * @param svgaVmramSize new svga vram size (in KB)
+ */
+ private void setNewVRamSizeVmVideoCard(VirtualMachineMO vmMo, long svgaVmramSize) throws Exception {
+ for (VirtualDevice device : vmMo.getAllDeviceList()){
+ if (device instanceof VirtualMachineVideoCard){
+ VirtualMachineVideoCard videoCard = (VirtualMachineVideoCard) device;
+ modifyVmVideoCardVRamSize(videoCard, vmMo, svgaVmramSize);
+ }
+ }
+ }
+
+ /**
+ * Modifies vm vram size if it was set to a different size to the one provided in svga.vramSize (user_vm_details or template_vm_details)
+ * @param videoCard vm's video card device
+ * @param vmMo virtual machine mo
+ * @param svgaVmramSize new svga vram size (in KB)
+ */
+ private void modifyVmVideoCardVRamSize(VirtualMachineVideoCard videoCard, VirtualMachineMO vmMo, long svgaVmramSize) throws Exception {
+ if (videoCard.getVideoRamSizeInKB().longValue() != svgaVmramSize){
+ s_logger.info("Video card memory was set " + videoCard.getVideoRamSizeInKB().longValue() + "kb instead of " + svgaVmramSize + "kb");
+ VirtualMachineConfigSpec newSizeSpecs = configSpecVideoCardNewVRamSize(videoCard, svgaVmramSize);
+ boolean res = vmMo.configureVm(newSizeSpecs);
+ if (res) {
+ s_logger.info("Video card memory successfully updated to " + svgaVmramSize + "kb");
+ }
+ }
+ }
+
+ /**
+ * Returns a VirtualMachineConfigSpec to edit its svga vram size
+ * @param videoCard video card device to edit providing the svga vram size
+ * @param svgaVmramSize new svga vram size (in KB)
+ */
+ private VirtualMachineConfigSpec configSpecVideoCardNewVRamSize(VirtualMachineVideoCard videoCard, long svgaVmramSize){
+ videoCard.setVideoRamSizeInKB(svgaVmramSize);
+ videoCard.setUseAutoDetect(false);
+
+ VirtualDeviceConfigSpec arrayVideoCardConfigSpecs = new VirtualDeviceConfigSpec();
+ arrayVideoCardConfigSpecs.setDevice(videoCard);
+ arrayVideoCardConfigSpecs.setOperation(VirtualDeviceConfigSpecOperation.EDIT);
+
+ VirtualMachineConfigSpec changeVideoCardSpecs = new VirtualMachineConfigSpec();
+ changeVideoCardSpecs.getDeviceChange().add(arrayVideoCardConfigSpecs);
+ return changeVideoCardSpecs;
+ }
+
private void tearDownVm(VirtualMachineMO vmMo) throws Exception{
if(vmMo == null) return;
@@ -2322,14 +2401,14 @@ private int getDiskController(VirtualMachineDiskInfo matchingExistingDisk, DiskT
if (vol.getType() == Volume.Type.ROOT) {
Map vmDetails = vmSpec.getDetails();
- if (vmDetails != null && vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER) != null) {
- if (vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER).equalsIgnoreCase("scsi")) {
+ if (vmDetails != null && vmDetails.get(VmDetailConstants.ROOT_DISK_CONTROLLER) != null) {
+ if (vmDetails.get(VmDetailConstants.ROOT_DISK_CONTROLLER).equalsIgnoreCase("scsi")) {
s_logger.info("Chose disk controller for vol " + vol.getType() + " -> scsi, based on root disk controller settings: " +
- vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER));
+ vmDetails.get(VmDetailConstants.ROOT_DISK_CONTROLLER));
controllerKey = scsiControllerKey;
} else {
s_logger.info("Chose disk controller for vol " + vol.getType() + " -> ide, based on root disk controller settings: " +
- vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER));
+ vmDetails.get(VmDetailConstants.ROOT_DISK_CONTROLLER));
controllerKey = ideControllerKey;
}
} else {
@@ -3134,12 +3213,14 @@ protected Answer execute(PrepareForMigrationCommand cmd) {
prepareNetworkFromNicInfo(new HostMO(getServiceContext(), _morHyperHost), nic, false, cmd.getVirtualMachine().getType());
}
- String secStoreUrl = mgr.getSecondaryStorageStoreUrl(Long.parseLong(_dcId));
+ Pair secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId));
+ String secStoreUrl = secStoreUrlAndId.first();
+ Long secStoreId = secStoreUrlAndId.second();
if (secStoreUrl == null) {
String msg = "secondary storage for dc " + _dcId + " is not ready yet?";
throw new Exception(msg);
}
- mgr.prepareSecondaryStorageStore(secStoreUrl);
+ mgr.prepareSecondaryStorageStore(secStoreUrl, secStoreId);
ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl);
if (morSecDs == null) {
@@ -3350,12 +3431,14 @@ protected Answer execute(MigrateWithStorageCommand cmd) {
}
// Ensure secondary storage mounted on target host
- String secStoreUrl = mgr.getSecondaryStorageStoreUrl(Long.parseLong(_dcId));
+ Pair secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId));
+ String secStoreUrl = secStoreUrlAndId.first();
+ Long secStoreId = secStoreUrlAndId.second();
if (secStoreUrl == null) {
String msg = "secondary storage for dc " + _dcId + " is not ready yet?";
throw new Exception(msg);
}
- mgr.prepareSecondaryStorageStore(secStoreUrl);
+ mgr.prepareSecondaryStorageStore(secStoreUrl, secStoreId);
ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnSpecificHost(secStoreUrl, tgtHyperHost);
if (morSecDs == null) {
String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl;
@@ -4862,8 +4945,14 @@ private HashMap getVmStats(List vmNames) throws Ex
}
String instanceNameCustomField = "value[" + key + "]";
+ final String numCpuStr = "summary.config.numCpu";
+ final String cpuUseStr = "summary.quickStats.overallCpuUsage";
+ final String guestMemUseStr = "summary.quickStats.guestMemoryUsage";
+ final String memLimitStr = "resourceConfig.memoryAllocation.limit";
+ final String memMbStr = "config.hardware.memoryMB";
+
ObjectContent[] ocs =
- hyperHost.getVmPropertiesOnHyperHost(new String[] {"name", "summary.config.numCpu", "summary.quickStats.overallCpuUsage", instanceNameCustomField});
+ hyperHost.getVmPropertiesOnHyperHost(new String[] {"name", numCpuStr, cpuUseStr ,guestMemUseStr ,memLimitStr ,memMbStr, instanceNameCustomField});
if (ocs != null && ocs.length > 0) {
for (ObjectContent oc : ocs) {
List objProps = oc.getPropSet();
@@ -4871,6 +4960,9 @@ private HashMap getVmStats(List vmNames) throws Ex
String name = null;
String numberCPUs = null;
String maxCpuUsage = null;
+ String memlimit = null;
+ String memkb = null;
+ String guestMemusage = null;
String vmNameOnVcenter = null;
String vmInternalCSName = null;
for (DynamicProperty objProp : objProps) {
@@ -4879,10 +4971,16 @@ private HashMap getVmStats(List vmNames) throws Ex
} else if (objProp.getName().contains(instanceNameCustomField)) {
if (objProp.getVal() != null)
vmInternalCSName = ((CustomFieldStringValue)objProp.getVal()).getValue();
- } else if (objProp.getName().equals("summary.config.numCpu")) {
+ }else if(objProp.getName().equals(guestMemusage)){
+ guestMemusage = objProp.getVal().toString();
+ }else if (objProp.getName().equals(numCpuStr)) {
numberCPUs = objProp.getVal().toString();
- } else if (objProp.getName().equals("summary.quickStats.overallCpuUsage")) {
+ } else if (objProp.getName().equals(cpuUseStr)) {
maxCpuUsage = objProp.getVal().toString();
+ } else if (objProp.getName().equals(memLimitStr)) {
+ memlimit = objProp.getVal().toString();
+ } else if (objProp.getName().equals(memMbStr)) {
+ memkb = objProp.getVal().toString();
}
}
new VirtualMachineMO(hyperHost.getContext(), oc.getObj());
@@ -4951,7 +5049,7 @@ private HashMap getVmStats(List vmNames) throws Ex
}
}
}
- vmResponseMap.put(name, new VmStatsEntry(Integer.parseInt(maxCpuUsage), networkReadKBs, networkWriteKBs, Integer.parseInt(numberCPUs), "vm"));
+ vmResponseMap.put(name, new VmStatsEntry( NumberUtils.toDouble(memkb)*1024,NumberUtils.toDouble(guestMemusage)*1024,NumberUtils.toDouble(memlimit)*1024, NumberUtils.toDouble(maxCpuUsage), networkReadKBs, networkWriteKBs, NumberUtils.toInt(numberCPUs), "vm"));
}
}
}
@@ -5191,8 +5289,8 @@ else if (value != null && value.equalsIgnoreCase("ide"))
value = (String)params.get("scripts.timeout");
int timeout = NumbersUtil.parseInt(value, 1440) * 1000;
- _storageProcessor = new VmwareStorageProcessor((VmwareHostService)this, _fullCloneFlag, (VmwareStorageMount)mgr, timeout, this, _shutdownWaitMs, null);
- storageHandler = new VmwareStorageSubsystemCommandHandler(_storageProcessor);
+ _storageProcessor = new VmwareStorageProcessor((VmwareHostService)this, _fullCloneFlag, (VmwareStorageMount)mgr, timeout, this, _shutdownWaitMs, null, (String)params.get("nfsVersion"));
+ storageHandler = new VmwareStorageSubsystemCommandHandler(_storageProcessor, (String)params.get("nfsVersion"));
_vrResource = new VirtualRoutingResource(this);
if (!_vrResource.configure(name, params)) {
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java
index 8e4a0d2a83db..1ec4958509bc 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java
@@ -102,7 +102,7 @@ public boolean configure(String name, Map params) throws Configu
VmwareSecondaryStorageContextFactory.initFactoryEnvironment();
}
- registerHandler(Hypervisor.HypervisorType.VMware, new VmwareSecondaryStorageResourceHandler(this));
+ registerHandler(Hypervisor.HypervisorType.VMware, new VmwareSecondaryStorageResourceHandler(this, (String)params.get("nfsVersion")));
return true;
}
}
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
index 8a277991aac6..3c4e6340d31f 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
@@ -66,13 +66,13 @@ public class VmwareSecondaryStorageResourceHandler implements SecondaryStorageRe
* private Map _activeHosts = new HashMap();
*/
- public VmwareSecondaryStorageResourceHandler(PremiumSecondaryStorageResource resource) {
+ public VmwareSecondaryStorageResourceHandler(PremiumSecondaryStorageResource resource, String nfsVersion) {
_resource = resource;
- _storageMgr = new VmwareStorageManagerImpl(this);
+ _storageMgr = new VmwareStorageManagerImpl(this, nfsVersion);
_gson = GsonHelper.getGsonLogger();
- VmwareStorageProcessor storageProcessor = new VmwareStorageProcessor(this, true, this, resource.getTimeout(), null, null, _resource);
- VmwareStorageSubsystemCommandHandler vmwareStorageSubsystemCommandHandler = new VmwareStorageSubsystemCommandHandler(storageProcessor);
+ VmwareStorageProcessor storageProcessor = new VmwareStorageProcessor(this, true, this, resource.getTimeout(), null, null, _resource, nfsVersion);
+ VmwareStorageSubsystemCommandHandler vmwareStorageSubsystemCommandHandler = new VmwareStorageSubsystemCommandHandler(storageProcessor, nfsVersion);
vmwareStorageSubsystemCommandHandler.setStorageResource(_resource);
vmwareStorageSubsystemCommandHandler.setStorageManager(_storageMgr);
storageSubsystemHandler = vmwareStorageSubsystemCommandHandler;
@@ -304,7 +304,7 @@ public String getWorkerName(VmwareContext context, Command cmd, int workerSequen
}
@Override
- public String getMountPoint(String storageUrl) {
- return _resource.getRootDir(storageUrl);
+ public String getMountPoint(String storageUrl, String nfsVersion) {
+ return _resource.getRootDir(storageUrl, nfsVersion);
}
}
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
index fa2f369afaf6..f3bf91c4e58a 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
@@ -109,6 +109,7 @@
import com.cloud.vm.VmDetailConstants;
public class VmwareStorageProcessor implements StorageProcessor {
+
private static final Logger s_logger = Logger.getLogger(VmwareStorageProcessor.class);
private static final int DEFAULT_NFS_PORT = 2049;
@@ -120,9 +121,10 @@ public class VmwareStorageProcessor implements StorageProcessor {
protected Integer _shutdownWaitMs;
private final Gson _gson;
private final StorageLayer _storage = new JavaStorageLayer();
+ private String _nfsVersion;
public VmwareStorageProcessor(VmwareHostService hostService, boolean fullCloneFlag, VmwareStorageMount mountService, Integer timeout, VmwareResource resource,
- Integer shutdownWaitMs, PremiumSecondaryStorageResource storageResource) {
+ Integer shutdownWaitMs, PremiumSecondaryStorageResource storageResource, String nfsVersion) {
this.hostService = hostService;
_fullCloneFlag = fullCloneFlag;
this.mountService = mountService;
@@ -130,6 +132,7 @@ public VmwareStorageProcessor(VmwareHostService hostService, boolean fullCloneFl
this.resource = resource;
_shutdownWaitMs = shutdownWaitMs;
_gson = GsonHelper.getGsonLogger();
+ _nfsVersion = nfsVersion;
}
@Override
@@ -155,12 +158,12 @@ private String getOVFFilePath(String srcOVAFileName) {
}
private VirtualMachineMO copyTemplateFromSecondaryToPrimary(VmwareHypervisorHost hyperHost, DatastoreMO datastoreMo, String secondaryStorageUrl,
- String templatePathAtSecondaryStorage, String templateName, String templateUuid, boolean createSnapshot) throws Exception {
+ String templatePathAtSecondaryStorage, String templateName, String templateUuid, boolean createSnapshot, String nfsVersion) throws Exception {
s_logger.info("Executing copyTemplateFromSecondaryToPrimary. secondaryStorage: " + secondaryStorageUrl + ", templatePathAtSecondaryStorage: " +
templatePathAtSecondaryStorage + ", templateName: " + templateName);
- String secondaryMountPoint = mountService.getMountPoint(secondaryStorageUrl);
+ String secondaryMountPoint = mountService.getMountPoint(secondaryStorageUrl, nfsVersion);
s_logger.info("Secondary storage mount point: " + secondaryMountPoint);
String srcOVAFileName =
@@ -316,7 +319,7 @@ public Answer copyTemplateToPrimaryStorage(CopyCommand cmd) {
if (managed) {
VirtualMachineMO vmMo = copyTemplateFromSecondaryToPrimary(hyperHost, dsMo, secondaryStorageUrl, templateInfo.first(), templateInfo.second(),
- managedStoragePoolRootVolumeName, false);
+ managedStoragePoolRootVolumeName, false, _nfsVersion);
vmMo.unregisterVm();
@@ -333,7 +336,7 @@ public Answer copyTemplateToPrimaryStorage(CopyCommand cmd) {
}
else {
copyTemplateFromSecondaryToPrimary(hyperHost, dsMo, secondaryStorageUrl, templateInfo.first(), templateInfo.second(),
- templateUuidName, true);
+ templateUuidName, true, _nfsVersion);
}
} else {
s_logger.info("Template " + templateInfo.second() + " has already been setup, skip the template setup process in primary storage");
@@ -518,7 +521,7 @@ public Answer cloneVolumeFromBaseTemplate(CopyCommand cmd) {
}
}
- private Pair copyVolumeFromSecStorage(VmwareHypervisorHost hyperHost, String srcVolumePath, DatastoreMO dsMo, String secStorageUrl, long wait) throws Exception {
+ private Pair copyVolumeFromSecStorage(VmwareHypervisorHost hyperHost, String srcVolumePath, DatastoreMO dsMo, String secStorageUrl, long wait, String nfsVersion) throws Exception {
String volumeFolder = null;
String volumeName = null;
@@ -533,13 +536,13 @@ private Pair copyVolumeFromSecStorage(VmwareHypervisorHost hyper
}
String newVolume = VmwareHelper.getVCenterSafeUuid();
- restoreVolumeFromSecStorage(hyperHost, dsMo, newVolume, secStorageUrl, volumeFolder, volumeName, wait);
+ restoreVolumeFromSecStorage(hyperHost, dsMo, newVolume, secStorageUrl, volumeFolder, volumeName, wait, nfsVersion);
return new Pair(volumeFolder, newVolume);
}
- private String deleteVolumeDirOnSecondaryStorage(String volumeDir, String secStorageUrl) throws Exception {
- String secondaryMountPoint = mountService.getMountPoint(secStorageUrl);
+ private String deleteVolumeDirOnSecondaryStorage(String volumeDir, String secStorageUrl, String nfsVersion) throws Exception {
+ String secondaryMountPoint = mountService.getMountPoint(secStorageUrl, nfsVersion);
String volumeMountRoot = secondaryMountPoint + File.separator + volumeDir;
return deleteDir(volumeMountRoot);
@@ -578,8 +581,8 @@ public Answer copyVolumeFromImageCacheToPrimary(CopyCommand cmd) {
}
}
- Pair result = copyVolumeFromSecStorage(hyperHost, srcVolume.getPath(), new DatastoreMO(context, morDatastore), srcStore.getUrl(), (long)cmd.getWait() * 1000);
- deleteVolumeDirOnSecondaryStorage(result.first(), srcStore.getUrl());
+ Pair result = copyVolumeFromSecStorage(hyperHost, srcVolume.getPath(), new DatastoreMO(context, morDatastore), srcStore.getUrl(), (long)cmd.getWait() * 1000, _nfsVersion);
+ deleteVolumeDirOnSecondaryStorage(result.first(), srcStore.getUrl(), _nfsVersion);
VolumeObjectTO newVolume = new VolumeObjectTO();
newVolume.setPath(result.second());
return new CopyCmdAnswer(newVolume);
@@ -636,7 +639,7 @@ private Pair copyVolumeToSecStorage(VmwareHostService hostServic
vmMo.createSnapshot(exportName, "Temporary snapshot for copy-volume command", false, false);
- exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl, destVolumePath, exportName, hostService.getWorkerName(hyperHost.getContext(), cmd, 1));
+ exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl, destVolumePath, exportName, hostService.getWorkerName(hyperHost.getContext(), cmd, 1), _nfsVersion);
return new Pair(destVolumePath, exportName);
} finally {
@@ -720,9 +723,9 @@ private void postCreatePrivateTemplate(String installFullPath, long templateId,
}
private Ternary createTemplateFromVolume(VirtualMachineMO vmMo, String installPath, long templateId, String templateUniqueName,
- String secStorageUrl, String volumePath, String workerVmName) throws Exception {
+ String secStorageUrl, String volumePath, String workerVmName, String nfsVersion) throws Exception {
- String secondaryMountPoint = mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = mountService.getMountPoint(secStorageUrl, nfsVersion);
String installFullPath = secondaryMountPoint + "/" + installPath;
synchronized (installPath.intern()) {
Script command = new Script(false, "mkdir", _timeout, s_logger);
@@ -838,7 +841,7 @@ public Answer createTemplateFromVolume(CopyCommand cmd) {
Ternary result =
createTemplateFromVolume(vmMo, template.getPath(), template.getId(), template.getName(), secondaryStoragePoolURL, volumePath,
- hostService.getWorkerName(context, cmd, 0));
+ hostService.getWorkerName(context, cmd, 0), _nfsVersion);
TemplateObjectTO newTemplate = new TemplateObjectTO();
newTemplate.setPath(result.first());
@@ -885,7 +888,7 @@ private void writeMetaOvaForTemplate(String installFullPath, String ovfFilename,
}
private Ternary createTemplateFromSnapshot(String installPath, String templateUniqueName, String secStorageUrl, String snapshotPath,
- Long templateId, long wait) throws Exception {
+ Long templateId, long wait, String nfsVersion) throws Exception {
//Snapshot path is decoded in this form: /snapshots/account/volumeId/uuid/uuid
String backupSSUuid;
String snapshotFolder;
@@ -899,7 +902,7 @@ private Ternary createTemplateFromSnapshot(String installPat
snapshotFolder = StringUtils.join(tokens, File.separator, 0, tokens.length - 1);
}
- String secondaryMountPoint = mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = mountService.getMountPoint(secStorageUrl, nfsVersion);
String installFullPath = secondaryMountPoint + "/" + installPath;
String installFullOVAName = installFullPath + "/" + templateUniqueName + ".ova"; //Note: volss for tmpl
String snapshotRoot = secondaryMountPoint + "/" + snapshotFolder;
@@ -1029,7 +1032,7 @@ public Answer createTemplateFromSnapshot(CopyCommand cmd) {
}
NfsTO nfsSvr = (NfsTO)imageStore;
- Ternary result = createTemplateFromSnapshot(template.getPath(), uniqeName, nfsSvr.getUrl(), snapshot.getPath(), template.getId(), (long)cmd.getWait() * 1000);
+ Ternary result = createTemplateFromSnapshot(template.getPath(), uniqeName, nfsSvr.getUrl(), snapshot.getPath(), template.getId(), (long)cmd.getWait() * 1000, _nfsVersion);
TemplateObjectTO newTemplate = new TemplateObjectTO();
newTemplate.setPath(result.first());
@@ -1052,9 +1055,9 @@ public Answer createTemplateFromSnapshot(CopyCommand cmd) {
// return Pair
private Pair exportVolumeToSecondaryStroage(VirtualMachineMO vmMo, String volumePath, String secStorageUrl, String secStorageDir,
- String exportName, String workerVmName) throws Exception {
+ String exportName, String workerVmName, String nfsVersion) throws Exception {
- String secondaryMountPoint = mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = mountService.getMountPoint(secStorageUrl, nfsVersion);
String exportPath = secondaryMountPoint + "/" + secStorageDir + "/" + exportName;
synchronized (exportPath.intern()) {
@@ -1096,10 +1099,10 @@ private Pair exportVolumeToSecondaryStroage(VirtualMachineMO v
// Ternary
private Ternary backupSnapshotToSecondaryStorage(VirtualMachineMO vmMo, String installPath, String volumePath, String snapshotUuid,
- String secStorageUrl, String prevSnapshotUuid, String prevBackupUuid, String workerVmName) throws Exception {
+ String secStorageUrl, String prevSnapshotUuid, String prevBackupUuid, String workerVmName, String nfsVersion) throws Exception {
String backupUuid = UUID.randomUUID().toString();
- Pair snapshotInfo = exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl, installPath, backupUuid, workerVmName);
+ Pair snapshotInfo = exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl, installPath, backupUuid, workerVmName, nfsVersion);
return new Ternary(backupUuid, snapshotInfo.first(), snapshotInfo.second());
}
@@ -1174,7 +1177,7 @@ public Answer backupSnapshot(CopyCommand cmd) {
backupResult =
backupSnapshotToSecondaryStorage(vmMo, destSnapshot.getPath(), srcSnapshot.getVolume().getPath(), snapshotUuid, secondaryStorageUrl,
- prevSnapshotUuid, prevBackupUuid, hostService.getWorkerName(context, cmd, 1));
+ prevSnapshotUuid, prevBackupUuid, hostService.getWorkerName(context, cmd, 1), _nfsVersion);
snapshotBackupUuid = backupResult.first();
success = (snapshotBackupUuid != null);
@@ -1186,7 +1189,7 @@ public Answer backupSnapshot(CopyCommand cmd) {
// Get snapshot physical size
long physicalSize = 0l;
- String secondaryMountPoint = mountService.getMountPoint(secondaryStorageUrl);
+ String secondaryMountPoint = mountService.getMountPoint(secondaryStorageUrl, _nfsVersion);
String snapshotDir = destSnapshot.getPath() + "/" + snapshotBackupUuid;
File[] files = new File(secondaryMountPoint + "/" + snapshotDir).listFiles();
if(files != null) {
@@ -1364,7 +1367,7 @@ private Answer attachVolume(Command cmd, DiskTO disk, boolean isAttach, boolean
if (isAttach) {
String dataDiskController = controllerInfo.get(VmDetailConstants.DATA_DISK_CONTROLLER);
- String rootDiskController = controllerInfo.get(VmDetailConstants.ROOK_DISK_CONTROLLER);
+ String rootDiskController = controllerInfo.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
DiskControllerType rootDiskControllerType = DiskControllerType.getType(rootDiskController);
if (dataDiskController == null) {
@@ -2144,9 +2147,9 @@ private List getManagedIqnsFromVirtualDisks(List virtualDis
}
private Long restoreVolumeFromSecStorage(VmwareHypervisorHost hyperHost, DatastoreMO primaryDsMo, String newVolumeName, String secStorageUrl, String secStorageDir,
- String backupName, long wait) throws Exception {
+ String backupName, long wait, String nfsVersion) throws Exception {
- String secondaryMountPoint = mountService.getMountPoint(secStorageUrl);
+ String secondaryMountPoint = mountService.getMountPoint(secStorageUrl, null);
String srcOVAFileName = null;
String srcOVFFileName = null;
@@ -2248,7 +2251,7 @@ public Answer createVolumeFromSnapshot(CopyCommand cmd) {
backedUpSnapshotUuid = backedUpSnapshotUuid.replace(".ovf", "");
}
DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs);
- restoreVolumeFromSecStorage(hyperHost, primaryDsMo, newVolumeName, secondaryStorageUrl, backupPath, backedUpSnapshotUuid, (long)cmd.getWait() * 1000);
+ restoreVolumeFromSecStorage(hyperHost, primaryDsMo, newVolumeName, secondaryStorageUrl, backupPath, backedUpSnapshotUuid, (long)cmd.getWait() * 1000, _nfsVersion);
VolumeObjectTO newVol = new VolumeObjectTO();
newVol.setPath(newVolumeName);
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
index 431286248b2d..40fa47b03bb3 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
@@ -21,7 +21,6 @@
import java.io.File;
import org.apache.log4j.Logger;
-
import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.DeleteCommand;
@@ -40,9 +39,11 @@
import com.cloud.storage.DataStoreRole;
public class VmwareStorageSubsystemCommandHandler extends StorageSubsystemCommandHandlerBase {
+
private static final Logger s_logger = Logger.getLogger(VmwareStorageSubsystemCommandHandler.class);
private VmwareStorageManager storageManager;
private PremiumSecondaryStorageResource storageResource;
+ private String _nfsVersion;
public PremiumSecondaryStorageResource getStorageResource() {
return storageResource;
@@ -60,8 +61,9 @@ public void setStorageManager(VmwareStorageManager storageManager) {
this.storageManager = storageManager;
}
- public VmwareStorageSubsystemCommandHandler(StorageProcessor processor) {
+ public VmwareStorageSubsystemCommandHandler(StorageProcessor processor, String nfsVersion) {
super(processor);
+ this._nfsVersion = nfsVersion;
}
@Override
@@ -82,7 +84,7 @@ protected Answer execute(CopyCommand cmd) {
//need to take extra processing for vmware, such as packing to ova, before sending to S3
if (srcData.getObjectType() == DataObjectType.VOLUME) {
NfsTO cacheStore = (NfsTO)srcDataStore;
- String parentPath = storageResource.getRootDir(cacheStore.getUrl());
+ String parentPath = storageResource.getRootDir(cacheStore.getUrl(), _nfsVersion);
VolumeObjectTO vol = (VolumeObjectTO)srcData;
String path = vol.getPath();
int index = path.lastIndexOf(File.separator);
@@ -95,7 +97,7 @@ protected Answer execute(CopyCommand cmd) {
} else if (srcData.getObjectType() == DataObjectType.SNAPSHOT) {
// pack ova first
// sync snapshot from NFS cache to S3 in NFS migration to S3 case
- String parentPath = storageResource.getRootDir(srcDataStore.getUrl());
+ String parentPath = storageResource.getRootDir(srcDataStore.getUrl(), _nfsVersion);
SnapshotObjectTO snap = (SnapshotObjectTO)srcData;
String path = snap.getPath();
int index = path.lastIndexOf(File.separator);
@@ -138,7 +140,7 @@ protected Answer execute(CopyCommand cmd) {
return answer;
}
NfsTO cacheStore = (NfsTO)cmd.getCacheTO().getDataStore();
- String parentPath = storageResource.getRootDir(cacheStore.getUrl());
+ String parentPath = storageResource.getRootDir(cacheStore.getUrl(), _nfsVersion);
SnapshotObjectTO newSnapshot = (SnapshotObjectTO)answer.getNewData();
String path = newSnapshot.getPath();
int index = path.lastIndexOf(File.separator);
diff --git a/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java b/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java
index 4b77aab61706..23b32a3d255c 100644
--- a/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java
+++ b/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java
@@ -25,9 +25,6 @@
import javax.inject.Inject;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionStrategy;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
@@ -38,6 +35,8 @@
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.to.VolumeObjectTO;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
@@ -87,21 +86,12 @@ public StrategyPriority canHandle(Map volumeMap, Host src
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
throw new UnsupportedOperationException();
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) {
- CopyCommandResult result = new CopyCommandResult(null, null);
- result.setResult("Unsupported operation requested for copying data.");
- callback.complete(result);
-
- return null;
- }
-
- @Override
- public Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
Answer answer = null;
String errMsg = null;
try {
@@ -123,7 +113,6 @@ public Void copyAsync(Map volumeMap, VirtualMachineTO vmT
CopyCommandResult result = new CopyCommandResult(null, answer);
result.setResult(errMsg);
callback.complete(result);
- return null;
}
private Answer migrateVmWithVolumesAcrossCluster(VMInstanceVO vm, VirtualMachineTO to, Host srcHost, Host destHost, Map volumeToPool)
diff --git a/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java b/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
index 3b3dd4794991..fec2aba40f64 100644
--- a/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
+++ b/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
@@ -25,18 +25,19 @@
import java.util.UUID;
import javax.inject.Inject;
-import javax.naming.ConfigurationException;
import com.cloud.user.User;
+
import org.junit.After;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -48,12 +49,13 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
-
import org.apache.cloudstack.api.command.admin.zone.AddVmwareDcCmd;
import org.apache.cloudstack.api.command.admin.zone.RemoveVmwareDcCmd;
import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
+import org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;
import org.apache.cloudstack.test.utils.SpringUtils;
import com.cloud.agent.AgentManager;
@@ -86,6 +88,7 @@
import com.cloud.org.Managed.ManagedState;
import com.cloud.secstorage.CommandExecLogDao;
import com.cloud.server.ConfigurationServer;
+import com.cloud.storage.ImageStoreDetailsUtil;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
import com.cloud.user.AccountService;
@@ -98,6 +101,7 @@
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loader = AnnotationConfigContextLoader.class)
+@PrepareForTest({ComponentContext.class, ApplicationContext.class})
public class VmwareDatacenterApiUnitTest {
@Inject
@@ -155,10 +159,6 @@ public class VmwareDatacenterApiUnitTest {
@Mock
private static RemoveVmwareDcCmd removeCmd;
- @BeforeClass
- public static void setUp() throws ConfigurationException {
- }
-
@Before
public void testSetUp() {
Mockito.when(_configDao.isPremium()).thenReturn(true);
@@ -431,6 +431,22 @@ public DataStoreManager dataStoreManager() {
return Mockito.mock(DataStoreManager.class);
}
+ @Bean
+ public ImageStoreDetailsUtil imageStoreDetailsUtil() {
+ return Mockito.mock(ImageStoreDetailsUtil.class);
+ }
+
+ //Mocks for ImageStoreDetailsUtil
+ @Bean
+ public ImageStoreDao imageStoreDao() {
+ return Mockito.mock(ImageStoreDao.class);
+ }
+
+ @Bean
+ public ImageStoreDetailsDao imageStoreDetailsDao() {
+ return Mockito.mock(ImageStoreDetailsDao.class);
+ }
+
public static class Library implements TypeFilter {
@Override
diff --git a/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java b/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
index 2e3d41c0485d..f554da9b3951 100644
--- a/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
+++ b/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
@@ -19,6 +19,12 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.any;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
import org.junit.Before;
import org.junit.Test;
@@ -26,8 +32,9 @@
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
+import com.vmware.vim25.VirtualDevice;
import com.vmware.vim25.VirtualMachineConfigSpec;
-
+import com.vmware.vim25.VirtualMachineVideoCard;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.ScaleVmAnswer;
import com.cloud.agent.api.ScaleVmCommand;
@@ -64,6 +71,10 @@ public VmwareHypervisorHost getHyperHost(VmwareContext context, Command cmd) {
VirtualMachineMO vmMo;
@Mock
VirtualMachineConfigSpec vmConfigSpec;
+ @Mock
+ VirtualMachineMO vmMo3dgpu;
+ @Mock
+ VirtualMachineTO vmSpec3dgpu;
@Before
public void setup() {
@@ -90,4 +101,20 @@ public void testScaleVMF1() throws Exception {
verify(_resource).execute(cmd);
}
+ @Test
+ public void testStartVm3dgpuEnabled() throws Exception{
+ Map specDetails = new HashMap();
+ specDetails.put("svga.vramSize", "131072");
+ when(vmSpec3dgpu.getDetails()).thenReturn(specDetails);
+
+ VirtualMachineVideoCard videoCard = mock(VirtualMachineVideoCard.class);
+ when(videoCard.getVideoRamSizeInKB()).thenReturn(65536l);
+ when(vmMo3dgpu.getAllDeviceList()).thenReturn(Arrays.asList((VirtualDevice) videoCard));
+
+ when(vmMo3dgpu.configureVm(any(VirtualMachineConfigSpec.class))).thenReturn(true);
+
+ _resource.postVideoCardMemoryConfigBeforeStart(vmMo3dgpu, vmSpec3dgpu);
+ verify(vmMo3dgpu).configureVm(any(VirtualMachineConfigSpec.class));
+ }
+
}
diff --git a/plugins/hypervisors/xenserver/pom.xml b/plugins/hypervisors/xenserver/pom.xml
index c66a43f3e232..d03ae541a5c9 100644
--- a/plugins/hypervisors/xenserver/pom.xml
+++ b/plugins/hypervisors/xenserver/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
index 265573d7e4a5..cf2bd76f3cc2 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
@@ -236,4 +236,15 @@ public static String getProductVersion(final Host.Record record) {
}
return prodVersion;
}
+
+ public static String getPVbootloaderArgs(String guestOS) {
+ if (guestOS.startsWith("SUSE Linux Enterprise Server")) {
+ if (guestOS.contains("64-bit")) {
+ return "--kernel /boot/vmlinuz-xen --ramdisk /boot/initrd-xen";
+ } else if (guestOS.contains("32-bit")) {
+ return "--kernel /boot/vmlinuz-xenpae --ramdisk /boot/initrd-xenpae";
+ }
+ }
+ return "";
+ }
}
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index e1f7d3d61e58..665ed77cbb07 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -1352,6 +1352,7 @@ public VM createVmFromTemplate(final Connection conn, final VirtualMachineTO vmS
}
} else if (vmSpec.getBootloader() == BootloaderType.PyGrub) {
vm.setPVBootloader(conn, "pygrub");
+ vm.setPVBootloaderArgs(conn,CitrixHelper.getPVbootloaderArgs(guestOsTypeName));
} else {
vm.destroy(conn);
throw new CloudRuntimeException("Unable to handle boot loader type: " + vmSpec.getBootloader());
@@ -3277,7 +3278,7 @@ public HashMap getVmStats(final Connection conn, final Get
final HashMap vmResponseMap = new HashMap();
for (final String vmUUID : vmUUIDs) {
- vmResponseMap.put(vmUUID, new VmStatsEntry(0, 0, 0, 0, "vm"));
+ vmResponseMap.put(vmUUID, new VmStatsEntry(0,0,0,0, 0, 0, 0, "vm"));
}
final Object[] rrdData = getRRDData(conn, 2); // call rrddata with 2 for
@@ -3331,7 +3332,14 @@ public HashMap getVmStats(final Connection conn, final Get
vmStatsAnswer.setDiskReadKBs(vmStatsAnswer.getDiskReadKBs() + getDataAverage(dataNode, col, numRows) / 1000);
} else if (param.matches("vbd_.*_write")) {
vmStatsAnswer.setDiskWriteKBs(vmStatsAnswer.getDiskWriteKBs() + getDataAverage(dataNode, col, numRows) / 1000);
+ } else if (param.contains("memory_internal_free")) {
+ vmStatsAnswer.setIntFreeMemoryKBs(vmStatsAnswer.getIntFreeMemoryKBs() + getDataAverage(dataNode, col, numRows) / 1024);
+ } else if (param.contains("memory_target")) {
+ vmStatsAnswer.setTargetMemoryKBs(vmStatsAnswer.getTargetMemoryKBs() + getDataAverage(dataNode, col, numRows) / 1024);
+ } else if (param.contains("memory")) {
+ vmStatsAnswer.setMemoryKBs(vmStatsAnswer.getMemoryKBs() + getDataAverage(dataNode, col, numRows) / 1024);
}
+
}
}
@@ -3347,6 +3355,7 @@ public HashMap getVmStats(final Connection conn, final Get
s_logger.debug("Vm cpu utilization " + vmStatsAnswer.getCPUUtilization());
}
}
+
return vmResponseMap;
}
@@ -5393,4 +5402,4 @@ public boolean attachConfigDriveToMigratedVm(Connection conn, String vmName, Str
}
-}
\ No newline at end of file
+}
diff --git a/plugins/hypervisors/xenserver/src/org/apache/cloudstack/storage/motion/XenServerStorageMotionStrategy.java b/plugins/hypervisors/xenserver/src/org/apache/cloudstack/storage/motion/XenServerStorageMotionStrategy.java
index 36b8ad6ccf5b..7de96b0a9e11 100644
--- a/plugins/hypervisors/xenserver/src/org/apache/cloudstack/storage/motion/XenServerStorageMotionStrategy.java
+++ b/plugins/hypervisors/xenserver/src/org/apache/cloudstack/storage/motion/XenServerStorageMotionStrategy.java
@@ -24,9 +24,6 @@
import javax.inject.Inject;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionStrategy;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
@@ -37,6 +34,8 @@
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.to.VolumeObjectTO;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
@@ -92,21 +91,12 @@ public StrategyPriority canHandle(Map volumeMap, Host src
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback callback) {
throw new UnsupportedOperationException();
}
@Override
- public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) {
- CopyCommandResult result = new CopyCommandResult(null, null);
- result.setResult("Unsupported operation requested for copying data.");
- callback.complete(result);
-
- return null;
- }
-
- @Override
- public Void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
+ public void copyAsync(Map volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback callback) {
Answer answer = null;
String errMsg = null;
try {
@@ -128,7 +118,6 @@ public Void copyAsync(Map volumeMap, VirtualMachineTO vmT
CopyCommandResult result = new CopyCommandResult(null, answer);
result.setResult(errMsg);
callback.complete(result);
- return null;
}
private Answer migrateVmWithVolumesAcrossCluster(VMInstanceVO vm, VirtualMachineTO to, Host srcHost, Host destHost, Map volumeToPool)
diff --git a/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/CitrixHelperTest.java b/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/CitrixHelperTest.java
new file mode 100644
index 000000000000..330106e59a90
--- /dev/null
+++ b/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/CitrixHelperTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2015 The Apache Software Foundation.
+ *
+ * Licensed 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.hypervisor.xenserver.resource;
+
+import junit.framework.Assert;
+import org.junit.Test;
+
+
+/**
+ * Created by ajna123 on 12/11/2015.
+ */
+public class CitrixHelperTest {
+
+ @Test
+ public void testGetPVbootloaderArgs() throws Exception {
+
+ String os_name_Suse10Sp2_64 = "SUSE Linux Enterprise Server 10 SP2 (64-bit)";
+ String os_name_Suse10Sp2_32 = "SUSE Linux Enterprise Server 10 SP2 (32-bit)";
+ String os_name_Suse11Sp3_64 = "SUSE Linux Enterprise Server 11 SP3 (64-bit)";
+ String os_name_Suse11Sp3_32 = "SUSE Linux Enterprise Server 11 SP3 (32-bit)";
+
+ String os_name_Windows8_64 = "Windows 8 (64-bit)";
+ String os_name_Windows8_32 = "Windows 8 (32-bit)";
+
+ String pvBootLoaderArgs_32 = "--kernel /boot/vmlinuz-xenpae --ramdisk /boot/initrd-xenpae";
+ String pvBootLoaderArgs_64 = "--kernel /boot/vmlinuz-xen --ramdisk /boot/initrd-xen";
+
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse10Sp2_32), pvBootLoaderArgs_32);
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse10Sp2_64),pvBootLoaderArgs_64);
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse11Sp3_32),pvBootLoaderArgs_32);
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse11Sp3_64),pvBootLoaderArgs_64);
+
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Windows8_32),"");
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Windows8_64),"");
+ }
+}
\ No newline at end of file
diff --git a/plugins/network-elements/bigswitch/pom.xml b/plugins/network-elements/bigswitch/pom.xml
index 4b7c804c77ad..05603a61fd09 100644
--- a/plugins/network-elements/bigswitch/pom.xml
+++ b/plugins/network-elements/bigswitch/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/brocade-vcs/pom.xml b/plugins/network-elements/brocade-vcs/pom.xml
index 481493c97a09..c0ed17c1449c 100644
--- a/plugins/network-elements/brocade-vcs/pom.xml
+++ b/plugins/network-elements/brocade-vcs/pom.xml
@@ -16,7 +16,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/cisco-vnmc/pom.xml b/plugins/network-elements/cisco-vnmc/pom.xml
index d4332c099be1..2c8bb7f7194b 100644
--- a/plugins/network-elements/cisco-vnmc/pom.xml
+++ b/plugins/network-elements/cisco-vnmc/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/dns-notifier/pom.xml b/plugins/network-elements/dns-notifier/pom.xml
index cb2d0464d82b..7db075f0aaff 100644
--- a/plugins/network-elements/dns-notifier/pom.xml
+++ b/plugins/network-elements/dns-notifier/pom.xml
@@ -22,7 +22,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
cloud-plugin-example-dns-notifier
diff --git a/plugins/network-elements/elastic-loadbalancer/pom.xml b/plugins/network-elements/elastic-loadbalancer/pom.xml
index 391e0597b6c1..c52cc042debe 100644
--- a/plugins/network-elements/elastic-loadbalancer/pom.xml
+++ b/plugins/network-elements/elastic-loadbalancer/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/f5/pom.xml b/plugins/network-elements/f5/pom.xml
index e4f257d529c0..54533e7aa76d 100644
--- a/plugins/network-elements/f5/pom.xml
+++ b/plugins/network-elements/f5/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/globodns/pom.xml b/plugins/network-elements/globodns/pom.xml
index d7747420f98e..9e177a53d684 100644
--- a/plugins/network-elements/globodns/pom.xml
+++ b/plugins/network-elements/globodns/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/internal-loadbalancer/pom.xml b/plugins/network-elements/internal-loadbalancer/pom.xml
index 7b7879abf233..0eb15232540b 100644
--- a/plugins/network-elements/internal-loadbalancer/pom.xml
+++ b/plugins/network-elements/internal-loadbalancer/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/juniper-contrail/pom.xml b/plugins/network-elements/juniper-contrail/pom.xml
index 710579bb2aab..cac4d593d523 100644
--- a/plugins/network-elements/juniper-contrail/pom.xml
+++ b/plugins/network-elements/juniper-contrail/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/juniper-srx/pom.xml b/plugins/network-elements/juniper-srx/pom.xml
index 0a432f3108a2..ba3ecd7a95d6 100644
--- a/plugins/network-elements/juniper-srx/pom.xml
+++ b/plugins/network-elements/juniper-srx/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/midonet/pom.xml b/plugins/network-elements/midonet/pom.xml
index b586ea4ea524..00ca4aef7c18 100644
--- a/plugins/network-elements/midonet/pom.xml
+++ b/plugins/network-elements/midonet/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/netscaler/pom.xml b/plugins/network-elements/netscaler/pom.xml
index 11f10673a462..2475c413636e 100644
--- a/plugins/network-elements/netscaler/pom.xml
+++ b/plugins/network-elements/netscaler/pom.xml
@@ -23,7 +23,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/network-elements/nicira-nvp/pom.xml b/plugins/network-elements/nicira-nvp/pom.xml
index 38fc3a9add43..7ed0f235d6c0 100644
--- a/plugins/network-elements/nicira-nvp/pom.xml
+++ b/plugins/network-elements/nicira-nvp/pom.xml
@@ -26,7 +26,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
../../pom.xml
@@ -34,7 +34,7 @@
org.apache.cloudstack
cloud-utils
- 4.7.2-SNAPSHOT
+ 4.9.0-SNAPSHOT
test-jar
test
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkUuidAnswer.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkUuidAnswer.java
new file mode 100644
index 000000000000..46fc8f5476db
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkUuidAnswer.java
@@ -0,0 +1,32 @@
+//
+// 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.agent.api;
+
+public class ConfigureSharedNetworkUuidAnswer extends Answer {
+
+ public ConfigureSharedNetworkUuidAnswer(final Command command, final boolean success, final String details) {
+ super(command, success, details);
+ }
+
+ public ConfigureSharedNetworkUuidAnswer(final Command command, final Exception e) {
+ super(command, e);
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkUuidCommand.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkUuidCommand.java
new file mode 100644
index 000000000000..4dd361b6b0d2
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkUuidCommand.java
@@ -0,0 +1,85 @@
+//
+// 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.agent.api;
+
+public class ConfigureSharedNetworkUuidCommand extends Command {
+
+ private String logicalRouterUuid;
+ private String logicalSwitchUuid;
+ private String portIpAddress;
+ private String ownerName;
+ private long networkId;
+
+ public ConfigureSharedNetworkUuidCommand(final String logicalRouterUuid, final String logicalSwitchUuid,
+ final String portIpAddress, final String ownerName, final long networkId) {
+ super();
+ this.logicalRouterUuid = logicalRouterUuid;
+ this.logicalSwitchUuid = logicalSwitchUuid;
+ this.portIpAddress = portIpAddress;
+ this.ownerName = ownerName;
+ this.networkId = networkId;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ public String getLogicalRouterUuid() {
+ return logicalRouterUuid;
+ }
+
+ public void setLogicalRouterUuid(String logicalRouterUuid) {
+ this.logicalRouterUuid = logicalRouterUuid;
+ }
+
+ public String getLogicalSwitchUuid() {
+ return logicalSwitchUuid;
+ }
+
+ public void setLogicalSwitchUuid(String logicalSwitchUuid) {
+ this.logicalSwitchUuid = logicalSwitchUuid;
+ }
+
+ public String getPortIpAddress() {
+ return portIpAddress;
+ }
+
+ public void setPortIpAddress(String portIpAddress) {
+ this.portIpAddress = portIpAddress;
+ }
+
+ public String getOwnerName() {
+ return ownerName;
+ }
+
+ public void setOwnerName(String ownerName) {
+ this.ownerName = ownerName;
+ }
+
+ public long getNetworkId() {
+ return networkId;
+ }
+
+ public void setNetworkId(long networkId) {
+ this.networkId = networkId;
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkVlanIdAnswer.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkVlanIdAnswer.java
new file mode 100644
index 000000000000..12955693b454
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkVlanIdAnswer.java
@@ -0,0 +1,31 @@
+//
+// 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.agent.api;
+
+public class ConfigureSharedNetworkVlanIdAnswer extends Answer {
+
+ public ConfigureSharedNetworkVlanIdAnswer(final Command command, final boolean success, final String details) {
+ super(command, success, details);
+ }
+
+ public ConfigureSharedNetworkVlanIdAnswer(final Command command, final Exception e) {
+ super(command, e);
+ }
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkVlanIdCommand.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkVlanIdCommand.java
new file mode 100644
index 000000000000..c6837dd1b09b
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/ConfigureSharedNetworkVlanIdCommand.java
@@ -0,0 +1,84 @@
+//
+// 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.agent.api;
+
+public class ConfigureSharedNetworkVlanIdCommand extends Command {
+
+ private String logicalSwitchUuid;
+ private String l2GatewayServiceUuid;
+ private long vlanId;
+ private String ownerName;
+ private long networkId;
+
+ public ConfigureSharedNetworkVlanIdCommand(final String logicalSwitchUuid, final String l2GatewayServiceUuid,
+ final long vlanId, final String ownerName, final long networkId) {
+ this.logicalSwitchUuid = logicalSwitchUuid;
+ this.l2GatewayServiceUuid = l2GatewayServiceUuid;
+ this.vlanId = vlanId;
+ this.ownerName = ownerName;
+ this.networkId = networkId;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ public String getLogicalSwitchUuid() {
+ return logicalSwitchUuid;
+ }
+
+ public void setLogicalSwitchUuid(String logicalSwitchUuid) {
+ this.logicalSwitchUuid = logicalSwitchUuid;
+ }
+
+ public String getL2GatewayServiceUuid() {
+ return l2GatewayServiceUuid;
+ }
+
+ public void setL2GatewayServiceUuid(String l2GatewayServiceUuid) {
+ this.l2GatewayServiceUuid = l2GatewayServiceUuid;
+ }
+
+ public long getVlanId() {
+ return vlanId;
+ }
+
+ public void setVlanId(long vlanId) {
+ this.vlanId = vlanId;
+ }
+
+ public String getOwnerName() {
+ return ownerName;
+ }
+
+ public void setOwnerName(String ownerName) {
+ this.ownerName = ownerName;
+ }
+
+ public long getNetworkId() {
+ return networkId;
+ }
+
+ public void setNetworkId(long networkId) {
+ this.networkId = networkId;
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/DeleteLogicalRouterPortAnswer.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/DeleteLogicalRouterPortAnswer.java
new file mode 100644
index 000000000000..2850047aedad
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/DeleteLogicalRouterPortAnswer.java
@@ -0,0 +1,31 @@
+//
+// 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.agent.api;
+
+public class DeleteLogicalRouterPortAnswer extends Answer {
+
+ public DeleteLogicalRouterPortAnswer(final Command command, final boolean success, final String details) {
+ super(command, success, details);
+ }
+
+ public DeleteLogicalRouterPortAnswer(final Command command, final Exception e) {
+ super(command, e);
+ }
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/DeleteLogicalRouterPortCommand.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/DeleteLogicalRouterPortCommand.java
new file mode 100644
index 000000000000..729535831f31
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/DeleteLogicalRouterPortCommand.java
@@ -0,0 +1,53 @@
+//
+// 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.agent.api;
+
+public class DeleteLogicalRouterPortCommand extends Command {
+
+ private String logicalRouterUuid;
+ private String logicalRouterPortUuid;
+
+ public DeleteLogicalRouterPortCommand(String logicalRouterUuid, String logicalRouterPortUuid) {
+ this.logicalRouterUuid = logicalRouterUuid;
+ this.logicalRouterPortUuid = logicalRouterPortUuid;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ public String getLogicalRouterUuid() {
+ return logicalRouterUuid;
+ }
+
+ public void setLogicalRouterUuid(String logicalRouterUuid) {
+ this.logicalRouterUuid = logicalRouterUuid;
+ }
+
+ public String getLogicalRouterPortUuid() {
+ return logicalRouterPortUuid;
+ }
+
+ public void setLogicalRouterPortUuid(String logicalRouterPortUuid) {
+ this.logicalRouterPortUuid = logicalRouterPortUuid;
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindL2GatewayServiceAnswer.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindL2GatewayServiceAnswer.java
new file mode 100644
index 000000000000..16f24eb7e198
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindL2GatewayServiceAnswer.java
@@ -0,0 +1,38 @@
+//
+// 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.agent.api;
+
+public class FindL2GatewayServiceAnswer extends Answer {
+
+ private String gatewayServiceUuid;
+
+ public FindL2GatewayServiceAnswer(final Command command, final boolean success, final String details, final String gatewayServiceUuid) {
+ super(command, success, details);
+ this.gatewayServiceUuid = gatewayServiceUuid;
+ }
+
+ public FindL2GatewayServiceAnswer(final Command command, final Exception e) {
+ super(command, e);
+ }
+
+ public String getGatewayServiceUuid() {
+ return gatewayServiceUuid;
+ }
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindL2GatewayServiceCommand.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindL2GatewayServiceCommand.java
new file mode 100644
index 000000000000..a3ec1dcc18f4
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindL2GatewayServiceCommand.java
@@ -0,0 +1,46 @@
+//
+// 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.agent.api;
+
+import com.cloud.network.nicira.GatewayServiceConfig;
+import com.cloud.network.nicira.L2GatewayServiceConfig;
+
+public class FindL2GatewayServiceCommand extends Command {
+
+ private L2GatewayServiceConfig gatewayServiceConfig;
+
+ public FindL2GatewayServiceCommand(L2GatewayServiceConfig config) {
+ this.gatewayServiceConfig = config;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ public GatewayServiceConfig getGatewayServiceConfig() {
+ return gatewayServiceConfig;
+ }
+
+ public void setGatewayServiceConfig(L2GatewayServiceConfig gatewayServiceConfig) {
+ this.gatewayServiceConfig = gatewayServiceConfig;
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindLogicalRouterPortAnswer.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindLogicalRouterPortAnswer.java
new file mode 100644
index 000000000000..2ec211b41324
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindLogicalRouterPortAnswer.java
@@ -0,0 +1,38 @@
+//
+// 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.agent.api;
+
+public class FindLogicalRouterPortAnswer extends Answer {
+
+ private String logicalRouterPortUuid;
+
+ public FindLogicalRouterPortAnswer(final Command command, final boolean success, final String details, final String lRouterPortUuid) {
+ super(command, success, details);
+ this.logicalRouterPortUuid = lRouterPortUuid;
+ }
+
+ public FindLogicalRouterPortAnswer(final Command command, final Exception e) {
+ super(command, e);
+ }
+
+ public String getLogicalRouterPortUuid() {
+ return logicalRouterPortUuid;
+ }
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindLogicalRouterPortCommand.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindLogicalRouterPortCommand.java
new file mode 100644
index 000000000000..965f65b8c137
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/agent/api/FindLogicalRouterPortCommand.java
@@ -0,0 +1,59 @@
+//
+// 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.agent.api;
+
+public class FindLogicalRouterPortCommand extends Command {
+
+ private String logicalRouterUuid;
+ private String attachmentLswitchUuid;
+
+ public FindLogicalRouterPortCommand(String logicalRouterUuid) {
+ super();
+ this.logicalRouterUuid = logicalRouterUuid;
+ }
+
+ public FindLogicalRouterPortCommand(String logicalRouterUuid, String attachmentLswitchUuid) {
+ super();
+ this.logicalRouterUuid = logicalRouterUuid;
+ this.attachmentLswitchUuid = attachmentLswitchUuid;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ public String getLogicalRouterUuid() {
+ return logicalRouterUuid;
+ }
+
+ public void setLogicalRouterUuid(String logicalRouterUuid) {
+ this.logicalRouterUuid = logicalRouterUuid;
+ }
+
+ public String getAttachmentLswitchUuid() {
+ return attachmentLswitchUuid;
+ }
+
+ public void setAttachmentLswitchUuid(String attachmentLswitchUuid) {
+ this.attachmentLswitchUuid = attachmentLswitchUuid;
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java
index 1a9be2854c31..1bde3b736098 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java
@@ -80,6 +80,12 @@ public class AddNiciraNvpDeviceCmd extends BaseAsyncCmd {
description = "The L3 Gateway Service UUID configured on the Nicira Controller")
private String l3gatewayserviceuuid;
+ @Parameter(name = ApiConstants.NICIRA_NVP_L2_GATEWAYSERVICE_UUID,
+ type = CommandType.STRING,
+ required = false,
+ description = "The L2 Gateway Service UUID configured on the Nicira Controller")
+ private String l2gatewayserviceuuid;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -108,6 +114,10 @@ public String getL3GatewayServiceUuid() {
return l3gatewayserviceuuid;
}
+ public String getL2GatewayServiceUuid() {
+ return l2gatewayserviceuuid;
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java
index 46287aa1f093..dedccefcc919 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java
@@ -58,6 +58,10 @@ public class NiciraNvpDeviceResponse extends BaseResponse {
@Param(description = "this L3 gateway service Uuid")
private String l3GatewayServiceUuid;
+ @SerializedName(ApiConstants.NICIRA_NVP_L2_GATEWAYSERVICE_UUID)
+ @Param(description = "this L2 gateway service Uuid")
+ private String l2GatewayServiceUuid;
+
public void setId(String nvpDeviceId) {
this.id = nvpDeviceId;
}
@@ -86,4 +90,7 @@ public void setL3GatewayServiceUuid(final String l3GatewayServiceUuid) {
this.l3GatewayServiceUuid = l3GatewayServiceUuid;
}
+ public void setL2GatewayServiceUuid(final String l2GatewayServiceUuid) {
+ this.l2GatewayServiceUuid = l2GatewayServiceUuid;
+ }
}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDao.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDao.java
index b64fb90b9a5a..b7e999b30b76 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDao.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDao.java
@@ -25,4 +25,6 @@
public interface NiciraNvpRouterMappingDao extends GenericDao {
public NiciraNvpRouterMappingVO findByNetworkId(long id);
+
+ public boolean existsMappingForNetworkId(long id);
}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDaoImpl.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDaoImpl.java
index 239072f885f7..ef6acb40df96 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDaoImpl.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/dao/NiciraNvpRouterMappingDaoImpl.java
@@ -19,6 +19,7 @@
package com.cloud.network.dao;
+import java.util.List;
import org.springframework.stereotype.Component;
@@ -46,4 +47,12 @@ public NiciraNvpRouterMappingVO findByNetworkId(final long id) {
return findOneBy(sc);
}
+ @Override
+ public boolean existsMappingForNetworkId(long id) {
+ SearchCriteria sc = networkSearch.create();
+ sc.setParameters("network_id", id);
+ List mappings = search(sc, null);
+ return mappings.size() > 0;
+ }
+
}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/element/NiciraNvpElement.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/element/NiciraNvpElement.java
index 909134dbb649..1146a5435ca4 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/element/NiciraNvpElement.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/element/NiciraNvpElement.java
@@ -33,7 +33,6 @@
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
-
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
@@ -42,6 +41,10 @@
import com.cloud.agent.api.ConfigurePortForwardingRulesOnLogicalRouterCommand;
import com.cloud.agent.api.ConfigurePublicIpsOnLogicalRouterAnswer;
import com.cloud.agent.api.ConfigurePublicIpsOnLogicalRouterCommand;
+import com.cloud.agent.api.ConfigureSharedNetworkUuidAnswer;
+import com.cloud.agent.api.ConfigureSharedNetworkUuidCommand;
+import com.cloud.agent.api.ConfigureSharedNetworkVlanIdAnswer;
+import com.cloud.agent.api.ConfigureSharedNetworkVlanIdCommand;
import com.cloud.agent.api.ConfigureStaticNatRulesOnLogicalRouterAnswer;
import com.cloud.agent.api.ConfigureStaticNatRulesOnLogicalRouterCommand;
import com.cloud.agent.api.CreateLogicalRouterAnswer;
@@ -67,6 +70,7 @@
import com.cloud.api.response.NiciraNvpDeviceResponse;
import com.cloud.configuration.ConfigurationManager;
import com.cloud.dc.Vlan;
+import com.cloud.dc.VlanVO;
import com.cloud.dc.dao.VlanDao;
import com.cloud.deploy.DeployDestination;
import com.cloud.exception.ConcurrentOperationException;
@@ -82,6 +86,7 @@
import com.cloud.network.IpAddressManager;
import com.cloud.network.Network;
import com.cloud.network.Network.Capability;
+import com.cloud.network.Network.GuestType;
import com.cloud.network.Network.Provider;
import com.cloud.network.Network.Service;
import com.cloud.network.NetworkModel;
@@ -239,8 +244,14 @@ public boolean implement(Network network, NetworkOffering offering, DeployDestin
* multiple operations that should be done only once.
*/
- // Implement SourceNat immediately as we have al the info already
- if (networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.SourceNat, Provider.NiciraNvp)) {
+ if (network.getGuestType().equals(GuestType.Shared)){
+ //Support Shared Networks
+ String lSwitchUuid = BroadcastDomainType.getValue(network.getBroadcastUri());
+ String ownerName = context.getDomain().getName() + "-" + context.getAccount().getAccountName();
+ return sharedNetworkSupport(network, lSwitchUuid, ownerName, niciraNvpHost);
+ }
+ else if (network.getGuestType().equals(GuestType.Isolated) && networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.SourceNat, Provider.NiciraNvp)) {
+ // Implement SourceNat immediately as we have al the info already
s_logger.debug("Apparently we are supposed to provide SourceNat on this network");
PublicIp sourceNatIp = ipAddrMgr.assignSourceNatIpAddressToGuestNetwork(owner, network);
@@ -271,14 +282,74 @@ public boolean implement(Network network, NetworkOffering offering, DeployDestin
return false;
}
- // Store the uuid so we can easily find it during cleanup
NiciraNvpRouterMappingVO routermapping = new NiciraNvpRouterMappingVO(answer.getLogicalRouterUuid(), network.getId());
niciraNvpRouterMappingDao.persist(routermapping);
+
+ }
+
+ return true;
+ }
+
+ private boolean sharedNetworkSupport(Network network, String lSwitchUuid, String ownerName, HostVO niciraNvpHost) {
+ //Support Shared Networks, we won’t be creating logical router, 2 cases:
+ //Case 1) UUID Supplied for VLAN -> This is UUID of the logical router to attach lswitch
+ //Case 2) Numerical ID supplied for VLAN -> lswitch is connected to L2 gateway service that we have as an attribute of the NVP device. If no L2 gateway attribute exists then exception.
+
+ if (niciraNvpRouterMappingDao.existsMappingForNetworkId(network.getId())){
+ //Case 1)
+ return sharedNetworkSupportUUIDVlanId(network, lSwitchUuid, ownerName, niciraNvpHost);
+ }
+ else {
+ //Case 2)
+ return sharedNetworkSupportNumericalVlanId(network, lSwitchUuid, ownerName, niciraNvpHost);
+ }
+ }
+
+ private boolean sharedNetworkSupportUUIDVlanId(Network network, String lSwitchUuid, String ownerName, HostVO niciraNvpHost) {
+ String networkCidr = network.getCidr();
+ String vlanGateway = network.getGateway();
+ String portIpAddress = createLogicalRouterPortIpAddress(networkCidr, vlanGateway);
+ NiciraNvpRouterMappingVO mapRouterNetwork = niciraNvpRouterMappingDao.findByNetworkId(network.getId());
+ String lRouterUuid = mapRouterNetwork.getLogicalRouterUuid();
+ ConfigureSharedNetworkUuidCommand cmd =
+ new ConfigureSharedNetworkUuidCommand(lRouterUuid, lSwitchUuid, portIpAddress, ownerName, network.getId());
+ ConfigureSharedNetworkUuidAnswer answer = (ConfigureSharedNetworkUuidAnswer)agentMgr.easySend(niciraNvpHost.getId(), cmd);
+ if (answer.getResult() == false) {
+ s_logger.error("Failed to configure Logical Router for Shared network " + network.getDisplayText());
+ return false;
}
+ return true;
+ }
+ private boolean sharedNetworkSupportNumericalVlanId(Network network, String lSwitchUuid, String ownerName, HostVO niciraNvpHost) {
+ List networkVlans = vlanDao.listVlansByNetworkId(network.getId());
+ if (networkVlans.size() == 1){
+ for (VlanVO vlanVO : networkVlans) {
+ long vlanId = Long.parseLong(vlanVO.getVlanTag());
+ String l2GatewayServiceUuid = niciraNvpHost.getDetail("l2gatewayserviceuuid");
+ if (l2GatewayServiceUuid == null){
+ throw new CloudRuntimeException("No L2 Gateway Service Uuid found on " + niciraNvpHost.getName());
+ }
+ ConfigureSharedNetworkVlanIdCommand cmd =
+ new ConfigureSharedNetworkVlanIdCommand(lSwitchUuid, l2GatewayServiceUuid , vlanId, ownerName, network.getId());
+ ConfigureSharedNetworkVlanIdAnswer answer = (ConfigureSharedNetworkVlanIdAnswer)agentMgr.easySend(niciraNvpHost.getId(), cmd);
+ if (answer.getResult() == false) {
+ s_logger.error("Failed to configure Shared network " + network.getDisplayText());
+ return false;
+ }
+ }
+ }
return true;
}
+
+ private String createLogicalRouterPortIpAddress(String networkCidr, String vlanGateway) {
+ if (networkCidr != null && vlanGateway != null){
+ return networkCidr.replaceFirst("[\\d]{1,3}.[\\d]{1,3}.[\\d]{1,3}.[\\d]{1,3}", vlanGateway);
+ }
+ return null;
+ }
+
@Override
public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
@@ -393,7 +464,8 @@ public boolean shutdown(Network network, ReservationContext context, boolean cle
NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
HostVO niciraNvpHost = hostDao.findById(niciraNvpDevice.getHostId());
- if (networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.SourceNat, Provider.NiciraNvp)) {
+ //Dont destroy logical router when removing Shared Networks
+ if (! network.getGuestType().equals(GuestType.Shared) && networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.SourceNat, Provider.NiciraNvp)) {
s_logger.debug("Apparently we were providing SourceNat on this network");
// Deleting the LogicalRouter will also take care of all provisioned
@@ -537,6 +609,9 @@ public NiciraNvpDeviceVO addNiciraNvpDevice(AddNiciraNvpDeviceCmd cmd) {
if (cmd.getL3GatewayServiceUuid() != null) {
params.put("l3gatewayserviceuuid", cmd.getL3GatewayServiceUuid());
}
+ if (cmd.getL2GatewayServiceUuid() != null) {
+ params.put("l2gatewayserviceuuid", cmd.getL2GatewayServiceUuid());
+ }
Map hostdetails = new HashMap();
hostdetails.putAll(params);
@@ -582,6 +657,7 @@ public NiciraNvpDeviceResponse createNiciraNvpDeviceResponse(NiciraNvpDeviceVO n
response.setHostName(niciraNvpHost.getDetail("ip"));
response.setTransportZoneUuid(niciraNvpHost.getDetail("transportzoneuuid"));
response.setL3GatewayServiceUuid(niciraNvpHost.getDetail("l3gatewayserviceuuid"));
+ response.setL2GatewayServiceUuid(niciraNvpHost.getDetail("l2gatewayserviceuuid"));
response.setObjectName("niciranvpdevice");
return response;
}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
index fc41286f0c84..551269cc84c4 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
@@ -21,7 +21,9 @@
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.inject.Inject;
@@ -30,8 +32,14 @@
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.CreateLogicalSwitchAnswer;
import com.cloud.agent.api.CreateLogicalSwitchCommand;
+import com.cloud.agent.api.DeleteLogicalRouterPortAnswer;
+import com.cloud.agent.api.DeleteLogicalRouterPortCommand;
import com.cloud.agent.api.DeleteLogicalSwitchAnswer;
import com.cloud.agent.api.DeleteLogicalSwitchCommand;
+import com.cloud.agent.api.FindL2GatewayServiceAnswer;
+import com.cloud.agent.api.FindL2GatewayServiceCommand;
+import com.cloud.agent.api.FindLogicalRouterPortAnswer;
+import com.cloud.agent.api.FindLogicalRouterPortCommand;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.dc.dao.DataCenterDao;
@@ -50,13 +58,18 @@
import com.cloud.network.NetworkProfile;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.NiciraNvpDeviceVO;
+import com.cloud.network.NiciraNvpNicMappingVO;
+import com.cloud.network.NiciraNvpRouterMappingVO;
import com.cloud.network.PhysicalNetwork;
import com.cloud.network.PhysicalNetwork.IsolationMethod;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.NetworkVO;
import com.cloud.network.dao.NiciraNvpDao;
+import com.cloud.network.dao.NiciraNvpNicMappingDao;
+import com.cloud.network.dao.NiciraNvpRouterMappingDao;
import com.cloud.network.dao.PhysicalNetworkDao;
import com.cloud.network.dao.PhysicalNetworkVO;
+import com.cloud.network.nicira.L2GatewayServiceConfig;
import com.cloud.offering.NetworkOffering;
import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
import com.cloud.resource.ResourceManager;
@@ -66,7 +79,7 @@
import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachineProfile;
-public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru {
+public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru implements NetworkGuruAdditionalFunctions{
private static final int MAX_NAME_LENGTH = 40;
private static final Logger s_logger = Logger.getLogger(NiciraNvpGuestNetworkGuru.class);
@@ -93,6 +106,10 @@ public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru {
protected HostDetailsDao hostDetailsDao;
@Inject
protected NetworkOfferingServiceMapDao ntwkOfferingSrvcDao;
+ @Inject
+ protected NiciraNvpRouterMappingDao niciraNvpRouterMappingDao;
+ @Inject
+ protected NiciraNvpNicMappingDao niciraNvpNicMappingDao;
public NiciraNvpGuestNetworkGuru() {
super();
@@ -102,15 +119,24 @@ public NiciraNvpGuestNetworkGuru() {
@Override
protected boolean canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork) {
// This guru handles only Guest Isolated network that supports Source nat service
- if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && offering.getGuestType() == Network.GuestType.Isolated
+ if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType())
+ && supportedGuestTypes(offering, Network.GuestType.Isolated, Network.GuestType.Shared)
&& isMyIsolationMethod(physicalNetwork) && ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Connectivity)) {
return true;
} else {
- s_logger.trace("We only take care of Guest networks of type " + GuestType.Isolated + " in zone of type " + NetworkType.Advanced);
return false;
}
}
+ private boolean supportedGuestTypes(NetworkOffering offering, GuestType... types) {
+ for (GuestType guestType : types) {
+ if (offering.getGuestType().equals(guestType)){
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
public Network design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner) {
// Check of the isolation type of the related physical network is supported
@@ -134,6 +160,9 @@ public Network design(final NetworkOffering offering, final DeploymentPlan plan,
return null;
}
networkObject.setBroadcastDomainType(BroadcastDomainType.Lswitch);
+ if (offering.getGuestType().equals(GuestType.Shared)){
+ networkObject.setState(State.Allocated);
+ }
return networkObject;
}
@@ -183,6 +212,16 @@ public Network implement(final Network network, final NetworkOffering offering,
final String transportzoneuuid = niciraNvpHost.getDetail("transportzoneuuid");
final String transportzoneisotype = niciraNvpHost.getDetail("transportzoneisotype");
+ if (offering.getGuestType().equals(GuestType.Shared)) {
+ try {
+ checkL2GatewayServiceSharedNetwork(niciraNvpHost);
+ }
+ catch (Exception e){
+ s_logger.error("L2 Gateway Service Issue: " + e.getMessage());
+ return null;
+ }
+ }
+
final CreateLogicalSwitchCommand cmd = new CreateLogicalSwitchCommand(transportzoneuuid, transportzoneisotype, name, context.getDomain().getName() + "-"
+ context.getAccount().getAccountName());
final CreateLogicalSwitchAnswer answer = (CreateLogicalSwitchAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmd);
@@ -204,6 +243,26 @@ public Network implement(final Network network, final NetworkOffering offering,
return implemented;
}
+ private void checkL2GatewayServiceSharedNetwork(HostVO niciraNvpHost) throws Exception {
+ String l2GatewayServiceUuid = niciraNvpHost.getDetail("l2gatewayserviceuuid");
+ if (l2GatewayServiceUuid == null){
+ throw new Exception("No L2 Gateway Service found");
+ }
+ else {
+ final FindL2GatewayServiceCommand cmdL2GWService = new FindL2GatewayServiceCommand(new L2GatewayServiceConfig(l2GatewayServiceUuid));
+ final FindL2GatewayServiceAnswer answerL2GWService = (FindL2GatewayServiceAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmdL2GWService);
+ if (answerL2GWService == null || !answerL2GWService.getResult()){
+ throw new Exception("No L2 Gateway Service found with uuid " + l2GatewayServiceUuid);
+ }
+ else {
+ String uuidFound = answerL2GWService.getGatewayServiceUuid();
+ if (! uuidFound.equals(l2GatewayServiceUuid)){
+ throw new Exception("Found L2 Gateway Service " + uuidFound + " instead of " + l2GatewayServiceUuid);
+ }
+ }
+ }
+ }
+
@Override
public void reserve(final NicProfile nic, final Network network, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
throws InsufficientVirtualNetworkCapacityException, InsufficientAddressCapacityException {
@@ -231,7 +290,13 @@ public void shutdown(final NetworkProfile profile, final NetworkOffering offerin
final NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
final HostVO niciraNvpHost = hostDao.findById(niciraNvpDevice.getHostId());
- final DeleteLogicalSwitchCommand cmd = new DeleteLogicalSwitchCommand(BroadcastDomainType.getValue(networkObject.getBroadcastUri()));
+ String logicalSwitchUuid = BroadcastDomainType.getValue(networkObject.getBroadcastUri());
+
+ if (offering.getGuestType().equals(GuestType.Shared)){
+ sharedNetworksCleanup(networkObject, logicalSwitchUuid, niciraNvpHost);
+ }
+
+ final DeleteLogicalSwitchCommand cmd = new DeleteLogicalSwitchCommand(logicalSwitchUuid);
final DeleteLogicalSwitchAnswer answer = (DeleteLogicalSwitchAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmd);
if (answer == null || !answer.getResult()) {
@@ -241,9 +306,65 @@ public void shutdown(final NetworkProfile profile, final NetworkOffering offerin
super.shutdown(profile, offering);
}
+ private void sharedNetworksCleanup(NetworkVO networkObject, String logicalSwitchUuid, HostVO niciraNvpHost) {
+ NiciraNvpRouterMappingVO routermapping = niciraNvpRouterMappingDao.findByNetworkId(networkObject.getId());
+ if (routermapping == null) {
+ // Case 1: Numerical Vlan Provided -> No lrouter used.
+ s_logger.info("Shared Network " + networkObject.getDisplayText() + " didn't use Logical Router");
+ }
+ else {
+ //Case 2: Logical Router's UUID provided as Vlan id -> Remove lrouter port but not lrouter.
+ String lRouterUuid = routermapping.getLogicalRouterUuid();
+ s_logger.debug("Finding Logical Router Port on Logical Router " + lRouterUuid + " with attachment_lswitch_uuid=" + logicalSwitchUuid + " to delete it");
+ final FindLogicalRouterPortCommand cmd = new FindLogicalRouterPortCommand(lRouterUuid, logicalSwitchUuid);
+ final FindLogicalRouterPortAnswer answer = (FindLogicalRouterPortAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmd);
+
+ if (answer != null && answer.getResult()) {
+ String logicalRouterPortUuid = answer.getLogicalRouterPortUuid();
+ s_logger.debug("Found Logical Router Port " + logicalRouterPortUuid + ", deleting it");
+ final DeleteLogicalRouterPortCommand cmdDeletePort = new DeleteLogicalRouterPortCommand(lRouterUuid, logicalRouterPortUuid);
+ final DeleteLogicalRouterPortAnswer answerDelete = (DeleteLogicalRouterPortAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmdDeletePort);
+
+ if (answerDelete != null && answerDelete.getResult()){
+ s_logger.info("Successfully deleted Logical Router Port " + logicalRouterPortUuid);
+ }
+ else {
+ s_logger.error("Could not delete Logical Router Port " + logicalRouterPortUuid);
+ }
+ }
+ else {
+ s_logger.error("Find Logical Router Port failed");
+ }
+ }
+ }
+
@Override
public boolean trash(final Network network, final NetworkOffering offering) {
+ //Since NVP Plugin supports Shared networks, remove mapping when deleting network implemented or allocated
+ if (network.getGuestType() == GuestType.Shared && niciraNvpRouterMappingDao.existsMappingForNetworkId(network.getId())){
+ NiciraNvpRouterMappingVO mappingVO = niciraNvpRouterMappingDao.findByNetworkId(network.getId());
+ niciraNvpRouterMappingDao.remove(mappingVO.getId());
+ }
return super.trash(network, offering);
}
+ @Override
+ public void finalizeNetworkDesign(long networkId, String vlanIdAsUUID) {
+ if (vlanIdAsUUID == null) return;
+ NiciraNvpRouterMappingVO routermapping = new NiciraNvpRouterMappingVO(vlanIdAsUUID, networkId);
+ niciraNvpRouterMappingDao.persist(routermapping);
+ }
+
+ @Override
+ public Map listAdditionalNicParams(String nicUuid) {
+ NiciraNvpNicMappingVO mapping = niciraNvpNicMappingDao.findByNicUuid(nicUuid);
+ if (mapping != null){
+ Map result = new HashMap();
+ result.put(NetworkGuruAdditionalFunctions.NSX_LSWITCH_UUID, mapping.getLogicalSwitchUuid());
+ result.put(NetworkGuruAdditionalFunctions.NSX_LSWITCHPORT_UUID, mapping.getLogicalSwitchPortUuid());
+ return result;
+ }
+ return null;
+ }
+
}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/GatewayServiceConfig.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/GatewayServiceConfig.java
new file mode 100644
index 000000000000..abfd273683d7
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/GatewayServiceConfig.java
@@ -0,0 +1,47 @@
+//
+// 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.network.nicira;
+
+import java.io.Serializable;
+
+public abstract class GatewayServiceConfig implements Serializable {
+
+ private String uuid;
+ private String displayName;
+ private String type;
+
+ public GatewayServiceConfig(String uuid, String type) {
+ this.uuid = uuid;
+ this.type = type;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/L2GatewayAttachment.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/L2GatewayAttachment.java
new file mode 100644
index 000000000000..2ef294ed7a1c
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/L2GatewayAttachment.java
@@ -0,0 +1,53 @@
+//
+// 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.network.nicira;
+
+public class L2GatewayAttachment extends Attachment {
+
+ private String l2GatewayServiceUuid;
+ private final String type = "L2GatewayAttachment";
+ private Long vlanId;
+
+ public L2GatewayAttachment(String l2GatewayServiceUuid) {
+ this.l2GatewayServiceUuid = l2GatewayServiceUuid;
+ }
+
+ public L2GatewayAttachment(final String l2GatewayServiceUuid, final long vlanId) {
+ this.l2GatewayServiceUuid = l2GatewayServiceUuid;
+ this.vlanId = vlanId;
+ }
+
+ public String getL2GatewayServiceUuid() {
+ return l2GatewayServiceUuid;
+ }
+ public void setL2GatewayServiceUuid(String l2GatewayServiceUuid) {
+ this.l2GatewayServiceUuid = l2GatewayServiceUuid;
+ }
+ public Long getVlanId() {
+ return vlanId;
+ }
+ public void setVlanId(Long vlanId) {
+ this.vlanId = vlanId;
+ }
+ public String getType() {
+ return type;
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/L2GatewayServiceConfig.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/L2GatewayServiceConfig.java
new file mode 100644
index 000000000000..7f2a41aec99f
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/L2GatewayServiceConfig.java
@@ -0,0 +1,30 @@
+//
+// 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.network.nicira;
+
+public class L2GatewayServiceConfig extends GatewayServiceConfig {
+
+ private static final String L2GWTServiceConfigType = "L2GatewayServiceConfig";
+
+ public L2GatewayServiceConfig(String uuid) {
+ super(uuid, L2GWTServiceConfigType);
+ }
+
+}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraConstants.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraConstants.java
index 31adf9d3e2d1..f89b8ad09312 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraConstants.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraConstants.java
@@ -25,6 +25,7 @@ public class NiciraConstants {
public static final String ACL_URI_PREFIX = "/ws.v1/acl";
public static final String SWITCH_URI_PREFIX = "/ws.v1/lswitch";
public static final String ROUTER_URI_PREFIX = "/ws.v1/lrouter";
+ public static final String GATEWAY_SERVICE_PREFIX = "/ws.v1/gateway-service";
public static final String LOGIN_URL = "/ws.v1/login";
public static final String CONTROL_CLUSTER_STATUS_URL = "/ws.v1/control-cluster/status";
@@ -35,8 +36,10 @@ public class NiciraConstants {
public static final String ATTACHMENT_VIF_UUID_QUERY_PARAMETER_NAME = "attachment_vif_uuid";
public static final String ATTACHMENT_VLAN_PARAMETER = "attachment_vlan";
public static final String ATTACHMENT_GWSVC_UUID_QUERY_PARAMETER = "attachment_gwsvc_uuid";
+ public static final String ATTACHMENT_LSWITCH_UUID = "attachment_lswitch_uuid";
public static final String WILDCARD_QUERY_PARAMETER = "*";
public static final String UUID_QUERY_PARAMETER = "uuid";
public static final String FIELDS_QUERY_PARAMETER = "fields";
+ public static final String TYPES_QUERY_PARAMETER = "types";
}
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraNvpApi.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraNvpApi.java
index 093d90da1ae6..293c5a857639 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraNvpApi.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/nicira/NiciraNvpApi.java
@@ -42,6 +42,7 @@ public class NiciraNvpApi {
private static final String SWITCH_URI_PREFIX = NiciraConstants.SWITCH_URI_PREFIX;
private static final String ROUTER_URI_PREFIX = NiciraConstants.ROUTER_URI_PREFIX;
+ private static final String GATEWAY_SERVICE_PREFIX = NiciraConstants.GATEWAY_SERVICE_PREFIX;
private static final String ATTACHMENT_PATH_SEGMENT = NiciraConstants.ATTACHMENT_PATH_SEGMENT;
private static final String NAT_PATH_SEGMENT = NiciraConstants.NAT_PATH_SEGMENT;
@@ -51,6 +52,7 @@ public class NiciraNvpApi {
private static final String WILDCARD_QUERY_PARAMETER = NiciraConstants.WILDCARD_QUERY_PARAMETER;
private static final String UUID_QUERY_PARAMETER = NiciraConstants.UUID_QUERY_PARAMETER;
private static final String FIELDS_QUERY_PARAMETER = NiciraConstants.FIELDS_QUERY_PARAMETER;
+ private static final String TYPES_QUERY_PARAMETER = NiciraConstants.TYPES_QUERY_PARAMETER;
private static final int DEFAULT_MAX_RETRIES = 5;
@@ -131,7 +133,7 @@ private T createWithUri(final T entity, final String uri) throws NiciraNvpAp
try {
createdEntity = restConnector.executeCreateObject(entity, uri, Collections. emptyMap());
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
return createdEntity;
@@ -157,7 +159,7 @@ private List find(final Optional uuid, final Class clazz) thro
try {
entities = restConnector.executeRetrieveObject(listTypeMap.get(clazz), uri, params);
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
if (entities == null) {
@@ -190,7 +192,7 @@ private void updateWithUri(final T item, final String uri) throws NiciraNvpA
try {
restConnector.executeUpdateObject(item, uri, Collections. emptyMap());
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
}
@@ -215,7 +217,7 @@ private void deleteWithUri(final String uri) throws NiciraNvpApiException {
try {
restConnector.executeDeleteObject(uri);
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
}
@@ -394,7 +396,7 @@ public String findLogicalSwitchPortUuidByVifAttachmentUuid(final String logicalS
}.getType();
niciraList = restConnector.executeRetrieveObject(niciraListType, uri, params);
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
final List lspl = niciraList.getResults();
@@ -413,7 +415,7 @@ public ControlClusterStatus getControlClusterStatus() throws NiciraNvpApiExcepti
try {
return restConnector.executeRetrieveObject(ControlClusterStatus.class, uri, new HashMap());
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
}
@@ -427,7 +429,7 @@ public List findLogicalSwitchPortsByUuid(final String logical
}.getType();
return restConnector.> executeRetrieveObject(niciraListType, uri, params).getResults();
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
}
@@ -441,7 +443,7 @@ public List findLogicalRouterPortsByUuid(final String logical
}.getType();
return restConnector.> executeRetrieveObject(niciraListType, uri, params).getResults();
} catch (final CloudstackRESTException e) {
- throw new NiciraNvpApiException(e);
+ throw new NiciraNvpApiException(e, e.getErrorCode());
}
}
@@ -522,7 +524,21 @@ public List findLogicalRouterPortByGatewayServiceAndVlanId(fi
}.getType();
return restConnector.