mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' of ssh://git.cloud.com/var/lib/git/cloudstack-oss
This commit is contained in:
commit
1f91b76b06
|
|
@ -3,7 +3,14 @@
|
|||
<management-server class="com.cloud.server.ManagementServerSimulatorImpl" library="com.cloud.configuration.SimulatorComponentLibrary" extends="components.xml:management-server">
|
||||
<dao name="Configuration configuration server" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
|
||||
<param name="premium">true</param>
|
||||
</dao>
|
||||
</dao>
|
||||
<system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
|
||||
<checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
|
||||
<checker name="EncryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker"/>
|
||||
<checker name="DatabaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker"/>
|
||||
<checker name="DatabaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker"/>
|
||||
</system-integrity-checker>
|
||||
|
||||
<adapters key="com.cloud.ha.Investigator">
|
||||
<adapter name="SimpleInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator"/>
|
||||
<adapter name="PingInvestigator" class="com.cloud.ha.UserVmDomRInvestigator"/>
|
||||
|
|
|
|||
|
|
@ -28,3 +28,6 @@ zone=default
|
|||
|
||||
#guid= a GUID to identify the agent
|
||||
|
||||
#vm.migrate.speed set the vm migrate speed, by default, it's the speed of guest network
|
||||
#local.storage.path local storage path, by default, it's /var/lib/libvirt/images/
|
||||
#cmds.timeout the timeout for time-consuming operations, such create/copy snapshot
|
||||
|
|
@ -243,6 +243,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||
private String _dcId;
|
||||
private String _pod;
|
||||
private String _clusterId;
|
||||
private int _migrateSpeed;
|
||||
|
||||
private long _hvVersion;
|
||||
private KVMHAMonitor _monitor;
|
||||
|
|
@ -722,7 +723,26 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||
if (_mountPoint == null) {
|
||||
_mountPoint = "/mnt";
|
||||
}
|
||||
|
||||
|
||||
value = (String) params.get("vm.migrate.speed");
|
||||
_migrateSpeed = NumbersUtil.parseInt(value, -1);
|
||||
if (_migrateSpeed == -1) {
|
||||
//get guest network device speed
|
||||
_migrateSpeed = 0;
|
||||
String speed = Script.runSimpleBashScript("ethtool " + _pifs.second() + " |grep Speed | cut -d \\ -f 2");
|
||||
if (speed != null) {
|
||||
String[] tokens = speed.split("M");
|
||||
if (tokens.length == 2) {
|
||||
try {
|
||||
_migrateSpeed = Integer.parseInt(tokens[0]);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
s_logger.debug("device " + _pifs.second() + " has speed: " + String.valueOf(_migrateSpeed));
|
||||
}
|
||||
}
|
||||
params.put("vm.migrate.speed", String.valueOf(_migrateSpeed));
|
||||
}
|
||||
saveProperties(params);
|
||||
|
||||
return true;
|
||||
|
|
@ -2004,7 +2024,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||
* VIR_MIGRATE_PERSIST_DEST(1<<3)
|
||||
*/
|
||||
destDomain = dm.migrate(dconn, (1 << 0) | (1 << 3), vmName, "tcp:"
|
||||
+ cmd.getDestinationIp(), 0);
|
||||
+ cmd.getDestinationIp(), _migrateSpeed);
|
||||
} catch (LibvirtException e) {
|
||||
s_logger.debug("Can't migrate domain: " + e.getMessage());
|
||||
result = e.getMessage();
|
||||
|
|
|
|||
|
|
@ -331,6 +331,7 @@ public class ApiConstants {
|
|||
public static final String IS_STATIC_NAT = "isstaticnat";
|
||||
public static final String SORT_BY = "sortby";
|
||||
public static final String CHANGE_CIDR = "changecidr";
|
||||
public static final String PURPOSE = "purpose";
|
||||
|
||||
public enum HostDetails {
|
||||
all, capacity, events, stats, min;
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public class AddHostCmd extends BaseCmd {
|
|||
List<? extends Host> result = _resourceService.discoverHosts(this);
|
||||
ListResponse<HostResponse> response = new ListResponse<HostResponse>();
|
||||
List<HostResponse> hostResponses = new ArrayList<HostResponse>();
|
||||
if (result != null) {
|
||||
if (result != null && result.size() > 0) {
|
||||
for (Host host : result) {
|
||||
HostResponse hostResponse = _responseGenerator.createHostResponse(host);
|
||||
hostResponses.add(hostResponse);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ProviderResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
|
|
@ -131,4 +132,9 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
|
|||
public String getEventDescription() {
|
||||
return "Adding physical network ServiceProvider: " + getEntityId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetworkServiceProvider;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.TrafficTypeResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.PhysicalNetworkTrafficType;
|
||||
|
|
@ -151,4 +152,9 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
|
|||
public String getEventDescription() {
|
||||
return "Adding physical network traffic type: " + getEntityId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.TrafficType;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.FirewallResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
|
|
@ -301,5 +302,10 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
|
|||
return FirewallRuleType.User;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.FirewallRuleResponse;
|
||||
import com.cloud.api.response.IpForwardingRuleResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
|
|
@ -298,5 +299,10 @@ public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements Sta
|
|||
public FirewallRuleType getType() {
|
||||
return FirewallRuleType.User;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.LoadBalancerResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.event.EventTypes;
|
||||
|
|
@ -347,6 +348,11 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements
|
|||
public void setSourceIpAddressId(Long ipId) {
|
||||
this.publicIpId = ipId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.FirewallRuleResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
|
|
@ -307,5 +308,10 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
|
|||
public FirewallRuleType getType() {
|
||||
return FirewallRuleType.User;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ public class CreateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
|
|||
@Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask for storage network")
|
||||
private String netmask;
|
||||
|
||||
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway for storage network")
|
||||
private String gateway;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -66,6 +69,10 @@ public class CreateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
|
|||
public String getNetmask() {
|
||||
return netmask;
|
||||
}
|
||||
|
||||
public String getGateWay() {
|
||||
return gateway;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
@ -112,4 +113,9 @@ public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
|
|||
public Long getSyncObjId() {
|
||||
return _firewallService.getFirewallRule(id).getNetworkId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
|
|
@ -115,5 +116,10 @@ public class DeleteIpForwardingRuleCmd extends BaseAsyncCmd {
|
|||
public Long getSyncObjId() {
|
||||
return _rulesService.getFirewallRule(id).getNetworkId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
|
|
@ -110,4 +111,9 @@ public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd {
|
|||
}
|
||||
return lb.getNetworkId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
@ -101,4 +102,9 @@ public class DeleteNetworkServiceProviderCmd extends BaseAsyncCmd {
|
|||
public String getEventDescription() {
|
||||
return "Deleting Physical network ServiceProvider: " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetworkServiceProvider;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.network.rules.PortForwardingRule;
|
||||
|
|
@ -114,4 +115,9 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
|
|||
public Long getSyncObjId() {
|
||||
return _rulesService.getPortForwardigRule(id).getNetworkId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
|
@ -88,5 +89,9 @@ public class DeleteTrafficTypeCmd extends BaseAsyncCmd {
|
|||
return EventTypes.EVENT_TRAFFIC_TYPE_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.TrafficType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class MigrateVolumeCmd extends BaseAsyncCmd {
|
|||
private Long volumeId;
|
||||
|
||||
@IdentityMapper(entityTableName="storage_pool")
|
||||
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, required=false, description="destination storage pool ID to migrate the volume to")
|
||||
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, required=true, description="destination storage pool ID to migrate the volume to")
|
||||
private Long storageId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ProviderResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -103,5 +104,10 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
|
|||
public String getEventDescription() {
|
||||
return "Updating physical network ServiceProvider: " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetworkServiceProvider;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.TrafficTypeResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.PhysicalNetworkTrafficType;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -111,5 +112,8 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
|
|||
return EventTypes.EVENT_TRAFFIC_TYPE_UPDATE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.TrafficType;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,14 @@ public class AlertResponse extends BaseResponse {
|
|||
@SerializedName(ApiConstants.ID) @Param(description="the id of the alert")
|
||||
private IdentityProxy id = new IdentityProxy("alert");
|
||||
|
||||
@SerializedName(ApiConstants.TYPE) @Param(description="the alert type")
|
||||
@SerializedName(ApiConstants.TYPE) @Param(description="One of the following alert types: " +
|
||||
"MEMORY = 0, CPU = 1, STORAGE = 2, STORAGE_ALLOCATED = 3, PUBLIC_IP = 4, PRIVATE_IP = 5, HOST = 6, USERVM = 7, " +
|
||||
"DOMAIN_ROUTER = 8, CONSOLE_PROXY = 9, ROUTING = 10: lost connection to default route (to the gateway), " +
|
||||
"STORAGE_MISC = 11: lost connection to default route (to the gateway), " +
|
||||
"USAGE_SERVER = 12: lost connection to default route (to the gateway), " +
|
||||
"MANAGMENT_NODE = 13: lost connection to default route (to the gateway), " +
|
||||
"DOMAIN_ROUTER_MIGRATE = 14, CONSOLE_PROXY_MIGRATE = 15, USERVM_MIGRATE = 16, VLAN = 17, SSVM = 18, " +
|
||||
"USAGE_SERVER_RESULT = 19")
|
||||
private Short alertType;
|
||||
|
||||
@SerializedName(ApiConstants.DESCRIPTION) @Param(description="description of the alert")
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ package com.cloud.api.response;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.IdentityProxy;
|
||||
import com.cloud.api.ResponseObject;
|
||||
|
|
@ -119,7 +117,13 @@ public class AsyncJobResponse extends BaseResponse {
|
|||
this.jobInstanceId.setTableName("security_group");
|
||||
} else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.PhysicalNetwork.toString())) {
|
||||
this.jobInstanceId.setTableName("physical_network");
|
||||
}else if (!jobInstanceType.equalsIgnoreCase(AsyncJob.Type.None.toString())){
|
||||
} else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.TrafficType.toString())) {
|
||||
this.jobInstanceId.setTableName("physical_network_traffic_types");
|
||||
} else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.PhysicalNetworkServiceProvider.toString())) {
|
||||
this.jobInstanceId.setTableName("physical_network_service_providers");
|
||||
} else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.FirewallRule.toString())) {
|
||||
this.jobInstanceId.setTableName("firewall_rules");
|
||||
} else if (!jobInstanceType.equalsIgnoreCase(AsyncJob.Type.None.toString())){
|
||||
// TODO : when we hit here, we need to add instanceType -> UUID entity table mapping
|
||||
assert(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,10 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
|
|||
private String state;
|
||||
|
||||
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network this belongs to")
|
||||
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network");
|
||||
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network");
|
||||
|
||||
@SerializedName(ApiConstants.PURPOSE) @Param(description="purpose of the IP address. In Acton this value is not null for Elastic IPs only, and can have either StaticNat or LB value")
|
||||
private String purpose;
|
||||
|
||||
/*
|
||||
@SerializedName(ApiConstants.JOB_ID) @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the volume")
|
||||
|
|
@ -207,11 +210,11 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
|
|||
this.physicalNetworkId.setValue(physicalNetworkId);
|
||||
}
|
||||
|
||||
public long getphysicalNetworkId() {
|
||||
return physicalNetworkId.getValue();
|
||||
}
|
||||
|
||||
public void setIsElastic(Boolean isElastic) {
|
||||
this.isElastic = isElastic;
|
||||
}
|
||||
|
||||
public void setPurpose(String purpose) {
|
||||
this.purpose = purpose;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.cloud.serializer.Param;
|
|||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class StorageNetworkIpRangeResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.VLAN) @Param(description="the uuid of storage network IP range.")
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the uuid of storage network IP range.")
|
||||
private String uuid;
|
||||
|
||||
@SerializedName(ApiConstants.VLAN) @Param(description="the ID or VID of the VLAN.")
|
||||
|
|
@ -19,7 +19,10 @@ public class StorageNetworkIpRangeResponse extends BaseResponse {
|
|||
private String startIp;
|
||||
|
||||
@SerializedName(ApiConstants.END_IP) @Param(description="the end ip of the storage network IP range")
|
||||
private String endIp;
|
||||
private String endIp;
|
||||
|
||||
@SerializedName(ApiConstants.GATEWAY) @Param(description="the gateway of the storage network IP range")
|
||||
private String gateway;
|
||||
|
||||
@SerializedName(ApiConstants.NETWORK_ID) @Param(description="the network uuid of storage network IP range")
|
||||
private String networkUuid;
|
||||
|
|
@ -30,7 +33,7 @@ public class StorageNetworkIpRangeResponse extends BaseResponse {
|
|||
@SerializedName(ApiConstants.NETMASK) @Param(description="the netmask of the storage network IP range")
|
||||
private String netmask;
|
||||
|
||||
public void setUuid(String uuId) {
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
@ -60,5 +63,9 @@ public class StorageNetworkIpRangeResponse extends BaseResponse {
|
|||
|
||||
public void setNetmask(String netmask) {
|
||||
this.netmask = netmask;
|
||||
}
|
||||
|
||||
public void setGateway(String gateway) {
|
||||
this.gateway = gateway;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,11 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
|
|||
@SerializedName("hypervisor") @Param(description="the hypervisor on which the template runs")
|
||||
private String hypervisor;
|
||||
|
||||
@SerializedName(ApiConstants.PUBLIC_IP_ID) @Param(description="public IP address id associated with vm via Static nat rule")
|
||||
private IdentityProxy publicIpId = new IdentityProxy("user_ip_address");
|
||||
|
||||
@SerializedName(ApiConstants.PUBLIC_IP) @Param(description="public IP address id associated with vm via Static nat rule")
|
||||
private String publicIp;
|
||||
|
||||
public void setHypervisor(String hypervisor) {
|
||||
this.hypervisor = hypervisor;
|
||||
|
|
@ -322,4 +327,12 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
|
|||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public void setPublicIpId(Long publicIpId) {
|
||||
this.publicIpId.setValue(publicIpId);
|
||||
}
|
||||
|
||||
public void setPublicIp(String publicIp) {
|
||||
this.publicIp = publicIp;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ public interface AsyncJob extends Identity {
|
|||
StoragePool,
|
||||
IpAddress,
|
||||
SecurityGroup,
|
||||
PhysicalNetwork
|
||||
PhysicalNetwork,
|
||||
TrafficType,
|
||||
PhysicalNetworkServiceProvider,
|
||||
FirewallRule
|
||||
}
|
||||
|
||||
Long getId();
|
||||
|
|
|
|||
|
|
@ -15,5 +15,7 @@ public interface StorageNetworkIpRange {
|
|||
|
||||
String getZoneUuid();
|
||||
|
||||
String getNetmask();
|
||||
String getNetmask();
|
||||
|
||||
String getGateway();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,11 @@ public interface IpAddress extends ControlledEntity {
|
|||
Releasing, // The IP address is being released for other network elements and is not ready for allocation.
|
||||
Free // The IP address is ready to be allocated.
|
||||
}
|
||||
|
||||
enum Purpose {
|
||||
StaticNat,
|
||||
Lb
|
||||
}
|
||||
|
||||
long getDataCenterId();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
#new labels (begin) **********************************************************************************************
|
||||
state.Stopping=Stopping
|
||||
message.add.load.balancer.under.ip=The load balancer rule has been added under IP:
|
||||
message.select.instance=Please select an instance.
|
||||
label.select=Select
|
||||
label.select.vm.for.static.nat=Select VM for static NAT
|
||||
label.select.instance=Select instance
|
||||
label.nat.port.range=NAT Port Range
|
||||
label.static.nat.vm.details=Static NAT VM Details
|
||||
label.edit.lb.rule=Edit LB rule
|
||||
message.migrate.instance.to.host=Please confirm that you want to migrate instance to another host.
|
||||
label.migrate.instance.to.host=Migrate instance to another host
|
||||
message.migrate.instance.to.ps=Please confirm that you want to migrate instance to another primary storage.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
#new labels (begin) **********************************************************************************************
|
||||
state.Stopping=停止
|
||||
message.add.load.balancer.under.ip=ロードバランサのルールは、IPの下に追加されました。
|
||||
message.select.instance=インスタンスを選択してください。
|
||||
label.select=選択する
|
||||
label.select.vm.for.static.nat=スタティックNATのためにVMを選択します。
|
||||
label.select.instance=インスタンスを選択します。
|
||||
label.nat.port.range=NATのポート範囲
|
||||
label.static.nat.vm.details=スタティックNAT仮想マシンの詳細
|
||||
label.edit.lb.rule=LBルールを編集する
|
||||
message.migrate.instance.to.host=別のホストにインスタンスを移行することを確認してください。
|
||||
label.migrate.instance.to.host=別のホストにインスタンスを移行する
|
||||
message.migrate.instance.to.ps=別のプライマリ·ストレージにインスタンスを移行することを確認してください。
|
||||
|
|
@ -431,7 +440,7 @@ message.desc.secondary.storage=Each zone must have at lease one NFS or secondary
|
|||
label.launch.zone=Launch zone
|
||||
message.please.wait.while.zone.is.being.created=Please wait while your zone is being created; this may take a while...
|
||||
|
||||
label.load.balancing=Load Balancing
|
||||
label.load.balancing=ロード·バランシング;
|
||||
label.static.nat.enabled=Static NAT Enabled
|
||||
label.zones=Zones
|
||||
label.view.more=View more
|
||||
|
|
|
|||
|
|
@ -324,4 +324,7 @@ deleteStorageNetworkIpRange=com.cloud.api.commands.DeleteStorageNetworkIpRangeCm
|
|||
listStorageNetworkIpRange=com.cloud.api.commands.listStorageNetworkIpRangeCmd;1
|
||||
updateStorageNetworkIpRange=com.cloud.api.commands.UpdateStorageNetworkIpRangeCmd;1
|
||||
|
||||
|
||||
### Network Devices commands
|
||||
addNetworkDevice=com.cloud.api.commands.AddNetworkDeviceCmd;1
|
||||
listNetworkDevice=com.cloud.api.commands.ListNetworkDeviceCmd;1
|
||||
deleteNetworkDevice=com.cloud.api.commands.DeleteNetworkDeviceCmd;1
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class ConfigurationVO implements Configuration{
|
|||
}
|
||||
|
||||
public String getValue() {
|
||||
return ("Hidden".equals(getCategory()) ? DBEncryptionUtil.decrypt(value) : value);
|
||||
return (("Hidden".equals(getCategory()) || "Secure".equals(getCategory())) ? DBEncryptionUtil.decrypt(value) : value);
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||
private String _eth1ip;
|
||||
private String _storageIp;
|
||||
private String _storageNetmask;
|
||||
private String _storageGateway;
|
||||
final private String _parent = "/mnt/SecStorage";
|
||||
final private String _tmpltDir = "/var/cloudstack/template";
|
||||
final private String _tmpltpp = "template.properties";
|
||||
|
|
@ -597,7 +598,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||
InetAddress nfsHostAddr = InetAddress.getByName(nfsHost);
|
||||
String nfsHostIp = nfsHostAddr.getHostAddress();
|
||||
|
||||
addRouteToInternalIpOrCidr(_storageIp, _storageIp, _storageNetmask, nfsHostIp);
|
||||
addRouteToInternalIpOrCidr(_storageGateway, _storageIp, _storageNetmask, nfsHostIp);
|
||||
String nfsPath = nfsHostIp + ":" + uri.getPath();
|
||||
String dir = UUID.nameUUIDFromBytes(nfsPath.getBytes()).toString();
|
||||
String root = _parent + "/" + dir;
|
||||
|
|
@ -997,6 +998,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||
s_logger.warn("Wait, there is no storageip in /proc/cmdline, something wrong!");
|
||||
}
|
||||
_storageNetmask = (String) params.get("storagenetmask");
|
||||
_storageGateway = (String) params.get("storagegateway");
|
||||
super.configure(name, params);
|
||||
|
||||
_params = params;
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -823,7 +823,9 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
|
|||
s_logger.debug("Cant not find host " + agent.getId());
|
||||
}
|
||||
} else {
|
||||
agentStatusTransitTo(host, Event.ManagementServerDown, _nodeId);
|
||||
if (!agent.forForward()) {
|
||||
agentStatusTransitTo(host, Event.ManagementServerDown, _nodeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import com.cloud.host.HostVO;
|
|||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.network.IPAddressVO;
|
||||
import com.cloud.network.IpAddress;
|
||||
import com.cloud.network.LoadBalancerVO;
|
||||
import com.cloud.network.Network.Capability;
|
||||
import com.cloud.network.Network.Provider;
|
||||
|
|
@ -730,4 +731,8 @@ public class ApiDBUtils {
|
|||
ServiceOfferingVO serviceOffering = _serviceOfferingDao.findByName("Cloud.Com-SoftwareRouter");
|
||||
return serviceOffering.getId();
|
||||
}
|
||||
|
||||
public static IpAddress findIpByAssociatedVmId(long vmId) {
|
||||
return _ipAddressDao.findByAssociatedVmId(vmId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -759,6 +759,15 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
ipResponse.setVlanId(ipAddress.getVlanId());
|
||||
ipResponse.setVlanName(ApiDBUtils.findVlanById(ipAddress.getVlanId()).getVlanTag());
|
||||
}
|
||||
|
||||
if (ipAddress.getElastic()) {
|
||||
if (ipAddress.isOneToOneNat()) {
|
||||
ipResponse.setPurpose(IpAddress.Purpose.StaticNat.toString());
|
||||
} else {
|
||||
ipResponse.setPurpose(IpAddress.Purpose.Lb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
ipResponse.setObjectName("ipaddress");
|
||||
return ipResponse;
|
||||
}
|
||||
|
|
@ -1239,6 +1248,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
|
||||
if (userVm.getDisplayName() != null) {
|
||||
userVmResponse.setDisplayName(userVm.getDisplayName());
|
||||
} else {
|
||||
userVmResponse.setDisplayName(userVm.getHostName());
|
||||
}
|
||||
|
||||
if (userVm.getPassword() != null) {
|
||||
|
|
@ -1440,6 +1451,12 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
}
|
||||
userVmResponse.setNics(nicResponses);
|
||||
}
|
||||
|
||||
IpAddress ip = ApiDBUtils.findIpByAssociatedVmId(userVm.getId());
|
||||
if (ip != null) {
|
||||
userVmResponse.setPublicIpId(ip.getId());
|
||||
userVmResponse.setPublicIp(ip.getAddress().addr());
|
||||
}
|
||||
|
||||
userVmResponse.setObjectName(objectName);
|
||||
vmResponses.add(userVmResponse);
|
||||
|
|
@ -2867,6 +2884,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
}
|
||||
if (userVm.getDisplayName() != null) {
|
||||
userVmData.setDisplayName(userVm.getDisplayName());
|
||||
} else {
|
||||
userVmData.setDisplayName(userVm.getHostName());
|
||||
}
|
||||
userVmData.setDomainId(userVm.getDomainId());
|
||||
|
||||
|
|
@ -2889,6 +2908,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
userVmResponse.setHypervisor(userVmData.getHypervisor());
|
||||
userVmResponse.setId(userVmData.getId());
|
||||
userVmResponse.setName(userVmData.getName());
|
||||
|
||||
userVmResponse.setDisplayName(userVmData.getDisplayName());
|
||||
|
||||
populateAccount(userVmResponse, userVmData.getAccountId());
|
||||
|
|
@ -2966,6 +2986,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
nicResponses.add(nr);
|
||||
}
|
||||
userVmResponse.setNics(new ArrayList<NicResponse>(nicResponses));
|
||||
userVmResponse.setPublicIpId(userVmData.getPublicIpId());
|
||||
userVmResponse.setPublicIp(userVmData.getPublicIp());
|
||||
|
||||
return userVmResponse;
|
||||
}
|
||||
|
|
@ -3287,7 +3309,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
response.setZoneUuid(result.getZoneUuid());
|
||||
response.setNetworkUuid(result.getNetworkUuid());
|
||||
response.setNetmask(result.getNetmask());
|
||||
response.setObjectName("storagenetworkiprange");
|
||||
response.setGateway(result.getGateway());
|
||||
response.setObjectName("storagenetworkiprange");
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.agent.IAgentControl;
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.CheckNetworkAnswer;
|
||||
import com.cloud.agent.api.CheckNetworkCommand;
|
||||
import com.cloud.agent.api.CheckVirtualMachineAnswer;
|
||||
import com.cloud.agent.api.CheckVirtualMachineCommand;
|
||||
import com.cloud.agent.api.Command;
|
||||
|
|
@ -385,6 +387,10 @@ public class BareMetalResourceBase implements ServerResource {
|
|||
|
||||
}
|
||||
|
||||
protected CheckNetworkAnswer execute(CheckNetworkCommand cmd) {
|
||||
return new CheckNetworkAnswer(cmd, true, "Success");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Answer executeRequest(Command cmd) {
|
||||
if (cmd instanceof ReadyCommand) {
|
||||
|
|
@ -407,6 +413,8 @@ public class BareMetalResourceBase implements ServerResource {
|
|||
return execute((CheckVirtualMachineCommand)cmd);
|
||||
} else if (cmd instanceof IpmiBootorResetCommand) {
|
||||
return execute((IpmiBootorResetCommand)cmd);
|
||||
} else if (cmd instanceof CheckNetworkCommand) {
|
||||
return execute((CheckNetworkCommand)cmd);
|
||||
} else {
|
||||
return Answer.createUnsupportedCommandAnswer(cmd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public enum Config {
|
|||
AlertEmailAddresses("Alert", ManagementServer.class, String.class, "alert.email.addresses", null, "Comma separated list of email addresses used for sending alerts.", null),
|
||||
AlertEmailSender("Alert", ManagementServer.class, String.class, "alert.email.sender", null, "Sender of alert email (will be in the From header of the email).", null),
|
||||
AlertSMTPHost("Alert", ManagementServer.class, String.class, "alert.smtp.host", null, "SMTP hostname used for sending out email alerts.", null),
|
||||
AlertSMTPPassword("Alert", ManagementServer.class, String.class, "alert.smtp.password", null, "Password for SMTP authentication (applies only if alert.smtp.useAuth is true).", null),
|
||||
AlertSMTPPassword("Secure", ManagementServer.class, String.class, "alert.smtp.password", null, "Password for SMTP authentication (applies only if alert.smtp.useAuth is true).", null),
|
||||
AlertSMTPPort("Alert", ManagementServer.class, Integer.class, "alert.smtp.port", "465", "Port the SMTP server is listening on.", null),
|
||||
AlertSMTPUseAuth("Alert", ManagementServer.class, String.class, "alert.smtp.useAuth", null, "If true, use SMTP authentication when sending emails.", null),
|
||||
AlertSMTPUsername("Alert", ManagementServer.class, String.class, "alert.smtp.username", null, "Username for SMTP authentication (applies only if alert.smtp.useAuth is true).", null),
|
||||
|
|
@ -84,7 +84,7 @@ public enum Config {
|
|||
// Network
|
||||
NetworkLBHaproxyStatsVisbility("Network", ManagementServer.class, String.class, "network.loadbalancer.haproxy.stats.visibility", "global", "Load Balancer(haproxy) stats visibilty, the value can be one of the following six parameters : global,guest-network,link-local,disabled,all,default", null),
|
||||
NetworkLBHaproxyStatsUri("Network", ManagementServer.class, String.class, "network.loadbalancer.haproxy.stats.uri","/admin?stats","Load Balancer(haproxy) uri.",null),
|
||||
NetworkLBHaproxyStatsAuth("Network", ManagementServer.class, String.class, "network.loadbalancer.haproxy.stats.auth","admin1:AdMiN123","Load Balancer(haproxy) authetication string in the format username:password",null),
|
||||
NetworkLBHaproxyStatsAuth("Secure", ManagementServer.class, String.class, "network.loadbalancer.haproxy.stats.auth","admin1:AdMiN123","Load Balancer(haproxy) authetication string in the format username:password",null),
|
||||
NetworkLBHaproxyStatsPort("Network", ManagementServer.class, String.class, "network.loadbalancer.haproxy.stats.port","8081","Load Balancer(haproxy) stats port number.",null),
|
||||
NetworkRouterRpFilter("Network", ManagementServer.class, Integer.class, "network.disable.rpfilter", "true", "disable rp_filter on Domain Router VM public interfaces.", null),
|
||||
|
||||
|
|
@ -327,7 +327,7 @@ public enum Config {
|
|||
|
||||
ProjectEmailSender("Project Defaults", ManagementServer.class, String.class, "project.email.sender", null, "Sender of project invitation email (will be in the From header of the email)", null),
|
||||
ProjectSMTPHost("Project Defaults", ManagementServer.class, String.class, "project.smtp.host", null, "SMTP hostname used for sending out email project invitations", null),
|
||||
ProjectSMTPPassword("Project Defaults", ManagementServer.class, String.class, "project.smtp.password", null, "Password for SMTP authentication (applies only if project.smtp.useAuth is true)", null),
|
||||
ProjectSMTPPassword("Secure", ManagementServer.class, String.class, "project.smtp.password", null, "Password for SMTP authentication (applies only if project.smtp.useAuth is true)", null),
|
||||
ProjectSMTPPort("Project Defaults", ManagementServer.class, Integer.class, "project.smtp.port", "465", "Port the SMTP server is listening on", null),
|
||||
ProjectSMTPUseAuth("Project Defaults", ManagementServer.class, String.class, "project.smtp.useAuth", null, "If true, use SMTP authentication when sending emails", null),
|
||||
ProjectSMTPUsername("Project Defaults", ManagementServer.class, String.class, "project.smtp.username", null, "Username for SMTP authentication (applies only if project.smtp.useAuth is true)", null),
|
||||
|
|
@ -360,6 +360,7 @@ public enum Config {
|
|||
_configs.put("Hidden", new ArrayList<Config>());
|
||||
_configs.put("Account Defaults", new ArrayList<Config>());
|
||||
_configs.put("Project Defaults", new ArrayList<Config>());
|
||||
_configs.put("Secure", new ArrayList<Config>());
|
||||
|
||||
// Add values into HashMap
|
||||
for (Config c : Config.values()) {
|
||||
|
|
|
|||
|
|
@ -3561,6 +3561,13 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
if (offering.isDefault() == true) {
|
||||
throw new InvalidParameterValueException("Default network offering can't be deleted");
|
||||
}
|
||||
|
||||
//don't allow to delete network offering if it's in use by existing networks (the offering can be disabled though)
|
||||
int networkCount = _networkDao.getNetworkCountByNetworkOffId(offeringId);
|
||||
if (networkCount > 0) {
|
||||
throw new InvalidParameterValueException("Can't delete network offering " + offeringId + " as its used by " + networkCount + " networks. " +
|
||||
"To make the network offering unavaiable, disable it");
|
||||
}
|
||||
|
||||
if (_networkOfferingDao.remove(offeringId)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
|
|||
public boolean update(String name, String category, String value) {
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
try {
|
||||
value = "Hidden".equals(category) ? DBEncryptionUtil.encrypt(value) : value;
|
||||
value = ("Hidden".equals(category) || "Secure".equals(category)) ? DBEncryptionUtil.encrypt(value) : value;
|
||||
PreparedStatement stmt = txn.prepareStatement(UPDATE_CONFIGURATION_SQL);
|
||||
stmt.setString(1, value);
|
||||
stmt.setString(2, name);
|
||||
|
|
@ -176,7 +176,7 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
|
|||
returnValue = rs.getString(1);
|
||||
if(returnValue != null) {
|
||||
txn.commit();
|
||||
if("Hidden".equals(category)){
|
||||
if("Hidden".equals(category) || "Secure".equals(category)){
|
||||
return DBEncryptionUtil.decrypt(returnValue);
|
||||
} else {
|
||||
return returnValue;
|
||||
|
|
@ -188,7 +188,7 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
|
|||
}
|
||||
stmt.close();
|
||||
|
||||
if("Hidden".equals(category)){
|
||||
if("Hidden".equals(category) || "Secure".equals(category)){
|
||||
initValue = DBEncryptionUtil.encrypt(initValue);
|
||||
}
|
||||
stmtInsert = txn.prepareAutoCloseStatement(
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ public class StorageNetworkIpAddressVO {
|
|||
|
||||
@Column(name = "vlan", table = "dc_storage_network_ip_range", insertable = false, updatable = false)
|
||||
Integer vlan;
|
||||
|
||||
@Column(name = "gateway", table = "dc_storage_network_ip_range", insertable = false, updatable = false)
|
||||
String gateway;
|
||||
|
||||
protected StorageNetworkIpAddressVO() {
|
||||
}
|
||||
|
|
@ -92,4 +95,8 @@ public class StorageNetworkIpAddressVO {
|
|||
public Integer getVlan() {
|
||||
return vlan;
|
||||
}
|
||||
|
||||
public String getGateway() {
|
||||
return gateway;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,11 +42,14 @@ public class StorageNetworkIpRangeVO implements StorageNetworkIpRange {
|
|||
@Column(name = "end_ip")
|
||||
private String endIp;
|
||||
|
||||
@Column(name = "gateway")
|
||||
private String gateway;
|
||||
|
||||
@Column(name = "network_id")
|
||||
private long networkId;
|
||||
|
||||
@Column(name="netmask")
|
||||
private String netmask;
|
||||
private String netmask;
|
||||
|
||||
@Column(name = "uuid", table = "networks", insertable = false, updatable = false)
|
||||
String networkUuid;
|
||||
|
|
@ -57,7 +60,7 @@ public class StorageNetworkIpRangeVO implements StorageNetworkIpRange {
|
|||
@Column(name = "uuid", table = "data_center", insertable = false, updatable = false)
|
||||
String zoneUuid;
|
||||
|
||||
public StorageNetworkIpRangeVO(long dcId, long podId, long networkId, String startIp, String endIp, Integer vlan, String netmask) {
|
||||
public StorageNetworkIpRangeVO(long dcId, long podId, long networkId, String startIp, String endIp, Integer vlan, String netmask, String gateway) {
|
||||
this();
|
||||
this.dataCenterId = dcId;
|
||||
this.podId = podId;
|
||||
|
|
@ -65,7 +68,8 @@ public class StorageNetworkIpRangeVO implements StorageNetworkIpRange {
|
|||
this.startIp = startIp;
|
||||
this.endIp = endIp;
|
||||
this.vlan = vlan;
|
||||
this.netmask = netmask;
|
||||
this.netmask = netmask;
|
||||
this.gateway = gateway;
|
||||
}
|
||||
|
||||
protected StorageNetworkIpRangeVO() {
|
||||
|
|
@ -126,6 +130,14 @@ public class StorageNetworkIpRangeVO implements StorageNetworkIpRange {
|
|||
|
||||
public String getNetmask() {
|
||||
return netmask;
|
||||
}
|
||||
|
||||
public String getGateway() {
|
||||
return this.gateway;
|
||||
}
|
||||
|
||||
public void setGateway(String gateway) {
|
||||
this.gateway = gateway;
|
||||
}
|
||||
|
||||
public void setNetmask(String netmask) {
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ public class BareMetalPlanner implements DeploymentPlanner {
|
|||
return new DeployDestination(dc, pod, c, h);
|
||||
}
|
||||
|
||||
if (offering.getTags() != null) {
|
||||
String[] tags = offering.getTags().split(",");
|
||||
if (offering.getHostTag() != null) {
|
||||
String[] tags = offering.getHostTag().split(",");
|
||||
if (tags.length > 0) {
|
||||
hostTag = tags[0];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,25 +183,21 @@ public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
|
|||
|
||||
List<PhysicalNetworkSetupInfo> networks = _networkMgr.getPhysicalNetworkInfo(dcId, HypervisorType.KVM);
|
||||
if (networks.size() < 1) {
|
||||
_kvmPublicNic = "cloudbr0";
|
||||
_kvmPrivateNic = "cloudbr0";
|
||||
_kvmGuestNic = "cloudbr0";
|
||||
s_logger.debug("Can't find physical network devices on zone: " + dcId + ", use the default cloudbr0");
|
||||
s_logger.debug("Can't find physical network devices on zone: " + dcId + ", use the default from kvm.{private|public|guest}.devices");
|
||||
} else {
|
||||
PhysicalNetworkSetupInfo network = networks.get(0);
|
||||
_kvmPublicNic = network.getPublicNetworkName();
|
||||
if (_kvmPublicNic == null) {
|
||||
_kvmPublicNic = "cloudbr0";
|
||||
String pubNetName = network.getPublicNetworkName();
|
||||
if (pubNetName != null) {
|
||||
_kvmPublicNic = pubNetName;
|
||||
}
|
||||
_kvmPrivateNic = network.getPrivateNetworkName();
|
||||
if (_kvmPrivateNic == null) {
|
||||
_kvmPrivateNic = _kvmPublicNic;
|
||||
String prvNetName = network.getPrivateNetworkName();
|
||||
if (prvNetName != null) {
|
||||
_kvmPrivateNic = prvNetName;
|
||||
}
|
||||
_kvmGuestNic = network.getGuestNetworkName();
|
||||
if (_kvmGuestNic == null) {
|
||||
_kvmGuestNic = _kvmPrivateNic;
|
||||
String guestNetName = network.getGuestNetworkName();
|
||||
if (guestNetName != null) {
|
||||
_kvmGuestNic = guestNetName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String parameters = " -m " + _hostIp + " -z " + dcId + " -p " + podId + " -c " + clusterId + " -g " + guid + " -a";
|
||||
|
|
|
|||
|
|
@ -138,11 +138,13 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
|
|||
@Inject HostDetailsDao _hostDetailDao;
|
||||
|
||||
private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalFirewallDeviceManagerImpl.class);
|
||||
private long _defaultFwCapacity;
|
||||
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||
super.configure(name, params);
|
||||
_resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
|
||||
_defaultFwCapacity = NumbersUtil.parseLong(_configDao.getValue(Config.DefaultExternalFirewallCapacity.key()), 50);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -211,6 +213,9 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
|
|||
|
||||
boolean dedicatedUse = (configParams.get(ApiConstants.FIREWALL_DEVICE_DEDICATED) != null) ? Boolean.parseBoolean(configParams.get(ApiConstants.FIREWALL_DEVICE_DEDICATED)) : false;
|
||||
long capacity = NumbersUtil.parseLong((String)configParams.get(ApiConstants.FIREWALL_DEVICE_CAPACITY), 0);
|
||||
if (capacity == 0) {
|
||||
capacity = _defaultFwCapacity;
|
||||
}
|
||||
|
||||
ExternalFirewallDeviceVO fwDevice = new ExternalFirewallDeviceVO(externalFirewall.getId(), pNetwork.getId(), ntwkSvcProvider.getProviderName(),
|
||||
deviceName, capacity, dedicatedUse);
|
||||
|
|
@ -298,6 +303,9 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
|
|||
for (ExternalFirewallDeviceVO fwDevice: fwDevices) {
|
||||
// max number of guest networks that can be mapped to this device
|
||||
long fullCapacity = fwDevice.getCapacity();
|
||||
if (fullCapacity == 0) {
|
||||
fullCapacity = _defaultFwCapacity; // if capacity not configured then use the default
|
||||
}
|
||||
|
||||
// get the list of guest networks that are mapped to this load balancer
|
||||
List<NetworkExternalFirewallVO> mappedNetworks = _networkExternalFirewallDao.listByFirewallDeviceId(fwDevice.getId());
|
||||
|
|
@ -308,7 +316,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
|
|||
}
|
||||
}
|
||||
throw new InsufficientNetworkCapacityException("Unable to find a firewall provider with sufficient capcity " +
|
||||
" to implement the network", Network.class, network.getId());
|
||||
" to implement the network", DataCenter.class, network.getDataCenterId());
|
||||
}
|
||||
|
||||
public String getExternalNetworkResourceGuid(long physicalNetworkId, String deviceName, String ip) {
|
||||
|
|
@ -363,6 +371,11 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
|
|||
}
|
||||
} else {
|
||||
ExternalFirewallDeviceVO fwDeviceVO = getExternalFirewallForNetwork(network);
|
||||
if (fwDeviceVO == null) {
|
||||
s_logger.warn("Network shutdown requested on external firewall element, which did not implement the network." +
|
||||
" Either network implement failed half way through or already network shutdown is completed.");
|
||||
return true;
|
||||
}
|
||||
externalFirewall = _hostDao.findById(fwDeviceVO.getHostId());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -257,6 +257,9 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
|
|||
boolean dedicatedUse = (configParams.get(ApiConstants.LOAD_BALANCER_DEVICE_DEDICATED) != null) ? Boolean.parseBoolean(configParams.get(ApiConstants.LOAD_BALANCER_DEVICE_DEDICATED)) : false;
|
||||
boolean inline = (configParams.get(ApiConstants.INLINE) != null) ? Boolean.parseBoolean(configParams.get(ApiConstants.INLINE)) : false;
|
||||
long capacity = NumbersUtil.parseLong((String) configParams.get(ApiConstants.LOAD_BALANCER_DEVICE_CAPACITY), 0);
|
||||
if (capacity == 0) {
|
||||
capacity = _defaultLbCapacity;
|
||||
}
|
||||
|
||||
txn.start();
|
||||
ExternalLoadBalancerDeviceVO lbDeviceVO = new ExternalLoadBalancerDeviceVO(host.getId(), pNetwork.getId(), ntwkSvcProvider.getProviderName(),
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.IdentityService;
|
||||
import com.cloud.api.PlugService;
|
||||
import com.cloud.api.commands.AddNetworkDeviceCmd;
|
||||
import com.cloud.api.commands.DeleteNetworkDeviceCmd;
|
||||
|
|
@ -69,12 +70,14 @@ import com.cloud.network.resource.NetscalerResource;
|
|||
import com.cloud.network.rules.dao.PortForwardingRulesDao;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDao;
|
||||
import com.cloud.resource.ServerResource;
|
||||
import com.cloud.server.ManagementServer;
|
||||
import com.cloud.server.api.response.NetworkDeviceResponse;
|
||||
import com.cloud.server.api.response.NwDeviceDhcpResponse;
|
||||
import com.cloud.server.api.response.PxePingResponse;
|
||||
import com.cloud.user.AccountManager;
|
||||
import com.cloud.user.dao.AccountDao;
|
||||
import com.cloud.user.dao.UserStatisticsDao;
|
||||
import com.cloud.utils.component.ComponentLocator;
|
||||
import com.cloud.utils.component.Inject;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.vm.dao.DomainRouterDao;
|
||||
|
|
@ -116,6 +119,7 @@ public class ExternalNetworkDeviceManagerImpl implements ExternalNetworkDeviceMa
|
|||
|
||||
ScheduledExecutorService _executor;
|
||||
int _externalNetworkStatsInterval;
|
||||
private final static IdentityService _identityService = (IdentityService)ComponentLocator.getLocator(ManagementServer.Name).getManager(IdentityService.class);
|
||||
|
||||
private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalNetworkDeviceManagerImpl.class);
|
||||
protected String _name;
|
||||
|
|
@ -151,8 +155,10 @@ public class ExternalNetworkDeviceManagerImpl implements ExternalNetworkDeviceMa
|
|||
Collection paramsCollection = paramList.values();
|
||||
HashMap params = (HashMap) (paramsCollection.toArray())[0];
|
||||
if (cmd.getDeviceType().equalsIgnoreCase(NetworkDevice.ExternalDhcp.getName())) {
|
||||
Long zoneId = Long.parseLong((String) params.get(ApiConstants.ZONE_ID));
|
||||
Long podId = Long.parseLong((String)params.get(ApiConstants.POD_ID));
|
||||
//Long zoneId = _identityService.getIdentityId("data_center", (String) params.get(ApiConstants.ZONE_ID));
|
||||
//Long podId = _identityService.getIdentityId("host_pod_ref", (String)params.get(ApiConstants.POD_ID));
|
||||
Long zoneId = Long.valueOf((String) params.get(ApiConstants.ZONE_ID));
|
||||
Long podId = Long.valueOf((String)params.get(ApiConstants.POD_ID));
|
||||
String type = (String) params.get(ApiConstants.DHCP_SERVER_TYPE);
|
||||
String url = (String) params.get(ApiConstants.URL);
|
||||
String username = (String) params.get(ApiConstants.USERNAME);
|
||||
|
|
@ -162,6 +168,8 @@ public class ExternalNetworkDeviceManagerImpl implements ExternalNetworkDeviceMa
|
|||
} else if (cmd.getDeviceType().equalsIgnoreCase(NetworkDevice.PxeServer.getName())) {
|
||||
Long zoneId = Long.parseLong((String) params.get(ApiConstants.ZONE_ID));
|
||||
Long podId = Long.parseLong((String)params.get(ApiConstants.POD_ID));
|
||||
//Long zoneId = _identityService.getIdentityId("data_center", (String) params.get(ApiConstants.ZONE_ID));
|
||||
//Long podId = _identityService.getIdentityId("host_pod_ref", (String)params.get(ApiConstants.POD_ID));
|
||||
String type = (String) params.get(ApiConstants.PXE_SERVER_TYPE);
|
||||
String url = (String) params.get(ApiConstants.URL);
|
||||
String username = (String) params.get(ApiConstants.USERNAME);
|
||||
|
|
|
|||
|
|
@ -1738,7 +1738,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
DeployDestination dest, ReservationContext context) throws InsufficientCapacityException,
|
||||
ConcurrentOperationException, ResourceUnavailableException {
|
||||
element.prepare(network, profile, vmProfile, dest, context);
|
||||
if (vmProfile.getType() == Type.User && element.getProvider() != null) {
|
||||
if (vmProfile.getType() == Type.User && vmProfile.getHypervisorType() != HypervisorType.BareMetal && element.getProvider() != null) {
|
||||
if (areServicesSupportedInNetwork(network.getId(), Service.Dhcp) &&
|
||||
isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, element.getProvider()) &&
|
||||
(element instanceof DhcpServiceProvider)) {
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ public class StorageNetworkManagerImpl implements StorageNetworkManager, Storage
|
|||
StorageNetworkIpRangeVO range = null;
|
||||
|
||||
txn.start();
|
||||
range = new StorageNetworkIpRangeVO(zoneId, podId, nw.getId(), startIp, endIp, vlan, netmask);
|
||||
range = new StorageNetworkIpRangeVO(zoneId, podId, nw.getId(), startIp, endIp, vlan, netmask, cmd.getGateWay());
|
||||
_sNwIpRangeDao.persist(range);
|
||||
try {
|
||||
createStorageIpEntires(txn, range.getId(), startIp, endIp, zoneId);
|
||||
|
|
|
|||
|
|
@ -93,5 +93,7 @@ public interface NetworkDao extends GenericDao<NetworkVO, Long> {
|
|||
List<NetworkVO> listByZoneAndTrafficType(long zoneId, TrafficType trafficType);
|
||||
|
||||
void setCheckForGc(long networkId);
|
||||
|
||||
int getNetworkCountByNetworkOffId(long networkOfferingId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,13 +60,16 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
|
|||
final SearchBuilder<NetworkVO> ZoneSecurityGroupSearch;
|
||||
final GenericSearchBuilder<NetworkVO, Long> CountByOfferingId;
|
||||
final SearchBuilder<NetworkVO> PhysicalNetworkSearch;
|
||||
final SearchBuilder<NetworkVO> securityGroupSearch;
|
||||
final SearchBuilder<NetworkVO> SecurityGroupSearch;
|
||||
private final GenericSearchBuilder<NetworkVO, Integer> NetworksCount;
|
||||
|
||||
|
||||
NetworkAccountDaoImpl _accountsDao = ComponentLocator.inject(NetworkAccountDaoImpl.class);
|
||||
NetworkDomainDaoImpl _domainsDao = ComponentLocator.inject(NetworkDomainDaoImpl.class);
|
||||
NetworkOpDaoImpl _opDao = ComponentLocator.inject(NetworkOpDaoImpl.class);
|
||||
NetworkServiceMapDaoImpl _ntwkSvcMap = ComponentLocator.inject(NetworkServiceMapDaoImpl.class);
|
||||
|
||||
|
||||
final TableGenerator _tgMacAddress;
|
||||
Random _rand = new Random(System.currentTimeMillis());
|
||||
long _prefix = 0x2;
|
||||
|
|
@ -132,11 +135,16 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
|
|||
PhysicalNetworkSearch.and("physicalNetworkId", PhysicalNetworkSearch.entity().getPhysicalNetworkId(), Op.EQ);
|
||||
PhysicalNetworkSearch.done();
|
||||
|
||||
securityGroupSearch = createSearchBuilder();
|
||||
SecurityGroupSearch = createSearchBuilder();
|
||||
SearchBuilder<NetworkServiceMapVO> join3 = _ntwkSvcMap.createSearchBuilder();
|
||||
join3.and("service", join3.entity().getService(), Op.EQ);
|
||||
securityGroupSearch.join("services", join3, securityGroupSearch.entity().getId(), join3.entity().getNetworkId(), JoinBuilder.JoinType.INNER);
|
||||
securityGroupSearch.done();
|
||||
SecurityGroupSearch.join("services", join3, SecurityGroupSearch.entity().getId(), join3.entity().getNetworkId(), JoinBuilder.JoinType.INNER);
|
||||
SecurityGroupSearch.done();
|
||||
|
||||
NetworksCount = createSearchBuilder(Integer.class);
|
||||
NetworksCount.select(null, Func.COUNT, NetworksCount.entity().getId());
|
||||
NetworksCount.and("networkOfferingId", NetworksCount.entity().getNetworkOfferingId(), SearchCriteria.Op.EQ);
|
||||
NetworksCount.done();
|
||||
|
||||
_tgMacAddress = _tgs.get("macAddress");
|
||||
|
||||
|
|
@ -344,7 +352,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
|
|||
|
||||
@Override
|
||||
public List<NetworkVO> listSecurityGroupEnabledNetworks() {
|
||||
SearchCriteria<NetworkVO> sc = securityGroupSearch.create();
|
||||
SearchCriteria<NetworkVO> sc = SecurityGroupSearch.create();
|
||||
sc.setJoinParameters("services", "service", Service.SecurityGroup.getName());
|
||||
return listBy(sc);
|
||||
}
|
||||
|
|
@ -400,5 +408,13 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
|
|||
|
||||
return listBy(sc, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNetworkCountByNetworkOffId(long networkOfferingId) {
|
||||
SearchCriteria<Integer> sc = NetworksCount.create();
|
||||
sc.setParameters("networkOfferingId", networkOfferingId);
|
||||
List<Integer> count = customSearch(sc, null);
|
||||
return count.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ public class PhysicalNetworkTrafficTypeDaoImpl extends GenericDaoBase<PhysicalNe
|
|||
sc = simulatorAllFieldsSearch.create();
|
||||
} else if (hType == HypervisorType.Ovm) {
|
||||
sc = ovmAllFieldsSearch.create();
|
||||
} else if (hType == HypervisorType.BareMetal) {
|
||||
return null;
|
||||
} else {
|
||||
assert(false) : "We don't handle this hypervisor type";
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class ExternalDhcpElement extends AdapterBase implements NetworkElement,
|
|||
private static Map<Service, Map<Capability, String>> setCapabilities() {
|
||||
// No external dhcp support for Acton release
|
||||
Map<Service, Map<Capability, String>> capabilities = new HashMap<Service, Map<Capability, String>>();
|
||||
// capabilities.put(Service.Dhcp, null);
|
||||
//capabilities.put(Service.Dhcp, null);
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,8 @@ public class JuniperSRXExternalFirewallElement extends ExternalFirewallDeviceMan
|
|||
return manageGuestNetworkWithExternalFirewall(true, network);
|
||||
} catch (InsufficientCapacityException capacityException) {
|
||||
// TODO: handle out of capacity exception in more gracefule manner when multiple providers are present for
|
||||
// the network
|
||||
// the network
|
||||
s_logger.error("Fail to implement the JuniperSRX for network " + network, capacityException);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -422,7 +423,7 @@ public class JuniperSRXExternalFirewallElement extends ExternalFirewallDeviceMan
|
|||
if (fwDeviceVO == null || !fwDeviceVO.getDeviceName().equalsIgnoreCase(NetworkDevice.JuniperSRXFirewall.getName())) {
|
||||
throw new InvalidParameterValueException("No SRX firewall device found with ID: " + fwDeviceId);
|
||||
}
|
||||
return deleteExternalFirewall(fwDeviceId);
|
||||
return deleteExternalFirewall(fwDeviceVO.getHostId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import com.cloud.exception.InsufficientCapacityException;
|
|||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.Network.Capability;
|
||||
import com.cloud.network.Network.Provider;
|
||||
|
|
@ -169,7 +170,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
@Override
|
||||
public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException,
|
||||
InsufficientCapacityException, ResourceUnavailableException {
|
||||
if (vm.getType() != VirtualMachine.Type.User) {
|
||||
if (vm.getType() != VirtualMachine.Type.User || vm.getHypervisorType() == HypervisorType.BareMetal) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
|
|||
nic.setMacAddress(NetUtils.long2Mac(NetUtils.createSequenceBasedMacAddress(ip.getMac())));
|
||||
nic.setFormat(AddressFormat.Ip4);
|
||||
nic.setNetmask(ip.getNetmask());
|
||||
nic.setBroadcastType(BroadcastDomainType.Storage);
|
||||
nic.setBroadcastType(BroadcastDomainType.Storage);
|
||||
nic.setGateway(ip.getGateway());
|
||||
if (vlan != null) {
|
||||
nic.setBroadcastUri(BroadcastDomainType.Storage.toUri(vlan));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
String instance = "DEFAULT";
|
||||
String component = c.getComponent();
|
||||
String value = c.getDefaultValue();
|
||||
value = ("Hidden".equals(category)) ? DBEncryptionUtil.encrypt(value) : value;
|
||||
value = ("Hidden".equals(category) || "Secure".equals(category)) ? DBEncryptionUtil.encrypt(value) : value;
|
||||
String description = c.getDescription();
|
||||
ConfigurationVO configVO = new ConfigurationVO(category, instance, component, name, value, description);
|
||||
_configDao.persist(configVO);
|
||||
|
|
|
|||
|
|
@ -1090,6 +1090,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
} else if (nic.getTrafficType() == TrafficType.Storage) {
|
||||
buf.append(" storageip=").append(nic.getIp4Address());
|
||||
buf.append(" storagenetmask=").append(nic.getNetmask());
|
||||
buf.append(" storagegateway=").append(nic.getGateway());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -668,8 +668,6 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
|||
} else {
|
||||
s_logger.warn("Failed to back up snapshot on secondary storage, deleting the record from the DB");
|
||||
_snapshotDao.remove(snapshotId);
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, 0L);
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
txn.commit();
|
||||
|
||||
|
|
@ -741,7 +739,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
|||
Account caller = UserContext.current().getCaller();
|
||||
|
||||
// Verify parameters
|
||||
Snapshot snapshotCheck = _snapshotDao.findByIdIncludingRemoved(snapshotId);
|
||||
Snapshot snapshotCheck = _snapshotDao.findById(snapshotId);
|
||||
if (snapshotCheck == null) {
|
||||
throw new InvalidParameterValueException("unable to find a snapshot with id " + snapshotId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ public class Upgrade2214to30 implements DbUpgrade {
|
|||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pstmt = conn.prepareStatement("select name, value from configuration where category = 'Hidden'");
|
||||
pstmt = conn.prepareStatement("select name, value from configuration where category in ('Hidden', 'Secure')");
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
String name = rs.getString(1);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
|||
"vm_template.enable_password, service_offering.id, disk_offering.name, storage_pool.id, storage_pool.pool_type, " +
|
||||
"service_offering.cpu, service_offering.speed, service_offering.ram_size, volumes.id, volumes.device_id, volumes.volume_type, security_group.id, security_group.name, " +
|
||||
"security_group.description, nics.id, nics.ip4_address, nics.default_nic, nics.gateway, nics.network_id, nics.netmask, nics.mac_address, nics.broadcast_uri, nics.isolation_uri, " +
|
||||
"networks.traffic_type, networks.guest_type from vm_instance " +
|
||||
"networks.traffic_type, networks.guest_type, user_ip_address.id, user_ip_address.public_ip_address from vm_instance " +
|
||||
"left join account on vm_instance.account_id=account.id " +
|
||||
"left join domain on vm_instance.domain_id=domain.id " +
|
||||
"left join instance_group_vm_map on vm_instance.id=instance_group_vm_map.instance_id " +
|
||||
|
|
@ -99,6 +99,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
|||
"left join security_group on security_group_vm_map.security_group_id=security_group.id " +
|
||||
"left join nics on vm_instance.id=nics.instance_id " +
|
||||
"left join networks on nics.network_id=networks.id " +
|
||||
"left join user_ip_address on user_ip_address.vm_id=vm_instance.id " +
|
||||
"where vm_instance.id in (";
|
||||
|
||||
private static final int VM_DETAILS_BATCH_SIZE=100;
|
||||
|
|
@ -516,6 +517,13 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
|||
nicResponse.setObjectName("nic");
|
||||
userVmData.addNic(nicResponse);
|
||||
}
|
||||
|
||||
long publicIpId = rs.getLong("user_ip_address.id");
|
||||
if (publicIpId > 0){
|
||||
userVmData.setPublicIpId(publicIpId);
|
||||
userVmData.setPublicIp(rs.getString("user_ip_address.public_ip_address"));
|
||||
}
|
||||
|
||||
return userVmData;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ public class UserVmData {
|
|||
private Set<NicData> nics;
|
||||
private String hypervisor;
|
||||
private long accountId;
|
||||
private Long publicIpId;
|
||||
private String publicIp;
|
||||
|
||||
private boolean initialized;
|
||||
|
||||
|
|
@ -684,10 +686,21 @@ public class UserVmData {
|
|||
public void setAccountId(long accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Long getPublicIpId() {
|
||||
return publicIpId;
|
||||
}
|
||||
|
||||
public void setPublicIpId(Long publicIpId) {
|
||||
this.publicIpId = publicIpId;
|
||||
}
|
||||
|
||||
public String getPublicIp() {
|
||||
return publicIp;
|
||||
}
|
||||
|
||||
public void setPublicIp(String publicIp) {
|
||||
this.publicIp = publicIp;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -586,6 +586,7 @@ CREATE TABLE `cloud`.`dc_storage_network_ip_range` (
|
|||
`uuid` varchar(40),
|
||||
`start_ip` char(40) NOT NULL COMMENT 'start ip address',
|
||||
`end_ip` char(40) NOT NULL COMMENT 'end ip address',
|
||||
`gateway` varchar(15) NOT NULL COMMENT 'gateway ip address',
|
||||
`vlan` int unsigned DEFAULT NULL COMMENT 'vlan the storage network on',
|
||||
`netmask` varchar(15) NOT NULL COMMENT 'netmask for storage network',
|
||||
`data_center_id` bigint unsigned NOT NULL,
|
||||
|
|
|
|||
|
|
@ -647,6 +647,7 @@ UPDATE `cloud`.`configuration` SET category = 'Hidden' WHERE name = 'kvm.private
|
|||
UPDATE `cloud`.`configuration` SET category = 'Hidden' WHERE name = 'kvm.guest.network.device';
|
||||
|
||||
ALTER TABLE `cloud`.`physical_network_traffic_types` ADD COLUMN `ovm_network_label` varchar(255) COMMENT 'The network name label of the physical device dedicated to this traffic on a Ovm host';
|
||||
ALTER TABLE `cloud`.`dc_storage_network_ip_range` ADD COLUMN `gateway` varchar(15) NOT NULL COMMENT 'gateway ip address';
|
||||
|
||||
CREATE TABLE `cloud_usage`.`usage_security_group` (
|
||||
`zone_id` bigint unsigned NOT NULL,
|
||||
|
|
|
|||
|
|
@ -163,12 +163,12 @@ class deployDataCenters():
|
|||
def configureProviders(self, phynetwrk, zone):
|
||||
pnetprov = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
|
||||
pnetprov.physicalnetworkid = phynetwrk.id
|
||||
pnetprov.state = "Enabled"
|
||||
pnetprov.state = "Disabled"
|
||||
pnetprov.name = "VirtualRouter"
|
||||
vrprov = self.apiClient.listNetworkServiceProviders(pnetprov)
|
||||
pnetprovres = self.apiClient.listNetworkServiceProviders(pnetprov)
|
||||
|
||||
vrprov = listVirtualRouterElements.listVirtualRouterElementsCmd()
|
||||
vrprov.nspid = vrprov.id
|
||||
vrprov.nspid = pnetprovres[0].id
|
||||
vrprovresponse = self.apiClient.listVirtualRouterElements(vrprov)
|
||||
vrprovid = vrprovresponse[0].id
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ class deployDataCenters():
|
|||
vrconfigresponse = \
|
||||
self.apiClient.configureVirtualRouterElement(vrconfig)
|
||||
|
||||
if zone.securitygroupenabled:
|
||||
if zone.networktype == "Basic" and zone.securitygroupenabled:
|
||||
sgprovider = configGenerator.provider()
|
||||
sgprovider.name = "SecurityGroupProvider"
|
||||
zone.providers.append(sgprovider)
|
||||
|
|
@ -209,7 +209,13 @@ class deployDataCenters():
|
|||
traffic_type = addTrafficType.addTrafficTypeCmd()
|
||||
traffic_type.physicalnetworkid = physical_network_id
|
||||
traffic_type.traffictype = traffictype
|
||||
self.apiClient.addTrafficType(traffic_type)
|
||||
return self.apiClient.addTrafficType(traffic_type)
|
||||
|
||||
def enableZone(self, zoneid, allocation_state="Enabled"):
|
||||
zoneCmd = updateZone.updateZoneCmd()
|
||||
zoneCmd.zoneid = zoneid
|
||||
zoneCmd.allocationstate = allocation_state
|
||||
return self.apiClient.updateZone(zoneCmd)
|
||||
|
||||
def createZones(self, zones):
|
||||
for zone in zones:
|
||||
|
|
@ -263,6 +269,7 @@ class deployDataCenters():
|
|||
zoneId)
|
||||
|
||||
self.createSecondaryStorages(zone.secondaryStorages, zoneId)
|
||||
return self.enableZone(zoneId, "Enabled")
|
||||
|
||||
def registerApiKey(self):
|
||||
listuser = listUsers.listUsersCmd()
|
||||
|
|
|
|||
|
|
@ -236,6 +236,27 @@ body.login {
|
|||
box-shadow: 0px 3px 5px #D5D5D5;
|
||||
}
|
||||
|
||||
.login .select-language {
|
||||
margin-top: 10px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.login .select-language select {
|
||||
width: 125px;
|
||||
border: 1px solid #808080;
|
||||
/*+border-radius:4px;*/
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
font-size: 12px;
|
||||
/*+box-shadow:inset 0px 1px 1px #838383;*/
|
||||
-moz-box-shadow: inset 0px 1px 1px #838383;
|
||||
-webkit-box-shadow: inset 0px 1px 1px #838383;
|
||||
-o-box-shadow: inset 0px 1px 1px #838383;
|
||||
box-shadow: inset 0px 1px 1px #838383;
|
||||
}
|
||||
|
||||
.login .fields {
|
||||
width: 409px;
|
||||
float: left;
|
||||
|
|
@ -4471,6 +4492,12 @@ label.error {
|
|||
border: 1px solid #E0DFDF;
|
||||
}
|
||||
|
||||
.multi-wizard.instance-wizard .service-offering .content {
|
||||
width: 463px;
|
||||
max-height: 365px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.multi-wizard .content .section .select-area {
|
||||
width: 334px;
|
||||
height: 45px;
|
||||
|
|
|
|||
25
ui/index.jsp
25
ui/index.jsp
|
|
@ -50,6 +50,14 @@
|
|||
|
||||
<!-- Submit (login) -->
|
||||
<input type="submit" value="" />
|
||||
|
||||
<!-- Select language -->
|
||||
<div class="select-language">
|
||||
<select name="language">
|
||||
<option value="en"><fmt:message key="label.lang.english"/></option>
|
||||
<option value="ja"><fmt:message key="label.lang.japanese"/></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -577,7 +585,8 @@
|
|||
</ul>
|
||||
|
||||
<div class="info-desc" id="add_zone_public_traffic_desc">
|
||||
|
||||
<span id="for_basic_zone" style="display:none"><fmt:message key="message.public.traffic.in.basic.zone"/></span>
|
||||
<span id="for_advanced_zone" style="display:none"><fmt:message key="message.public.traffic.in.advanced.zone"/></span>
|
||||
</div>
|
||||
<div ui-custom="publicTrafficIPRange"></div>
|
||||
</div>
|
||||
|
|
@ -615,7 +624,8 @@
|
|||
</ul>
|
||||
|
||||
<div class="info-desc" id="add_zone_guest_traffic_desc">
|
||||
|
||||
<span id="for_basic_zone" style="display:none"><fmt:message key="message.guest.traffic.in.basic.zone"/></span>
|
||||
<span id="for_advanced_zone" style="display:none"><fmt:message key="message.guest.traffic.in.advanced.zone"/></span>
|
||||
</div>
|
||||
<div class="content input-area">
|
||||
<div class="select-container"></div>
|
||||
|
|
@ -675,7 +685,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Step 4.3: Add primary storage -->
|
||||
<div class="add-cluster" zone-wizard-form="primaryStorage"
|
||||
<div class="add-cluster" zone-wizard-form="primaryStorage" zone-wizard-prefilter="addPrimaryStorage"
|
||||
zone-wizard-step-id="addPrimaryStorage">
|
||||
<ul class="subnav">
|
||||
<li class="cluster"><fmt:message key="label.cluster"/></li>
|
||||
|
|
@ -1604,6 +1614,15 @@
|
|||
|
||||
<script language="javascript">
|
||||
dictionary = {
|
||||
'state.Stopping': '<fmt:message key="state.Stopping"/>',
|
||||
'message.add.load.balancer.under.ip': '<fmt:message key="message.add.load.balancer.under.ip"/>',
|
||||
'message.select.instance': '<fmt:message key="message.select.instance"/>',
|
||||
'label.select': '<fmt:message key="label.select"/>',
|
||||
'label.select.vm.for.static.nat': '<fmt:message key="label.select.vm.for.static.nat"/>',
|
||||
'label.select.instance': '<fmt:message key="label.select.instance"/>',
|
||||
'label.nat.port.range': '<fmt:message key="label.nat.port.range"/>',
|
||||
'label.static.nat.vm.details': '<fmt:message key="label.static.nat.vm.details"/>',
|
||||
'label.edit.lb.rule': '<fmt:message key="label.edit.lb.rule"/>',
|
||||
'message.migrate.instance.to.host': '<fmt:message key="message.migrate.instance.to.host"/>',
|
||||
'label.migrate.instance.to.host': '<fmt:message key="label.migrate.instance.to.host"/>',
|
||||
'message.migrate.instance.to.ps': '<fmt:message key="message.migrate.instance.to.ps"/>',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
(function(cloudStack) {
|
||||
|
||||
var rootDomainId = 1;
|
||||
|
||||
var domainObjs;
|
||||
var rootDomainId;
|
||||
|
||||
var systemAccountId = 1;
|
||||
var adminAccountId = 2;
|
||||
|
|
@ -100,10 +101,13 @@
|
|||
async: false,
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
var domainObjs = json.listdomainsresponse.domain;
|
||||
domainObjs = json.listdomainsresponse.domain;
|
||||
$(domainObjs).each(function() {
|
||||
items.push({id: this.id, description: this.path});
|
||||
});
|
||||
|
||||
if(this.level == 0)
|
||||
rootDomainId = this.id;
|
||||
});
|
||||
args.response.success({data: items});
|
||||
}
|
||||
});
|
||||
|
|
@ -159,8 +163,8 @@
|
|||
account = args.data.username;
|
||||
array1.push("&account=" + todb(account));
|
||||
|
||||
var accountType = args.data.accounttype;
|
||||
if (args.data.accounttype == "1" && parseInt(args.data.domainid) != rootDomainId) //if account type is admin, but domain is not Root domain
|
||||
var accountType = args.data.accounttype;
|
||||
if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) //if account type is admin, but domain is not Root domain
|
||||
accountType = "2"; // Change accounttype from root-domain("1") to domain-admin("2")
|
||||
array1.push("&accounttype=" + accountType);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
label: 'state.Destroyed'
|
||||
}
|
||||
},
|
||||
fields: {
|
||||
name: { label: 'label.name', editable: true },
|
||||
fields: {
|
||||
displayname: { label: 'label.display.name' },
|
||||
zonename: { label: 'label.zone.name' },
|
||||
state: {
|
||||
|
|
@ -560,7 +559,7 @@
|
|||
return 'message.action.start.instance';
|
||||
},
|
||||
notification: function(args) {
|
||||
return 'message.notification.start.instance';
|
||||
return 'label.action.start.instance';
|
||||
}
|
||||
},
|
||||
notification: {
|
||||
|
|
@ -611,7 +610,7 @@
|
|||
},
|
||||
|
||||
notification: function(args) {
|
||||
return 'message.notification.stop.instance';
|
||||
return 'label.action.stop.instance';
|
||||
}
|
||||
},
|
||||
notification: {
|
||||
|
|
@ -647,7 +646,7 @@
|
|||
return 'message.action.reboot.instance';
|
||||
},
|
||||
notification: function(args) {
|
||||
return 'message.notification.reboot.instance';
|
||||
return 'instances.actions.reboot.label';
|
||||
}
|
||||
},
|
||||
notification: {
|
||||
|
|
@ -1488,12 +1487,9 @@
|
|||
},
|
||||
|
||||
fields: [
|
||||
{
|
||||
name: { label: 'label.name', isEditable: false }
|
||||
},
|
||||
{
|
||||
{
|
||||
id: { label: 'label.id', isEditable: false },
|
||||
displayname: { label: 'label.display.name', isEditable: true },
|
||||
displayname: { label: 'label.display.name', isEditable: true },
|
||||
state: { label: 'label.state', isEditable: false },
|
||||
zonename: { label: 'label.zone.name', isEditable: false },
|
||||
hypervisor: { label: 'label.hypervisor', isEditable: false },
|
||||
|
|
@ -1531,7 +1527,8 @@
|
|||
},
|
||||
domain: { label: 'label.domain', isEditable: false },
|
||||
account: { label: 'label.account', isEditable: false },
|
||||
created: { label: 'label.created', isEditable: false, converter: cloudStack.converters.toLocalDate }
|
||||
created: { label: 'label.created', isEditable: false, converter: cloudStack.converters.toLocalDate },
|
||||
name: { label: 'label.name', isEditable: false }
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
preFilter: function(args) {
|
||||
var havingSecurityGroupNetwork = false;
|
||||
$.ajax({
|
||||
url: createURL('listNetworks'),
|
||||
url: createURL('listNetworks', { ignoreProject: true }),
|
||||
data: {
|
||||
supportedServices: 'SecurityGroup',
|
||||
listAll: true
|
||||
|
|
@ -166,8 +166,6 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
networkOfferingId: {
|
||||
label: 'label.network.offering',
|
||||
|
|
@ -433,11 +431,27 @@
|
|||
createForm: {
|
||||
title: 'label.restart.network',
|
||||
desc: 'message.restart.network',
|
||||
fields: {
|
||||
preFilter: function(args) {
|
||||
var zoneObj;
|
||||
$.ajax({
|
||||
url: createURL("listZones&id=" + args.context.networks[0].zoneid),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json){
|
||||
zoneObj = json.listzonesresponse.zone[0];
|
||||
}
|
||||
});
|
||||
if(zoneObj.networktype == "Basic")
|
||||
args.$form.find('.form-item[rel=cleanup]').hide();
|
||||
else
|
||||
args.$form.find('.form-item[rel=cleanup]').css('display', 'inline-block');
|
||||
},
|
||||
fields: {
|
||||
cleanup: {
|
||||
label: 'label.clean.up',
|
||||
isBoolean: true,
|
||||
isChecked: false
|
||||
isChecked: false,
|
||||
isHidden: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -447,7 +461,7 @@
|
|||
}
|
||||
},
|
||||
action: function(args) {
|
||||
var array1 = [];
|
||||
var array1 = [];
|
||||
array1.push("&cleanup=" + (args.data.cleanup == "on"));
|
||||
$.ajax({
|
||||
url: createURL("restartNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
||||
|
|
@ -567,6 +581,7 @@
|
|||
hiddenFields.push("networkofferingdisplaytext");
|
||||
hiddenFields.push("networkdomaintext");
|
||||
hiddenFields.push("gateway");
|
||||
hiddenFields.push("networkofferingname");
|
||||
//hiddenFields.push("netmask");
|
||||
}
|
||||
else { //selectedGuestNetworkObj.type == "Shared"
|
||||
|
|
@ -606,6 +621,8 @@
|
|||
},
|
||||
vlan: { label: 'VLAN ID' },
|
||||
|
||||
networkofferingname: { label: 'label.network.offering' },
|
||||
|
||||
networkofferingid: {
|
||||
label: 'label.network.offering',
|
||||
isEditable: true,
|
||||
|
|
@ -665,6 +682,13 @@
|
|||
if (args.context.networks[0].state == 'Destroyed')
|
||||
return [];
|
||||
|
||||
if (args.context.networks[0].type == 'Shared' ||
|
||||
!$.grep(args.context.networks[0].service, function(service) {
|
||||
return service.name == 'SourceNat';
|
||||
}).length) {
|
||||
return ['edit', 'restart'];
|
||||
}
|
||||
|
||||
return args.context.actions;
|
||||
},
|
||||
data: args.context.networks[0]
|
||||
|
|
@ -789,7 +813,7 @@
|
|||
jobId: jobID
|
||||
},
|
||||
notification: {
|
||||
label: 'Add load balancer rule',
|
||||
label: 'label.add.load.balancer',
|
||||
poll: function(args) {
|
||||
var complete = args.complete;
|
||||
var error = args.error;
|
||||
|
|
@ -803,7 +827,7 @@
|
|||
|
||||
lbCreationComplete = true;
|
||||
cloudStack.dialog.notice({
|
||||
message: "The load balancer rule has been added under IP " +
|
||||
message: _l('message.add.load.balancer.under.ip') +
|
||||
args.data.loadbalancer.publicip
|
||||
});
|
||||
|
||||
|
|
@ -1024,8 +1048,7 @@
|
|||
|
||||
var disabledTabs = [];
|
||||
var ipAddress = args.context.ipAddresses[0];
|
||||
if (!ipAddress.issourcenat ||
|
||||
(ipAddress.issourcenat && !ipAddress.vpnenabled)) {
|
||||
if (!ipAddress.vpnenabled) {
|
||||
disabledTabs.push('vpn');
|
||||
}
|
||||
if(ipAddress.iselastic == true) {
|
||||
|
|
@ -1296,7 +1319,7 @@
|
|||
},
|
||||
tabs: {
|
||||
details: {
|
||||
title: 'Details',
|
||||
title: 'label.details',
|
||||
fields: [
|
||||
{
|
||||
ipaddress: { label: 'IP' }
|
||||
|
|
@ -1721,17 +1744,18 @@
|
|||
}),
|
||||
multipleAdd: true,
|
||||
fields: {
|
||||
'name': { edit: true, label: 'label.name' },
|
||||
'name': { edit: true, label: 'label.name', isEditable: true },
|
||||
'publicport': { edit: true, label: 'label.public.port' },
|
||||
'privateport': { edit: true, label: 'label.private.port' },
|
||||
'algorithm': {
|
||||
label: 'label.algorithm',
|
||||
isEditable: true,
|
||||
select: function(args) {
|
||||
args.response.success({
|
||||
data: [
|
||||
{ name: 'roundrobin', description: _l('label.round.robin') },
|
||||
{ name: 'leastconn', description: _l('label.least.connections') },
|
||||
{ name: 'source', description: _l('label.source') }
|
||||
{ id: 'roundrobin', name: 'roundrobin', description: _l('label.round.robin') },
|
||||
{ id: 'leastconn', name: 'leastconn', description: _l('label.least.connections') },
|
||||
{ id: 'source', name: 'source', description: _l('label.source') }
|
||||
]
|
||||
});
|
||||
}
|
||||
|
|
@ -1798,7 +1822,7 @@
|
|||
jobId: jobID
|
||||
},
|
||||
notification: {
|
||||
label: 'Add load balancer rule',
|
||||
label: 'label.add.load.balancer',
|
||||
poll: function(args) {
|
||||
var complete = args.complete;
|
||||
var error = args.error;
|
||||
|
|
@ -1839,6 +1863,26 @@
|
|||
}
|
||||
},
|
||||
actions: {
|
||||
edit: {
|
||||
label: 'label.edit',
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('updateLoadBalancerRule'),
|
||||
data: $.extend(args.data, {
|
||||
id: args.context.multiRule[0].id
|
||||
}),
|
||||
success: function(json) {
|
||||
args.response.success({
|
||||
_custom: { jobId: json.updateloadbalancerruleresponse.jobid },
|
||||
notification: {
|
||||
label: 'label.edit.lb.rule',
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
destroy: {
|
||||
label: 'label.action.delete.load.balancer',
|
||||
action: function(args) {
|
||||
|
|
@ -1887,7 +1931,7 @@
|
|||
_custom: {
|
||||
jobId: json.assigntoloadbalancerruleresponse.jobid
|
||||
},
|
||||
desc: 'Add VM(s) to load balancer rule',
|
||||
desc: 'label.add.vms.to.lb',
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -583,6 +583,11 @@
|
|||
}
|
||||
|
||||
var apiCmd = "listProjects&page=" + args.page + "&pagesize=" + pageSize + array1.join("") + '&listAll=true';
|
||||
|
||||
if (isDomainAdmin()) {
|
||||
apiCmd += '&domainid=' + args.context.users[0].domainid;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL(apiCmd, { ignoreProject: true }),
|
||||
dataType: 'json',
|
||||
|
|
@ -767,8 +772,13 @@
|
|||
dataProvider: function(args) {
|
||||
var projectID = args.context.projects[0].id;
|
||||
|
||||
var url = 'listProjects';
|
||||
|
||||
if (isDomainAdmin()) {
|
||||
url += '&domainid=' + args.context.users[0].domainid;
|
||||
}
|
||||
$.ajax({
|
||||
url: createURL('listProjects'),
|
||||
url: createURL(url),
|
||||
data: {
|
||||
listAll: true,
|
||||
id: projectID
|
||||
|
|
|
|||
|
|
@ -220,13 +220,8 @@
|
|||
var jid = json.createsnapshotresponse.jobid;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
return json.queryasyncjobresultresponse.jobresult.snapshot;
|
||||
},
|
||||
getActionFilter: function() {
|
||||
return volumeActionfilter;
|
||||
}
|
||||
{
|
||||
jobId: jid //take snapshot from a volume doesn't change any property in this volume. So, don't need to specify getUpdatedItem() to return updated volume. Besides, createSnapshot API doesn't return updated volume.
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -499,7 +499,8 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
'gateway': { edit: true, label: 'label.gateway' },
|
||||
'netmask': { edit: true, label: 'label.netmask' },
|
||||
'vlan': { edit: true, label: 'label.vlan', isOptional: true },
|
||||
'startip': { edit: true, label: 'label.start.IP' },
|
||||
|
|
@ -513,6 +514,8 @@
|
|||
array1.push("&zoneId=" + args.context.zones[0].id);
|
||||
array1.push("&podid=" + args.data.podid);
|
||||
|
||||
array1.push("&gateway=" + args.data.gateway);
|
||||
|
||||
if (args.data.vlan != null && args.data.vlan.length > 0)
|
||||
array1.push("&vlan=" + todb(args.data.vlan));
|
||||
|
||||
|
|
@ -1143,7 +1146,8 @@
|
|||
var $form = args.$form;
|
||||
|
||||
var array1 = [];
|
||||
array1.push("&zoneId=" + selectedZoneObj.id);
|
||||
array1.push("&zoneId=" + selectedZoneObj.id);
|
||||
array1.push("&physicalnetworkid=" + selectedPhysicalNetworkObj.id);
|
||||
array1.push("&name=" + todb(args.data.name));
|
||||
array1.push("&displayText=" + todb(args.data.description));
|
||||
array1.push("&networkOfferingId=" + args.data.networkOfferingId);
|
||||
|
|
@ -1220,10 +1224,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
//need to make 2 listNetworks API call to get all networks
|
||||
//need to make 2 listNetworks API call to get all guest networks from one physical network in Advanced zone
|
||||
var items = [];
|
||||
$.ajax({
|
||||
url: createURL("listNetworks&listAll=true&trafficType=Guest&zoneId=" + selectedZoneObj.id + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
|
||||
url: createURL("listNetworks&listAll=true&trafficType=Guest&zoneId=" + selectedZoneObj.id + "&physicalnetworkid=" + selectedPhysicalNetworkObj.id + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
|
|
@ -1238,7 +1242,7 @@
|
|||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL("listNetworks&projectid=-1&trafficType=Guest&zoneId=" + selectedZoneObj.id + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
|
||||
url: createURL("listNetworks&projectid=-1&trafficType=Guest&zoneId=" + selectedZoneObj.id + "&physicalnetworkid=" + selectedPhysicalNetworkObj.id + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
|
|
@ -1588,11 +1592,11 @@
|
|||
vlan: { label: 'label.vlan.range' }
|
||||
}
|
||||
},
|
||||
dataProvider: function(args) {
|
||||
cloudStack.sections.system.naas.networkProviders.statusCheck({
|
||||
context: args.context
|
||||
});
|
||||
|
||||
dataProvider: function(args) {
|
||||
//Comment out next line which causes Bug 13852 (Unable to configure multiple physical networks with service providers of the same device type).
|
||||
//cloudStack.sections.system.naas.networkProviders.statusCheck({ context: args.context});
|
||||
//Bug 13852 appears when there are multiple physical networks. Shouldn't call statusCheck() to render network provider chart before a physical network is selected.
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listPhysicalNetworks'),
|
||||
data: {
|
||||
|
|
@ -1641,17 +1645,8 @@
|
|||
securityGroups: 'not-configured'
|
||||
};
|
||||
|
||||
selectedZoneObj = args.context.physicalResources[0];
|
||||
$.ajax({
|
||||
url: createURL("listPhysicalNetworks&zoneId=" + selectedZoneObj.id),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listphysicalnetworksresponse.physicalnetwork;
|
||||
selectedPhysicalNetworkObj = items[0];
|
||||
}
|
||||
});
|
||||
|
||||
//selectedZoneObj = args.context.physicalResources[0];
|
||||
|
||||
$.ajax({
|
||||
url: createURL("listNetworkServiceProviders&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
|
||||
dataType: "json",
|
||||
|
|
@ -4237,7 +4232,7 @@
|
|||
},
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("deleteSrcFirewall&fwdeviceid=" + args.context.srxProviders[0].fwdeviceid),
|
||||
url: createURL("deleteSrxFirewall&fwdeviceid=" + args.context.srxProviders[0].fwdeviceid),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
|
|
|
|||
|
|
@ -1220,7 +1220,7 @@
|
|||
//if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)))
|
||||
if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner
|
||||
|| (jsonObj.isready == false && jsonObj.status != null && jsonObj.status.indexOf("Downloaded") != -1)
|
||||
|| (jsonObj.domainid == 1 && jsonObj.account == "system")) {
|
||||
|| (jsonObj.account == "system")) {
|
||||
//do nothing
|
||||
}
|
||||
else {
|
||||
|
|
@ -1279,7 +1279,7 @@
|
|||
//if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)))
|
||||
if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner
|
||||
|| (jsonObj.isready == false && jsonObj.status != null && jsonObj.status.indexOf("Downloaded") != -1)
|
||||
|| (jsonObj.domainid == 1 && jsonObj.account == "system")
|
||||
|| (jsonObj.account == "system")
|
||||
) {
|
||||
//do nothing
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
instances.listView.actions = {
|
||||
select: {
|
||||
label: 'Select instance',
|
||||
label: _l('label.select.instance'),
|
||||
type: 'radio',
|
||||
action: {
|
||||
uiCustom: function(args) {
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
$listView = $('<div>').listView(instances);
|
||||
|
||||
// Change action label
|
||||
$listView.find('th.actions').html('Select');
|
||||
$listView.find('th.actions').html(_l('label.select'));
|
||||
|
||||
return $listView;
|
||||
};
|
||||
|
|
@ -52,16 +52,16 @@
|
|||
}).dialog({
|
||||
dialogClass: 'multi-edit-add-list panel',
|
||||
width: 825,
|
||||
title: 'Select VM for Static NAT',
|
||||
title: _l('label.select.vm.for.static.nat'),
|
||||
buttons: [
|
||||
{
|
||||
text: 'Apply',
|
||||
text: _l('label.apply'),
|
||||
'class': 'ok',
|
||||
click: function() {
|
||||
if (!$dataList.find(
|
||||
'input[type=radio]:checked, input[type=checkbox]:checked'
|
||||
).size()) {
|
||||
cloudStack.dialog.notice({ message: 'Please select an instance '});
|
||||
cloudStack.dialog.notice({ message: _l('message.select.instance')});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
text: 'Cancel',
|
||||
text: _l('label.cancel'),
|
||||
'class': 'cancel',
|
||||
click: function() {
|
||||
$dataList.fadeOut(function() {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
$vmName.click(function() {
|
||||
$browser.cloudBrowser('addPanel', {
|
||||
title: 'Static NAT VM Details',
|
||||
title: _l('label.static.nat.vm.details'),
|
||||
complete: function($newPanel) {
|
||||
vmDataProvider({
|
||||
context: context,
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
if(includingFirewall == true) {
|
||||
$chart.find('li.firewall .view-details').click(function() {
|
||||
makeMultiEditPanel($(this), { title: 'NAT Port Range'});
|
||||
makeMultiEditPanel($(this), { title: _l('label.nat.port.range')});
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -82,5 +82,13 @@
|
|||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Select language
|
||||
var $languageSelect = $login.find('select[name=language]');
|
||||
$languageSelect.change(function() {
|
||||
$.cookie('lang', $(this).val());
|
||||
document.location.reload();
|
||||
});
|
||||
$languageSelect.val($.cookie('lang'));
|
||||
};
|
||||
})(jQuery, cloudStack);
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@
|
|||
var $storageTrafficItem = $(storageTrafficItem);
|
||||
var storageTrafficData = {};
|
||||
var fields = [
|
||||
'gateway',
|
||||
'netmask',
|
||||
'vlanid',
|
||||
'startip',
|
||||
|
|
|
|||
|
|
@ -165,7 +165,12 @@
|
|||
}
|
||||
);
|
||||
},
|
||||
error: function(args) {
|
||||
error: function(args) { //args here is parsed errortext from API response
|
||||
if(args != null & args.length > 0) {
|
||||
cloudStack.dialog.notice({
|
||||
message: args
|
||||
});
|
||||
}
|
||||
$loading.remove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,10 +202,69 @@
|
|||
.append($('<span>').addClass('icon'))
|
||||
.attr({ title: _l(action.label) })
|
||||
.click(function() {
|
||||
var performAction = function(actionOptions) {
|
||||
if (!actionOptions) actionOptions = {};
|
||||
|
||||
action.action({
|
||||
context: $.extend(true, {}, options.context, {
|
||||
multiRule: [data]
|
||||
}),
|
||||
data: actionOptions.data,
|
||||
response: {
|
||||
success: function(args) {
|
||||
var notification = args ? args.notification : null;
|
||||
var _custom = args ? args._custom : null;
|
||||
if (notification) {
|
||||
$('.notifications').notifications('add', {
|
||||
section: 'network',
|
||||
desc: notification.label,
|
||||
interval: 3000,
|
||||
_custom: _custom,
|
||||
poll: function(args) {
|
||||
var complete = args.complete;
|
||||
var error = args.error;
|
||||
|
||||
notification.poll({
|
||||
_custom: args._custom,
|
||||
complete: function(args) {
|
||||
if (isDestroy) {
|
||||
$loading.remove();
|
||||
$dataItem.remove();
|
||||
} else {
|
||||
$multi.trigger('refresh');
|
||||
}
|
||||
|
||||
complete();
|
||||
|
||||
if (actionOptions.complete) actionOptions.complete();
|
||||
},
|
||||
error: function(args) {
|
||||
error(args);
|
||||
$loading.remove();
|
||||
$dataItem.show();
|
||||
|
||||
return cloudStack.dialog.error;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$loading.remove();
|
||||
if (isDestroy) {
|
||||
$dataItem.remove();
|
||||
}
|
||||
}
|
||||
},
|
||||
error: cloudStack.dialog.error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var $target = $(this);
|
||||
var $dataItem = $target.closest('.data-item');
|
||||
var $expandable = $dataItem.find('.expandable-listing');
|
||||
var isDestroy = $target.hasClass('destroy');
|
||||
var isEdit = $target.hasClass('edit');
|
||||
|
||||
if (isDestroy) {
|
||||
var $loading = _medit.loadingItem($multi, _l('label.removing') + '...');
|
||||
|
|
@ -222,56 +281,32 @@
|
|||
}
|
||||
}
|
||||
|
||||
action.action({
|
||||
context: $.extend(true, {}, options.context, {
|
||||
multiRule: [data]
|
||||
}),
|
||||
response: {
|
||||
success: function(args) {
|
||||
var notification = args ? args.notification : null;
|
||||
var _custom = args ? args._custom : null;
|
||||
if (notification) {
|
||||
$('.notifications').notifications('add', {
|
||||
section: 'network',
|
||||
desc: notification.label,
|
||||
interval: 3000,
|
||||
_custom: _custom,
|
||||
poll: function(args) {
|
||||
var complete = args.complete;
|
||||
var error = args.error;
|
||||
if (!isEdit) {
|
||||
performAction();
|
||||
} else {
|
||||
// Get editable fields
|
||||
var editableFields = {};
|
||||
|
||||
notification.poll({
|
||||
_custom: args._custom,
|
||||
complete: function(args) {
|
||||
if (isDestroy) {
|
||||
$loading.remove();
|
||||
$dataItem.remove();
|
||||
} else {
|
||||
$multi.trigger('refresh');
|
||||
}
|
||||
$.each(fields, function(key, field) {
|
||||
if (field.isEditable) editableFields[key] = $.extend(true, {}, field, {
|
||||
defaultValue: data[key]
|
||||
});
|
||||
});
|
||||
|
||||
complete();
|
||||
},
|
||||
error: function(args) {
|
||||
error(args);
|
||||
$loading.remove();
|
||||
$dataItem.show();
|
||||
|
||||
return cloudStack.dialog.error;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$loading.remove();
|
||||
if (isDestroy) {
|
||||
$dataItem.remove();
|
||||
}
|
||||
}
|
||||
cloudStack.dialog.createForm({
|
||||
form: {
|
||||
title: 'Edit rule',
|
||||
desc: '',
|
||||
fields: editableFields
|
||||
},
|
||||
error: cloudStack.dialog.error
|
||||
}
|
||||
});
|
||||
after: function(args) {
|
||||
var $loading = $('<div>').addClass('loading-overlay').prependTo($dataItem);
|
||||
performAction({ data: args.data, complete: function() {
|
||||
$multi.multiEdit('refresh');
|
||||
} });
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
var selectedNetworkOfferingHavingEIP = false;
|
||||
var selectedNetworkOfferingHavingELB = false;
|
||||
var returnedPublicVlanIpRanges = []; //public VlanIpRanges returned by API
|
||||
|
||||
var configurationUseLocalStorage = false;
|
||||
|
||||
cloudStack.zoneWizard = {
|
||||
customUI: {
|
||||
publicTrafficIPRange: function(args) {
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
|
||||
return $('<div>').multiEdit({
|
||||
context: args.context,
|
||||
noSelect: true,
|
||||
noSelect: true,
|
||||
fields: {
|
||||
'gateway': { edit: true, label: 'label.gateway' },
|
||||
'netmask': { edit: true, label: 'label.netmask' },
|
||||
|
|
@ -60,6 +61,7 @@
|
|||
context: args.context,
|
||||
noSelect: true,
|
||||
fields: {
|
||||
'gateway': { edit: true, label: 'label.gateway' },
|
||||
'netmask': { edit: true, label: 'label.netmask' },
|
||||
'vlanid': { edit: true, label: 'label.vlan', isOptional: true },
|
||||
'startip': { edit: true, label: 'label.start.IP' },
|
||||
|
|
@ -98,8 +100,9 @@
|
|||
},
|
||||
|
||||
preFilters: {
|
||||
addPublicNetwork: function(args) {
|
||||
addPublicNetwork: function(args) {
|
||||
var isShown;
|
||||
var $publicTrafficDesc = $('.zone-wizard:visible').find('#add_zone_public_traffic_desc');
|
||||
if(args.data['network-model'] == 'Basic') {
|
||||
if(selectedNetworkOfferingHavingSG == true && selectedNetworkOfferingHavingEIP == true && selectedNetworkOfferingHavingELB == true) {
|
||||
$('.conditional.elb').show();
|
||||
|
|
@ -108,11 +111,17 @@
|
|||
else {
|
||||
$('.conditional.elb').hide();
|
||||
isShown = false;
|
||||
}
|
||||
}
|
||||
|
||||
$publicTrafficDesc.find('#for_basic_zone').css('display', 'inline');
|
||||
$publicTrafficDesc.find('#for_advanced_zone').hide();
|
||||
}
|
||||
else { //args.data['network-model'] == 'Advanced'
|
||||
$('.conditional.elb').hide();
|
||||
isShown = true;
|
||||
isShown = true;
|
||||
|
||||
$publicTrafficDesc.find('#for_advanced_zone').css('display', 'inline');
|
||||
$publicTrafficDesc.find('#for_basic_zone').hide();
|
||||
}
|
||||
return isShown;
|
||||
},
|
||||
|
|
@ -149,7 +158,33 @@
|
|||
|
||||
addHost: function(args) {
|
||||
return (args.groupedData.cluster.hypervisor != "VMware");
|
||||
}
|
||||
},
|
||||
|
||||
addPrimaryStorage: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("listConfigurations&name=" + todb("use.local.storage")),
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listconfigurationsresponse.configuration; //unfortunately, it returns 2 items("system.vm.use.local.storage", "use.local.storage") instead of 1 item.
|
||||
if(items != null && items.length > 0) {
|
||||
for(var i = 0; i < items.length; i++) {
|
||||
item = items[i];
|
||||
if(item.name == "use.local.storage") {
|
||||
break; //break for loop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(item == null || item.value == "false")
|
||||
configurationUseLocalStorage = false;
|
||||
else
|
||||
configurationUseLocalStorage = true;
|
||||
|
||||
return (!configurationUseLocalStorage);
|
||||
}
|
||||
},
|
||||
|
||||
forms: {
|
||||
|
|
@ -367,7 +402,17 @@
|
|||
},
|
||||
|
||||
guestTraffic: {
|
||||
preFilter: function(args) {
|
||||
preFilter: function(args) {
|
||||
var $guestTrafficDesc = $('.zone-wizard:visible').find('#add_zone_guest_traffic_desc');
|
||||
if (args.data['network-model'] == 'Basic') {
|
||||
$guestTrafficDesc.find('#for_basic_zone').css('display', 'inline');
|
||||
$guestTrafficDesc.find('#for_advanced_zone').hide();
|
||||
}
|
||||
else { //args.data['network-model'] == 'Advanced'
|
||||
$guestTrafficDesc.find('#for_advanced_zone').css('display', 'inline');
|
||||
$guestTrafficDesc.find('#for_basic_zone').hide();
|
||||
}
|
||||
|
||||
var selectedZoneObj = {
|
||||
networktype: args.data['network-model']
|
||||
};
|
||||
|
|
@ -649,13 +694,13 @@
|
|||
fields: {
|
||||
name: {
|
||||
label: 'label.name',
|
||||
validation: { required: false } // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
},
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
protocol: {
|
||||
label: 'label.protocol',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
select: function(args) {
|
||||
validation: { required: true },
|
||||
select: function(args) {
|
||||
var selectedClusterObj = {
|
||||
hypervisortype: args.context.zones[0].hypervisor
|
||||
};
|
||||
|
|
@ -871,53 +916,53 @@
|
|||
},
|
||||
server: {
|
||||
label: 'label.server',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
isHidden: true
|
||||
validation: { required: true },
|
||||
isHidden: true
|
||||
},
|
||||
|
||||
//nfs
|
||||
path: {
|
||||
label: 'label.path',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
isHidden: true
|
||||
validation: { required: true },
|
||||
isHidden: true
|
||||
},
|
||||
|
||||
//iscsi
|
||||
iqn: {
|
||||
label: 'label.target.iqn',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
isHidden: true
|
||||
validation: { required: true },
|
||||
isHidden: true
|
||||
},
|
||||
lun: {
|
||||
label: 'label.LUN.number',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
isHidden: true
|
||||
validation: { required: true },
|
||||
isHidden: true
|
||||
},
|
||||
|
||||
//clvm
|
||||
volumegroup: {
|
||||
label: 'label.volgroup',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
isHidden: true
|
||||
validation: { required: true },
|
||||
isHidden: true
|
||||
},
|
||||
|
||||
//vmfs
|
||||
vCenterDataCenter: {
|
||||
label: 'label.vcenter.datacenter',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
isHidden: true
|
||||
validation: { required: true },
|
||||
isHidden: true
|
||||
},
|
||||
vCenterDataStore: {
|
||||
label: 'label.vcenter.datastore',
|
||||
validation: { required: false }, // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
isHidden: true
|
||||
validation: { required: true },
|
||||
isHidden: true
|
||||
},
|
||||
|
||||
//always appear (begin)
|
||||
storageTags: {
|
||||
label: 'label.storage.tags',
|
||||
validation: { required: false } // Primary storage is not required. User can use local storage instead of primary storage.
|
||||
}
|
||||
validation: { required: false }
|
||||
}
|
||||
//always appear (end)
|
||||
}
|
||||
},
|
||||
|
|
@ -2319,9 +2364,8 @@
|
|||
});
|
||||
},
|
||||
|
||||
addPrimaryStorage: function(args) {
|
||||
var server = args.data.primaryStorage.server;
|
||||
if(server == null || server.length == 0) {
|
||||
addPrimaryStorage: function(args) {
|
||||
if(configurationUseLocalStorage == true) { //use local storage, don't need primary storage. So, skip this step.
|
||||
stepFns.addSecondaryStorage({
|
||||
data: args.data
|
||||
});
|
||||
|
|
@ -2336,6 +2380,7 @@
|
|||
array1.push("&clusterid=" + args.data.returnedCluster.id);
|
||||
array1.push("&name=" + todb(args.data.primaryStorage.name));
|
||||
|
||||
var server = args.data.primaryStorage.server;
|
||||
var url = null;
|
||||
if (args.data.primaryStorage.protocol == "nfs") {
|
||||
//var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ public class EncryptionSecretKeyChanger {
|
|||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pstmt = conn.prepareStatement("select name, value from configuration where category = 'Hidden'");
|
||||
pstmt = conn.prepareStatement("select name, value from configuration where category in ('Hidden', 'Secure')");
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
String name = rs.getString(1);
|
||||
|
|
|
|||
|
|
@ -1242,7 +1242,13 @@ public class VirtualMachineMO extends BaseMO {
|
|||
out.close();
|
||||
|
||||
// tar files into OVA
|
||||
if(packToOva) {
|
||||
if(packToOva) {
|
||||
// Important! we need to sync file system before we can safely use tar to work around a linux kernal bug(or feature)
|
||||
s_logger.info("Sync file system before we package OVA...");
|
||||
|
||||
Script commandSync = new Script(true, "sync", 0, s_logger);
|
||||
commandSync.execute();
|
||||
|
||||
Script command = new Script(false, "tar", 0, s_logger);
|
||||
command.setWorkDir(exportDir);
|
||||
command.add("-cf", exportName + ".ova");
|
||||
|
|
@ -1250,13 +1256,16 @@ public class VirtualMachineMO extends BaseMO {
|
|||
for(String name: fileNames) {
|
||||
command.add((new File(name).getName()));
|
||||
}
|
||||
|
||||
String result = command.execute();
|
||||
if(result == null) {
|
||||
success = true;
|
||||
|
||||
s_logger.info("Package OVA with commmand: " + command.toString());
|
||||
command.execute();
|
||||
|
||||
// to be safe, physically test existence of the target OVA file
|
||||
if((new File(exportDir + File.separator + exportName + ".ova")).exists()) {
|
||||
success = true;
|
||||
} else {
|
||||
s_logger.error("failed to execute command: " + command.toString());
|
||||
}
|
||||
s_logger.error(exportDir + File.separator + exportName + ".ova is not created as expected");
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Throwable e) {
|
||||
|
|
@ -1270,10 +1279,8 @@ public class VirtualMachineMO extends BaseMO {
|
|||
}
|
||||
}
|
||||
|
||||
if(!success) {
|
||||
new File(exportDir + File.separator + exportName + ".ova").delete();
|
||||
if(!success)
|
||||
throw new Exception("Unable to finish the whole process to package as a OVA file");
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in New Issue