mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Merge branch 'main' into nsx-integration
This commit is contained in:
commit
42300aa80e
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
|
||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -193,7 +193,7 @@ jobs:
|
||||
"component/test_vpc_network_lbrules" ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
2
.github/workflows/codecov.yml
vendored
2
.github/workflows/codecov.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
name: codecov
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ jobs:
|
||||
- name: Set Docker repository name
|
||||
run: echo "DOCKER_REPOSITORY=apache" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set ACS version
|
||||
run: echo "ACS_VERSION=$(grep '<version>' pom.xml | head -2 | tail -1 | cut -d'>' -f2 |cut -d'<' -f1)" >> $GITHUB_ENV
|
||||
|
||||
2
.github/workflows/linter.yml
vendored
2
.github/workflows/linter.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Check Out
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Install
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
2
.github/workflows/main-sonar-check.yml
vendored
2
.github/workflows/main-sonar-check.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
name: Main Sonar JaCoCo Build
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
2
.github/workflows/rat.yml
vendored
2
.github/workflows/rat.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
|
||||
2
.github/workflows/sonar-check.yml
vendored
2
.github/workflows/sonar-check.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
||||
name: Sonar JaCoCo Coverage
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event.number }}/merge"
|
||||
fetch-depth: 0
|
||||
|
||||
2
.github/workflows/ui.yml
vendored
2
.github/workflows/ui.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
|
||||
@ -32,8 +32,10 @@ repos:
|
||||
- id: check-case-conflict
|
||||
#- id: check-executables-have-shebangs
|
||||
- id: check-merge-conflict
|
||||
- id: check-symlinks
|
||||
- id: check-vcs-permalinks
|
||||
#- id: check-yaml
|
||||
- id: destroyed-symlinks
|
||||
- id: detect-private-key
|
||||
exclude: >
|
||||
(?x)
|
||||
|
||||
@ -42,6 +42,7 @@ import javax.naming.ConfigurationException;
|
||||
|
||||
import com.cloud.resource.AgentStatusUpdater;
|
||||
import com.cloud.resource.ResourceStatusUpdater;
|
||||
import com.cloud.agent.api.PingAnswer;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import org.apache.cloudstack.agent.lb.SetupMSListAnswer;
|
||||
import org.apache.cloudstack.agent.lb.SetupMSListCommand;
|
||||
@ -842,6 +843,9 @@ public class Agent implements HandlerFactory, IAgentControl, AgentStatusUpdater
|
||||
listener.processControlResponse(response, (AgentControlAnswer)answer);
|
||||
}
|
||||
}
|
||||
} else if (answer instanceof PingAnswer && (((PingAnswer) answer).isSendStartup()) && _reconnectAllowed) {
|
||||
s_logger.info("Management server requested startup command to reinitialize the agent");
|
||||
sendStartup(link);
|
||||
} else {
|
||||
setLastPingResponseTime();
|
||||
}
|
||||
|
||||
@ -25,13 +25,104 @@ public class GPU {
|
||||
}
|
||||
|
||||
public enum GPUType {
|
||||
GRID_K100("GRID K100"),
|
||||
GRID_K120Q("GRID K120Q"),
|
||||
GRID_K140Q("GRID K140Q"),
|
||||
GRID_K200("GRID K200"),
|
||||
GRID_K220Q("GRID K220Q"),
|
||||
GRID_K240Q("GRID K240Q"),
|
||||
GRID_K260("GRID K260Q"),
|
||||
GRID_V100D_32A("GRID V100D-32A"),
|
||||
GRID_V100D_8Q("GRID V100D-8Q"),
|
||||
GRID_V100D_4A("GRID V100D-4A"),
|
||||
GRID_V100D_1B("GRID V100D-1B"),
|
||||
GRID_V100D_2Q("GRID V100D-2Q"),
|
||||
GRID_V100D_4Q("GRID V100D-4Q"),
|
||||
GRID_V100D_2A("GRID V100D-2A"),
|
||||
GRID_V100D_2B("GRID V100D-2B"),
|
||||
GRID_V100D_32Q("GRID V100D-32Q"),
|
||||
GRID_V100D_16A("GRID V100D-16A"),
|
||||
GRID_V100D_1Q("GRID V100D-1Q"),
|
||||
GRID_V100D_2B4("GRID V100D-2B4"),
|
||||
GRID_V100D_16Q("GRID V100D-16Q"),
|
||||
GRID_V100D_8A("GRID V100D-8A"),
|
||||
GRID_V100D_1A("GRID V100D-1A"),
|
||||
GRID_T4_16A("GRID T4-16A"),
|
||||
GRID_T4_2B4("GRID T4-2B4"),
|
||||
GRID_T4_4Q("GRID T4-4Q"),
|
||||
GRID_T4_16Q("GRID T4-16Q"),
|
||||
GRID_T4_4A("GRID T4-4A"),
|
||||
GRID_T4_1A("GRID T4-1A"),
|
||||
GRID_T4_2Q("GRID T4-2Q"),
|
||||
GRID_T4_2B("GRID T4-2B"),
|
||||
GRID_T4_8Q("GRID T4-8Q"),
|
||||
GRID_T4_2A("GRID T4-2A"),
|
||||
GRID_T4_1B("GRID T4-1B"),
|
||||
GRID_T4_1Q("GRID T4-1Q"),
|
||||
GRID_T4_8A("GRID T4-8A"),
|
||||
NVIDIA_RTX5500_1A("NVIDIA RTXA5500-1A"),
|
||||
NVIDIA_RTX5500_1B("NVIDIA RTXA5500-1B"),
|
||||
NVIDIA_RTX5500_1Q("NVIDIA RTXA5500-1Q"),
|
||||
NVIDIA_RTX5500_2A("NVIDIA RTXA5500-2A"),
|
||||
NVIDIA_RTX5500_2B("NVIDIA RTXA5500-2B"),
|
||||
NVIDIA_RTX5500_2Q("NVIDIA RTXA5500-2Q"),
|
||||
NVIDIA_RTX5500_3A("NVIDIA RTXA5500-3A"),
|
||||
NVIDIA_RTX5500_3Q("NVIDIA RTXA5500-3Q"),
|
||||
NVIDIA_RTX5500_4A("NVIDIA RTXA5500-4A"),
|
||||
NVIDIA_RTX5500_4Q("NVIDIA RTXA5500-4Q"),
|
||||
NVIDIA_RTX5500_6A("NVIDIA RTXA5500-6A"),
|
||||
NVIDIA_RTX5500_6Q("NVIDIA RTXA5500-6Q"),
|
||||
NVIDIA_RTX5500_8A("NVIDIA RTXA5500-8A"),
|
||||
NVIDIA_RTX5500_8Q("NVIDIA RTXA5500-8Q"),
|
||||
NVIDIA_RTX5500_12A("NVIDIA RTXA5500-12A"),
|
||||
NVIDIA_RTX5500_12Q("NVIDIA RTXA5500-12Q"),
|
||||
NVIDIA_RTX5500_24A("NVIDIA RTXA5500-24A"),
|
||||
NVIDIA_RTX5500_24Q("NVIDIA RTXA5500-24Q"),
|
||||
NVIDIA_A40_1A("NVIDIA A40-1A"),
|
||||
NVIDIA_A40_1B("NVIDIA A40-1B"),
|
||||
NVIDIA_A40_1Q("NVIDIA A40-1Q"),
|
||||
NVIDIA_A40_2A("NVIDIA A40-2A"),
|
||||
NVIDIA_A40_2B("NVIDIA A40-2B"),
|
||||
NVIDIA_A40_2Q("NVIDIA A40-2Q"),
|
||||
NVIDIA_A40_3A("NVIDIA A40-3A"),
|
||||
NVIDIA_A40_3Q("NVIDIA A40-3Q"),
|
||||
NVIDIA_A40_4A("NVIDIA A40-4A"),
|
||||
NVIDIA_A40_4Q("NVIDIA A40-4Q"),
|
||||
NVIDIA_A40_6A("NVIDIA A40-6A"),
|
||||
NVIDIA_A40_6Q("NVIDIA A40-6Q"),
|
||||
NVIDIA_A40_8A("NVIDIA A40-8A"),
|
||||
NVIDIA_A40_8Q("NVIDIA A40-8Q"),
|
||||
NVIDIA_A40_12A("NVIDIA A40-12A"),
|
||||
NVIDIA_A40_12Q("NVIDIA A40-12Q"),
|
||||
NVIDIA_A40_16A("NVIDIA A40-16A"),
|
||||
NVIDIA_A40_16Q("NVIDIA A40-16Q"),
|
||||
NVIDIA_A40_24A("NVIDIA A40-24A"),
|
||||
NVIDIA_A40_24Q("NVIDIA A40-24Q"),
|
||||
NVIDIA_A40_48A("NVIDIA A40-48A"),
|
||||
NVIDIA_A40_48Q("NVIDIA A40-48Q"),
|
||||
NVIDIA_A2_1A("NVIDIA A2-1A"),
|
||||
NVIDIA_A2_1B("NVIDIA A2-1B"),
|
||||
NVIDIA_A2_1Q("NVIDIA A2-1Q"),
|
||||
NVIDIA_A2_2A("NVIDIA A2-2A"),
|
||||
NVIDIA_A2_2B("NVIDIA A2-2B"),
|
||||
NVIDIA_A2_2Q("NVIDIA A2-2Q"),
|
||||
NVIDIA_A2_4A("NVIDIA A2-4A"),
|
||||
NVIDIA_A2_4Q("NVIDIA A2-4Q"),
|
||||
NVIDIA_A2_8A("NVIDIA A2-8A"),
|
||||
NVIDIA_A2_8Q("NVIDIA A2-8Q"),
|
||||
NVIDIA_A2_16A("NVIDIA A2-16A"),
|
||||
NVIDIA_A2_16Q("NVIDIA A2-16Q"),
|
||||
NVIDIA_A10_1A("NVIDIA A10-1A"),
|
||||
NVIDIA_A10_1B("NVIDIA A10-1B"),
|
||||
NVIDIA_A10_1Q("NVIDIA A10-1Q"),
|
||||
NVIDIA_A10_2A("NVIDIA A10-2A"),
|
||||
NVIDIA_A10_2B("NVIDIA A10-2B"),
|
||||
NVIDIA_A10_2Q("NVIDIA A10-2Q"),
|
||||
NVIDIA_A10_3A("NVIDIA A10-3A"),
|
||||
NVIDIA_A10_3Q("NVIDIA A10-3Q"),
|
||||
NVIDIA_A10_4A("NVIDIA A10-4A"),
|
||||
NVIDIA_A10_4Q("NVIDIA A10-4Q"),
|
||||
NVIDIA_A10_6A("NVIDIA A10-6A"),
|
||||
NVIDIA_A10_6Q("NVIDIA A10-6Q"),
|
||||
NVIDIA_A10_8A("NVIDIA A10-8A"),
|
||||
NVIDIA_A10_8Q("NVIDIA A10-8Q"),
|
||||
NVIDIA_A10_12A("NVIDIA A10-12A"),
|
||||
NVIDIA_A10_12Q("NVIDIA A10-12Q"),
|
||||
NVIDIA_A10_24A("NVIDIA A10-24A"),
|
||||
NVIDIA_A10_24Q("NVIDIA A10-24Q"),
|
||||
passthrough("passthrough");
|
||||
|
||||
private String type;
|
||||
|
||||
@ -48,8 +48,7 @@ public class CreateRoleCmd extends RoleCmd {
|
||||
description = "ID of the role to be cloned from. Either roleid or type must be passed in")
|
||||
private Long roleId;
|
||||
|
||||
@Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "Indicates whether the role will be visible to all users (public) or only to root admins (private)." +
|
||||
" If this parameter is not specified during the creation of the role its value will be defaulted to true (public).")
|
||||
@Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "Indicates whether the role will be visible to all users (public) or only to root admins (private). Default is true.")
|
||||
private boolean publicRole = true;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@ -64,7 +64,7 @@ public class DeleteHostCmd extends BaseCmd {
|
||||
return (forced != null) ? forced : false;
|
||||
}
|
||||
|
||||
public boolean isForceDestoryLocalStorage() {
|
||||
public boolean isForceDestroyLocalStorage() {
|
||||
return (forceDestroyLocalStorage != null) ? forceDestroyLocalStorage : true;
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ public class DeleteHostCmd extends BaseCmd {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
boolean result = _resourceService.deleteHost(getId(), isForced(), isForceDestoryLocalStorage());
|
||||
boolean result = _resourceService.deleteHost(getId(), isForced(), isForceDestroyLocalStorage());
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
|
||||
@ -133,7 +133,7 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
throw new InvalidParameterValueException("Unable to find virtual machine ID: " + vmId);
|
||||
}
|
||||
|
||||
//check wether the given ip is valid ip or not
|
||||
//check whether the given ip is valid ip or not
|
||||
if (vmIp == null || !NetUtils.isValidIp4(vmIp)) {
|
||||
throw new InvalidParameterValueException("Invalid ip address "+ vmIp +" passed in vmidipmap for " +
|
||||
"vmid " + vmId);
|
||||
|
||||
@ -22,15 +22,26 @@ package com.cloud.agent.api;
|
||||
public class PingAnswer extends Answer {
|
||||
private PingCommand _command = null;
|
||||
|
||||
private boolean sendStartup = false;
|
||||
|
||||
protected PingAnswer() {
|
||||
}
|
||||
|
||||
public PingAnswer(PingCommand cmd) {
|
||||
public PingAnswer(PingCommand cmd, boolean sendStartup) {
|
||||
super(cmd);
|
||||
_command = cmd;
|
||||
this.sendStartup = sendStartup;
|
||||
}
|
||||
|
||||
public PingCommand getCommand() {
|
||||
return _command;
|
||||
}
|
||||
|
||||
public boolean isSendStartup() {
|
||||
return sendStartup;
|
||||
}
|
||||
|
||||
public void setSendStartup(boolean sendStartup) {
|
||||
this.sendStartup = sendStartup;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ import javax.naming.ConfigurationException;
|
||||
|
||||
import com.cloud.configuration.Config;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.db.GlobalLock;
|
||||
import org.apache.cloudstack.agent.lb.IndirectAgentLB;
|
||||
import org.apache.cloudstack.ca.CAManager;
|
||||
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
||||
@ -799,49 +800,65 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
return true;
|
||||
}
|
||||
|
||||
protected Status getNextStatusOnDisconnection(Host host, final Status.Event event) {
|
||||
final Status currentStatus = host.getStatus();
|
||||
Status nextStatus;
|
||||
if (currentStatus == Status.Down || currentStatus == Status.Alert || currentStatus == Status.Removed) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(String.format("Host %s is already %s", host.getUuid(), currentStatus));
|
||||
}
|
||||
nextStatus = currentStatus;
|
||||
} else {
|
||||
try {
|
||||
nextStatus = currentStatus.getNextStatus(event);
|
||||
} catch (final NoTransitionException e) {
|
||||
final String err = String.format("Cannot find next status for %s as current status is %s for agent %s", event, currentStatus, host.getUuid());
|
||||
s_logger.debug(err);
|
||||
throw new CloudRuntimeException(err);
|
||||
}
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(String.format("The next status of agent %s is %s, current status is %s", host.getUuid(), nextStatus, currentStatus));
|
||||
}
|
||||
}
|
||||
return nextStatus;
|
||||
}
|
||||
|
||||
protected boolean handleDisconnectWithoutInvestigation(final AgentAttache attache, final Status.Event event, final boolean transitState, final boolean removeAgent) {
|
||||
final long hostId = attache.getId();
|
||||
|
||||
s_logger.info("Host " + hostId + " is disconnecting with event " + event);
|
||||
Status nextStatus = null;
|
||||
final HostVO host = _hostDao.findById(hostId);
|
||||
if (host == null) {
|
||||
s_logger.warn("Can't find host with " + hostId);
|
||||
nextStatus = Status.Removed;
|
||||
} else {
|
||||
final Status currentStatus = host.getStatus();
|
||||
if (currentStatus == Status.Down || currentStatus == Status.Alert || currentStatus == Status.Removed) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Host " + hostId + " is already " + currentStatus);
|
||||
}
|
||||
nextStatus = currentStatus;
|
||||
} else {
|
||||
try {
|
||||
nextStatus = currentStatus.getNextStatus(event);
|
||||
} catch (final NoTransitionException e) {
|
||||
final String err = "Cannot find next status for " + event + " as current status is " + currentStatus + " for agent " + hostId;
|
||||
s_logger.debug(err);
|
||||
throw new CloudRuntimeException(err);
|
||||
boolean result = false;
|
||||
GlobalLock joinLock = getHostJoinLock(hostId);
|
||||
if (joinLock.lock(60)) {
|
||||
try {
|
||||
s_logger.info(String.format("Host %d is disconnecting with event %s", hostId, event));
|
||||
Status nextStatus = null;
|
||||
final HostVO host = _hostDao.findById(hostId);
|
||||
if (host == null) {
|
||||
s_logger.warn(String.format("Can't find host with %d", hostId));
|
||||
nextStatus = Status.Removed;
|
||||
} else {
|
||||
nextStatus = getNextStatusOnDisconnection(host, event);
|
||||
caService.purgeHostCertificate(host);
|
||||
}
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("The next status of agent " + hostId + "is " + nextStatus + ", current status is " + currentStatus);
|
||||
s_logger.debug(String.format("Deregistering link for %d with state %s", hostId, nextStatus));
|
||||
}
|
||||
|
||||
removeAgent(attache, nextStatus);
|
||||
|
||||
if (host != null && transitState) {
|
||||
// update the state for host in DB as per the event
|
||||
disconnectAgent(host, event, _nodeId);
|
||||
}
|
||||
} finally {
|
||||
joinLock.unlock();
|
||||
}
|
||||
caService.purgeHostCertificate(host);
|
||||
result = true;
|
||||
}
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Deregistering link for " + hostId + " with state " + nextStatus);
|
||||
}
|
||||
|
||||
removeAgent(attache, nextStatus);
|
||||
// update the DB
|
||||
if (host != null && transitState) {
|
||||
disconnectAgent(host, event, _nodeId);
|
||||
}
|
||||
|
||||
return true;
|
||||
joinLock.releaseRef();
|
||||
return result;
|
||||
}
|
||||
|
||||
protected boolean handleDisconnectWithInvestigation(final AgentAttache attache, Status.Event event) {
|
||||
@ -1102,26 +1119,23 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
return attache;
|
||||
}
|
||||
|
||||
private AgentAttache handleConnectedAgent(final Link link, final StartupCommand[] startup, final Request request) {
|
||||
AgentAttache attache = null;
|
||||
ReadyCommand ready = null;
|
||||
try {
|
||||
final List<String> agentMSHostList = new ArrayList<>();
|
||||
String lbAlgorithm = null;
|
||||
if (startup != null && startup.length > 0) {
|
||||
final String agentMSHosts = startup[0].getMsHostList();
|
||||
if (StringUtils.isNotEmpty(agentMSHosts)) {
|
||||
String[] msHosts = agentMSHosts.split("@");
|
||||
if (msHosts.length > 1) {
|
||||
lbAlgorithm = msHosts[1];
|
||||
}
|
||||
agentMSHostList.addAll(Arrays.asList(msHosts[0].split(",")));
|
||||
private AgentAttache sendReadyAndGetAttache(HostVO host, ReadyCommand ready, Link link, StartupCommand[] startup) throws ConnectionException {
|
||||
final List<String> agentMSHostList = new ArrayList<>();
|
||||
String lbAlgorithm = null;
|
||||
if (startup != null && startup.length > 0) {
|
||||
final String agentMSHosts = startup[0].getMsHostList();
|
||||
if (StringUtils.isNotEmpty(agentMSHosts)) {
|
||||
String[] msHosts = agentMSHosts.split("@");
|
||||
if (msHosts.length > 1) {
|
||||
lbAlgorithm = msHosts[1];
|
||||
}
|
||||
agentMSHostList.addAll(Arrays.asList(msHosts[0].split(",")));
|
||||
}
|
||||
|
||||
final HostVO host = _resourceMgr.createHostVOForConnectedAgent(startup);
|
||||
if (host != null) {
|
||||
ready = new ReadyCommand(host.getDataCenterId(), host.getId(), NumbersUtil.enableHumanReadableSizes);
|
||||
}
|
||||
AgentAttache attache = null;
|
||||
GlobalLock joinLock = getHostJoinLock(host.getId());
|
||||
if (joinLock.lock(60)) {
|
||||
try {
|
||||
|
||||
if (!indirectAgentLB.compareManagementServerList(host.getId(), host.getDataCenterId(), agentMSHostList, lbAlgorithm)) {
|
||||
final List<String> newMSList = indirectAgentLB.getManagementServerList(host.getId(), host.getDataCenterId(), null);
|
||||
@ -1133,6 +1147,24 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
|
||||
attache = createAttacheForConnect(host, link);
|
||||
attache = notifyMonitorsOfConnection(attache, startup, false);
|
||||
} finally {
|
||||
joinLock.unlock();
|
||||
}
|
||||
} else {
|
||||
throw new ConnectionException(true, "Unable to acquire lock on host " + host.getUuid());
|
||||
}
|
||||
joinLock.releaseRef();
|
||||
return attache;
|
||||
}
|
||||
|
||||
private AgentAttache handleConnectedAgent(final Link link, final StartupCommand[] startup, final Request request) {
|
||||
AgentAttache attache = null;
|
||||
ReadyCommand ready = null;
|
||||
try {
|
||||
final HostVO host = _resourceMgr.createHostVOForConnectedAgent(startup);
|
||||
if (host != null) {
|
||||
ready = new ReadyCommand(host.getDataCenterId(), host.getId(), NumbersUtil.enableHumanReadableSizes);
|
||||
attache = sendReadyAndGetAttache(host, ready, link, startup);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
s_logger.debug("Failed to handle host connection: ", e);
|
||||
@ -1312,6 +1344,8 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
connectAgent(link, cmds, request);
|
||||
}
|
||||
return;
|
||||
} else if (cmd instanceof StartupCommand) {
|
||||
connectAgent(link, cmds, request);
|
||||
}
|
||||
|
||||
final long hostId = attache.getId();
|
||||
@ -1366,13 +1400,15 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
handleCommands(attache, request.getSequence(), new Command[] {cmd});
|
||||
if (cmd instanceof PingCommand) {
|
||||
final long cmdHostId = ((PingCommand)cmd).getHostId();
|
||||
boolean requestStartupCommand = false;
|
||||
|
||||
final HostVO host = _hostDao.findById(Long.valueOf(cmdHostId));
|
||||
boolean gatewayAccessible = true;
|
||||
// if the router is sending a ping, verify the
|
||||
// gateway was pingable
|
||||
if (cmd instanceof PingRoutingCommand) {
|
||||
processPingRoutingCommand((PingRoutingCommand) cmd, hostId);
|
||||
final boolean gatewayAccessible = ((PingRoutingCommand)cmd).isGatewayAccessible();
|
||||
final HostVO host = _hostDao.findById(Long.valueOf(cmdHostId));
|
||||
gatewayAccessible = ((PingRoutingCommand)cmd).isGatewayAccessible();
|
||||
|
||||
if (host != null) {
|
||||
if (!gatewayAccessible) {
|
||||
@ -1391,7 +1427,10 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
s_logger.debug("Not processing " + PingRoutingCommand.class.getSimpleName() + " for agent id=" + cmdHostId + "; can't find the host in the DB");
|
||||
}
|
||||
}
|
||||
answer = new PingAnswer((PingCommand)cmd);
|
||||
if (host!= null && host.getStatus() != Status.Up && gatewayAccessible) {
|
||||
requestStartupCommand = true;
|
||||
}
|
||||
answer = new PingAnswer((PingCommand)cmd, requestStartupCommand);
|
||||
} else if (cmd instanceof ReadyAnswer) {
|
||||
final HostVO host = _hostDao.findById(attache.getId());
|
||||
if (host == null) {
|
||||
@ -1913,4 +1952,8 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
sendCommandToAgents(hostsPerZone, params);
|
||||
}
|
||||
}
|
||||
|
||||
private GlobalLock getHostJoinLock(Long hostId) {
|
||||
return GlobalLock.getInternLock(String.format("%s-%s", "Host-Join", hostId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ public class NetworkOfferingDaoImpl extends GenericDaoBase<NetworkOfferingVO, Lo
|
||||
}
|
||||
|
||||
/**
|
||||
* Persist L2 deafult Network offering
|
||||
* Persist L2 default Network offering
|
||||
*/
|
||||
private void persistL2DefaultNetworkOffering(String name, String displayText, boolean specifyVlan, boolean configDriveEnabled) {
|
||||
NetworkOfferingVO offering = new NetworkOfferingVO(name, displayText, TrafficType.Guest, false, specifyVlan,
|
||||
|
||||
@ -86,7 +86,7 @@ public class DatabaseIntegrityChecker extends AdapterBase implements SystemInteg
|
||||
boolean noDuplicate = true;
|
||||
StringBuffer helpInfo = new StringBuffer();
|
||||
String note =
|
||||
"DATABASE INTEGRITY ERROR\nManagement server detected there are some hosts connect to the same loacal storage, please contact CloudStack support team for solution. Below are detialed info, please attach all of them to CloudStack support. Thank you\n";
|
||||
"DATABASE INTEGRITY ERROR\nManagement server detected there are some hosts connect to the same local storage, please contact CloudStack support team for solution. Below are detailed info, please attach all of them to CloudStack support. Thank you\n";
|
||||
helpInfo.append(note);
|
||||
while (rs.next()) {
|
||||
try ( PreparedStatement sel_pstmt =
|
||||
|
||||
@ -1168,7 +1168,7 @@ public class Upgrade218to22 implements DbUpgrade {
|
||||
pstmt.executeUpdate();
|
||||
s_logger.debug("Upgraded userStatistcis with device_type=DomainRouter");
|
||||
|
||||
// update device_id infrormation
|
||||
// update device_id information
|
||||
try (
|
||||
PreparedStatement selectUserStatistics = conn.prepareStatement("SELECT id, account_id, data_center_id FROM user_statistics");
|
||||
ResultSet rs = selectUserStatistics.executeQuery();
|
||||
|
||||
@ -332,7 +332,7 @@ public class Upgrade224to225 implements DbUpgrade {
|
||||
pstmt.close();
|
||||
} catch (SQLException e) {
|
||||
s_logger.error("Unable to add missing foreign key; following statement was executed:" + pstmt);
|
||||
throw new CloudRuntimeException("Unable to add missign keys due to exception", e);
|
||||
throw new CloudRuntimeException("Unable to add missing keys due to exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ public class Upgrade224to225 implements DbUpgrade {
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
s_logger.error("Unable to add missing ovs tunnel account due to ", e);
|
||||
throw new CloudRuntimeException("Unable to add missign ovs tunnel account due to ", e);
|
||||
throw new CloudRuntimeException("Unable to add missing ovs tunnel account due to ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ public class Upgrade301to302 extends LegacyDbUpgrade {
|
||||
keys.add("i_host__allocation_state");
|
||||
uniqueKeys.put("host", keys);
|
||||
|
||||
s_logger.debug("Droping i_host__allocation_state key in host table");
|
||||
s_logger.debug("Dropping i_host__allocation_state key in host table");
|
||||
for (String tableName : uniqueKeys.keySet()) {
|
||||
DbUpgradeUtils.dropKeysIfExist(conn, tableName, uniqueKeys.get(tableName), false);
|
||||
}
|
||||
|
||||
@ -646,7 +646,7 @@ INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (88, 6, 'W
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (89, 6, 'Windows Server 2003 Standard Edition(32-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (90, 6, 'Windows Server 2003 Standard Edition(64-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (91, 6, 'Windows Server 2003 Web Edition');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (92, 6, 'Microsoft Small Bussiness Server 2003');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (92, 6, 'Microsoft Small Business Server 2003');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (93, 6, 'Windows XP (32-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (94, 6, 'Windows XP (64-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (95, 6, 'Windows 2000 Advanced Server');
|
||||
@ -779,7 +779,7 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (32-bit)', 89);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (64-bit)', 90);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Web Edition', 91);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Small Bussiness Server 2003', 92);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Small Business Server 2003', 92);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (32-bit)', 56);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (64-bit)', 101);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 93);
|
||||
|
||||
@ -77,6 +77,6 @@ update host_details set name='memory' where host_id in (select id from host wher
|
||||
update host_details set name='privateip' where host_id in (select id from host where hypervisor_type='BareMetal') and name='agentIp';
|
||||
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.root.disk.controller', 'ide', 'Specify the default disk controller for root volumes, valid values are scsi, ide');
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.destory.forcestop', 'false', 'On destory, force-stop takes this value');
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.destroy.forcestop', 'false', 'On destroy, force-stop takes this value');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.lock.timeout', '600', 'Lock wait timeout (seconds) while implementing network');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter','true','disable rp_filter on Domain Router VM public interfaces.');
|
||||
|
||||
@ -702,7 +702,7 @@ UPDATE `cloud`.`configuration` SET category = 'Usage' where name in ('usage.exec
|
||||
ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD CONSTRAINT `fk_op_dc_vnet_alloc__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE;
|
||||
ALTER TABLE `cloud`.`domain` ADD COLUMN `type` varchar(255) NOT NULL DEFAULT 'Normal' COMMENT 'type of the domain - can be Normal or Project';
|
||||
|
||||
UPDATE `cloud`.`configuration` SET name='vm.destroy.forcestop' where name='vm.destory.forcestop';
|
||||
UPDATE `cloud`.`configuration` SET name='vm.destroy.forcestop' where name='vm.destroy.forcestop';
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.destroy.forcestop', 'false', 'On destroy, force-stop takes this value');
|
||||
DELETE FROM `cloud`.`configuration` where name='skip.steps';
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `cloud`.`keystore` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`name` varchar(64) NOT NULL COMMENT 'unique name for the certifiation',
|
||||
`certificate` text NOT NULL COMMENT 'the actual certificate being stored in the db',
|
||||
`key` text NOT NULL COMMENT 'private key associated wih the certificate',
|
||||
`key` text NOT NULL COMMENT 'private key associated with the certificate',
|
||||
`domain_suffix` varchar(256) NOT NULL COMMENT 'DNS domain suffix associated with the certificate',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE(name)
|
||||
|
||||
@ -32,7 +32,7 @@ CREATE TABLE IF NOT EXISTS `cloud`.`keystore` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`name` varchar(64) NOT NULL COMMENT 'unique name for the certifiation',
|
||||
`certificate` text NOT NULL COMMENT 'the actual certificate being stored in the db',
|
||||
`key` text NOT NULL COMMENT 'private key associated wih the certificate',
|
||||
`key` text NOT NULL COMMENT 'private key associated with the certificate',
|
||||
`domain_suffix` varchar(256) NOT NULL COMMENT 'DNS domain suffix associated with the certificate',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE(name)
|
||||
|
||||
@ -68,7 +68,7 @@ ALTER TABLE `cloud`.`port_forwarding_rules` ADD CONSTRAINT `fk_port_forwarding_r
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibility, it can take the following four parameters : global,guest-network,link-local,disabled');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authentication string in the format username:password');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.');
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2');
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones');
|
||||
|
||||
@ -50,7 +50,7 @@ INSERT IGNORE INTO `cloud`.`configuration` (category, instance, name, value, des
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibility, it can take the following four parameters : global,guest-network,link-local,disabled');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authentication string in the format username:password');
|
||||
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.');
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2');
|
||||
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones');
|
||||
|
||||
@ -227,7 +227,7 @@ CREATE TABLE `cloud`.`nicira_nvp_nic_map` (
|
||||
|
||||
-- rrq 5839
|
||||
-- Remove the unique constraint on physical_network_id, provider_name from physical_network_service_providers
|
||||
-- Because the name of this contraint is not set we need this roundabout way
|
||||
-- Because the name of this constraint is not set we need this roundabout way
|
||||
-- The key is also used by the foreign key constraint so drop and recreate that one
|
||||
ALTER TABLE `cloud`.`physical_network_service_providers` DROP FOREIGN KEY fk_pnetwork_service_providers__physical_network_id;
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ ALTER TABLE `storage_pool` ADD `user_info` VARCHAR( 255 ) NULL COMMENT 'Authoriz
|
||||
INSERT INTO `cloud`.`configuration` (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'management-server', 'event.purge.interval', '86400', 'The interval (in seconds) to wait before running the event purge thread');
|
||||
-- rrq 5839
|
||||
-- Remove the unique constraint on physical_network_id, provider_name from physical_network_service_providers
|
||||
-- Because the name of this contraint is not set we need this roundabout way
|
||||
-- Because the name of this constraint is not set we need this roundabout way
|
||||
-- The key is also used by the foreign key constraint so drop and recreate that one
|
||||
ALTER TABLE physical_network_service_providers DROP FOREIGN KEY fk_pnetwork_service_providers__physical_network_id;
|
||||
SET @constraintname = (select CONCAT(CONCAT('DROP INDEX ', A.CONSTRAINT_NAME), ' ON physical_network_service_providers' )
|
||||
|
||||
@ -154,7 +154,7 @@ CREATE VIEW `cloud`.`image_store_view` AS
|
||||
`cloud`.`image_store_details` ON image_store_details.store_id = image_store.id;
|
||||
|
||||
|
||||
-- here we have to allow null for store_id to accomodate baremetal case to search for ready templates since template state is only stored in this table
|
||||
-- here we have to allow null for store_id to accommodate baremetal case to search for ready templates since template state is only stored in this table
|
||||
-- FK also commented out due to this
|
||||
CREATE TABLE `cloud`.`template_store_ref` (
|
||||
`id` bigint unsigned NOT NULL auto_increment,
|
||||
@ -525,9 +525,9 @@ CREATE VIEW `cloud`.`event_view` AS
|
||||
left join
|
||||
`cloud`.`event` eve ON event.start_id = eve.id;
|
||||
|
||||
ALTER TABLE `cloud`.`region` ADD COLUMN `portableip_service_enabled` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is Portable IP service enalbed in the Region';
|
||||
ALTER TABLE `cloud`.`region` ADD COLUMN `portableip_service_enabled` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is Portable IP service enabled in the Region';
|
||||
|
||||
ALTER TABLE `cloud`.`region` ADD COLUMN `gslb_service_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Is GSLB service enalbed in the Region';
|
||||
ALTER TABLE `cloud`.`region` ADD COLUMN `gslb_service_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Is GSLB service enabled in the Region';
|
||||
|
||||
ALTER TABLE `cloud`.`external_load_balancer_devices` ADD COLUMN `is_gslb_provider` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if load balancer appliance is acting as gslb service provider in the zone';
|
||||
|
||||
@ -2067,7 +2067,7 @@ update `cloud`.`vpc_gateways` set network_acl_id = 2;
|
||||
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'VpcManager', 'blacklisted.routes', NULL, 'Routes that are blacklisted, can not be used for Static Routes creation for the VPC Private Gateway');
|
||||
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.dynamic.scale.vm', 'false', 'Enables/Diables dynamically scaling a vm');
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.dynamic.scale.vm', 'false', 'Enables/Disables dynamically scaling a vm');
|
||||
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'scale.retry', '2', 'Number of times to retry scaling up the vm');
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
--;
|
||||
|
||||
-- Update the description to indicate this only works with KVM + Ceph
|
||||
-- (not implemented properly atm for KVM+NFS/local, and it accidentaly works with XS + NFS. Not applicable for VMware)
|
||||
-- (not implemented properly atm for KVM+NFS/local, and it accidentally works with XS + NFS. Not applicable for VMware)
|
||||
UPDATE `cloud`.`configuration` SET `description`='Indicates whether to always backup primary storage snapshot to secondary storage. Keeping snapshots only on Primary storage is applicable for KVM + Ceph only.' WHERE `name`='snapshot.backup.to.secondary';
|
||||
|
||||
-- KVM: enable storage data motion on KVM hypervisor_capabilities
|
||||
|
||||
@ -402,7 +402,7 @@ GROUP BY
|
||||
ALTER TABLE `cloud`.`load_balancing_rules`
|
||||
ADD cidr_list VARCHAR(4096);
|
||||
|
||||
-- savely add resources in parallel
|
||||
-- safely add resources in parallel
|
||||
-- PR#5984 Create table to persist VM stats.
|
||||
DROP TABLE IF EXISTS `cloud`.`resource_reservation`;
|
||||
CREATE TABLE `cloud`.`resource_reservation` (
|
||||
|
||||
@ -238,7 +238,7 @@ update `cloud`.`volumes` v, `cloud`.`volume_host_ref` vhr set v.format=vhr.fo
|
||||
|
||||
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'baremetal.ipmi.lan.interface', 'default', 'option specified in -I option of impitool. candidates are: open/bmc/lipmi/lan/lanplus/free/imb, see ipmitool man page for details. default value "default" means using default option of ipmitool');
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'baremetal.ipmi.fail.retry', 'default', "ipmi interface will be temporary out of order after power opertions(e.g. cycle, on), it leads following commands fail immediately. The value specifies retry times before accounting it as real failure");
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'baremetal.ipmi.fail.retry', 'default', "ipmi interface will be temporary out of order after power operations(e.g. cycle, on), it leads following commands fail immediately. The value specifies retry times before accounting it as real failure");
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.hung.wokervm.timeout', '7200', 'Worker VM timeout in seconds');
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Alert", 'DEFAULT', 'management-server', "alert.smtp.connectiontimeout", "30000", "Socket connection timeout value in milliseconds. -1 for infinite timeout.");
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Alert", 'DEFAULT', 'management-server', "alert.smtp.timeout", "30000", "Socket I/O timeout value in milliseconds. -1 for infinite timeout.");
|
||||
|
||||
@ -183,7 +183,7 @@ public class DefaultSnapshotStrategy extends SnapshotStrategyBase {
|
||||
fullBackup = false;
|
||||
}
|
||||
} else if (oldestSnapshotOnPrimary.getId() != parentSnapshotOnPrimaryStore.getId()){
|
||||
// if there is an snapshot entry for previousPool(primary storage) of migrated volume, delete it becasue CS created one more snapshot entry for current pool
|
||||
// if there is an snapshot entry for previousPool(primary storage) of migrated volume, delete it because CS created one more snapshot entry for current pool
|
||||
snapshotStoreDao.remove(oldestSnapshotOnPrimary.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager {
|
||||
stateMachines.addTransition(State.Destroying, Event.OperationFailed, State.Destroying);
|
||||
stateMachines.addTransition(State.Failed, Event.DestroyRequested, State.Destroying);
|
||||
// TODO: further investigate why an extra event is sent when it is
|
||||
// alreay Ready for DownloadListener
|
||||
// already Ready for DownloadListener
|
||||
stateMachines.addTransition(State.Ready, Event.OperationSuccessed, State.Ready);
|
||||
// State transitions for data object migration
|
||||
stateMachines.addTransition(State.Ready, Event.MigrateDataRequested, State.Migrating);
|
||||
|
||||
@ -428,7 +428,7 @@ public class DefaultEndPointSelector implements EndPointSelector {
|
||||
}
|
||||
|
||||
// If ssvm doesn't exist then find any ssvm in the zone.
|
||||
s_logger.debug("Coudn't find ssvm for url" +downloadUrl);
|
||||
s_logger.debug("Couldn't find ssvm for url" +downloadUrl);
|
||||
return findEndpointForImageStorage(store);
|
||||
}
|
||||
|
||||
|
||||
@ -314,7 +314,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO
|
||||
|
||||
@Override
|
||||
public List<TemplateDataStoreVO> listByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
|
||||
// get all elgible image stores
|
||||
// get all eligible image stores
|
||||
List<DataStore> imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
|
||||
if (imgStores != null) {
|
||||
List<TemplateDataStoreVO> result = new ArrayList<TemplateDataStoreVO>();
|
||||
@ -341,7 +341,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO
|
||||
|
||||
@Override
|
||||
public TemplateDataStoreVO findByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
|
||||
// get all elgible image stores
|
||||
// get all eligible image stores
|
||||
List<DataStore> imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
|
||||
if (imgStores != null) {
|
||||
for (DataStore store : imgStores) {
|
||||
@ -357,7 +357,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO
|
||||
|
||||
@Override
|
||||
public TemplateDataStoreVO findByTemplateZoneStagingDownloadStatus(long templateId, Long zoneId, Status... status) {
|
||||
// get all elgible image stores
|
||||
// get all eligible image stores
|
||||
List<DataStore> cacheStores = _storeMgr.getImageCacheStores(new ZoneScope(zoneId));
|
||||
if (cacheStores != null) {
|
||||
for (DataStore store : cacheStores) {
|
||||
@ -448,7 +448,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO
|
||||
|
||||
@Override
|
||||
public TemplateDataStoreVO findByTemplateZone(long templateId, Long zoneId, DataStoreRole role) {
|
||||
// get all elgible image stores
|
||||
// get all eligible image stores
|
||||
List<DataStore> imgStores = null;
|
||||
if (role == DataStoreRole.Image) {
|
||||
imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
|
||||
|
||||
@ -32,8 +32,8 @@ public class BaseTypeTest {
|
||||
|
||||
@Test
|
||||
public void testIsSameTypeAs() {
|
||||
Assert.assertTrue("'a' and 'A' should be considdered the same type", new TestType("a").isSameTypeAs("A"));
|
||||
Assert.assertTrue("'B' and 'b' should be considdered the same address", new TestType("B").isSameTypeAs(new TestType("b")));
|
||||
Assert.assertTrue("'a' and 'A' should be considered the same type", new TestType("a").isSameTypeAs("A"));
|
||||
Assert.assertTrue("'B' and 'b' should be considered the same address", new TestType("B").isSameTypeAs(new TestType("b")));
|
||||
}
|
||||
class TestType extends BaseType {
|
||||
String content;
|
||||
|
||||
@ -97,16 +97,18 @@ public class DefaultModuleDefinitionSet implements ModuleDefinitionSet {
|
||||
@Override
|
||||
public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
|
||||
try {
|
||||
ApplicationContext context = getApplicationContext(def.getName());
|
||||
String moduleDefinitionName = def.getName();
|
||||
log.debug(String.format("Trying to obtain module [%s] context.", moduleDefinitionName));
|
||||
ApplicationContext context = getApplicationContext(moduleDefinitionName);
|
||||
try {
|
||||
Runnable runnable = context.getBean("moduleStartup", Runnable.class);
|
||||
log.info("Starting module [" + def.getName() + "]");
|
||||
log.info(String.format("Starting module [%s].", moduleDefinitionName));
|
||||
runnable.run();
|
||||
} catch (BeansException e) {
|
||||
// Ignore
|
||||
log.error(String.format("Failed to start module [%s] due to: [%s].", moduleDefinitionName, e.getMessage()), e);
|
||||
}
|
||||
} catch (EmptyStackException e) {
|
||||
// The root context is already loaded, so ignore the exception
|
||||
log.error(String.format("Failed to obtain module context due to [%s]. Using root context instead.", e.getMessage()), e);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -117,10 +119,15 @@ public class DefaultModuleDefinitionSet implements ModuleDefinitionSet {
|
||||
@Override
|
||||
public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
|
||||
try {
|
||||
String moduleDefinitionName = def.getName();
|
||||
log.debug(String.format("Trying to obtain module [%s] context.", moduleDefinitionName));
|
||||
ApplicationContext parent = getApplicationContext(parents.peek().getName());
|
||||
log.debug(String.format("Trying to load module [%s] context.", moduleDefinitionName));
|
||||
loadContext(def, parent);
|
||||
} catch (EmptyStackException e) {
|
||||
// The root context is already loaded, so ignore the exception
|
||||
log.error(String.format("Failed to obtain module context due to [%s]. Using root context instead.", e.getMessage()), e);
|
||||
} catch (BeansException e) {
|
||||
log.error(String.format("Failed to load module [%s] due to: [%s].", def.getName(), e.getMessage()), e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -21,6 +21,8 @@ import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyPair;
|
||||
@ -37,6 +39,8 @@ import java.security.cert.X509Certificate;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -49,6 +53,7 @@ import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import com.cloud.configuration.Config;
|
||||
import org.apache.cloudstack.ca.CAManager;
|
||||
import org.apache.cloudstack.framework.ca.CAProvider;
|
||||
import org.apache.cloudstack.framework.ca.Certificate;
|
||||
@ -365,8 +370,12 @@ public final class RootCAProvider extends AdapterBase implements CAProvider, Con
|
||||
if (managementKeyStore != null) {
|
||||
return true;
|
||||
}
|
||||
final Certificate serverCertificate = issueCertificate(Collections.singletonList(NetUtils.getHostName()),
|
||||
NetUtils.getAllDefaultNicIps(), getCaValidityDays());
|
||||
List<String> nicIps = NetUtils.getAllDefaultNicIps();
|
||||
addConfiguredManagementIp(nicIps);
|
||||
nicIps = new ArrayList<>(new HashSet<>(nicIps));
|
||||
|
||||
final Certificate serverCertificate = issueCertificate(Collections.singletonList(NetUtils.getHostName()), nicIps, getCaValidityDays());
|
||||
|
||||
if (serverCertificate == null || serverCertificate.getPrivateKey() == null) {
|
||||
throw new CloudRuntimeException("Failed to generate management server certificate and load management server keystore");
|
||||
}
|
||||
@ -384,6 +393,28 @@ public final class RootCAProvider extends AdapterBase implements CAProvider, Con
|
||||
return managementKeyStore != null;
|
||||
}
|
||||
|
||||
protected void addConfiguredManagementIp(List<String> ipList) {
|
||||
String msNetworkCidr = configDao.getValue(Config.ManagementNetwork.key());
|
||||
try {
|
||||
LOG.debug(String.format("Trying to find management IP in CIDR range [%s].", msNetworkCidr));
|
||||
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
|
||||
networkInterfaces.asIterator().forEachRemaining(networkInterface -> {
|
||||
networkInterface.getInetAddresses().asIterator().forEachRemaining(inetAddress -> {
|
||||
if (NetUtils.isIpWithInCidrRange(inetAddress.getHostAddress(), msNetworkCidr)) {
|
||||
ipList.add(inetAddress.getHostAddress());
|
||||
LOG.debug(String.format("Added IP [%s] to the list of IPs in the management server's certificate.", inetAddress.getHostAddress()));
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (SocketException e) {
|
||||
String msg = "Exception while trying to gather the management server's network interfaces.";
|
||||
LOG.error(msg, e);
|
||||
throw new CloudRuntimeException(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean setupCA() {
|
||||
if (!loadRootCAKeyPair() && !saveNewRootCAKeypair()) {
|
||||
LOG.error("Failed to save and load root CA keypair");
|
||||
|
||||
@ -24,7 +24,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// C# versions of certain CloudStack types to simplify JSON serialisation.
|
||||
// Limit to the number of types, becasue they are written and maintained manually.
|
||||
// Limit to the number of types, because they are written and maintained manually.
|
||||
// JsonProperty used to identify property name when serialised, which allows
|
||||
// later adoption of C# naming conventions if requried.
|
||||
namespace HypervResource
|
||||
|
||||
@ -217,7 +217,7 @@ namespace ServerResource.Tests
|
||||
{
|
||||
testSampleVolumeTempURIJSON = "\"storagepool\"";
|
||||
// Arrange
|
||||
String destoryCmd = //"{\"volume\":" + getSampleVolumeObjectTO() + "}";
|
||||
String destroyCmd = //"{\"volume\":" + getSampleVolumeObjectTO() + "}";
|
||||
"{\"volume\":{\"name\":\"" + testSampleVolumeTempUUIDNoExt
|
||||
+ "\",\"storagePoolType\":\"Filesystem\","
|
||||
+ "\"mountPoint\":"
|
||||
@ -233,15 +233,15 @@ namespace ServerResource.Tests
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
HypervResourceController.wmiCallsV2 = wmiCallsV2;
|
||||
|
||||
dynamic jsonDestoryCmd = JsonConvert.DeserializeObject(destoryCmd);
|
||||
dynamic jsonDestroyCmd = JsonConvert.DeserializeObject(destroyCmd);
|
||||
|
||||
// Act
|
||||
dynamic destoryAns = rsrcServer.DestroyCommand(jsonDestoryCmd);
|
||||
dynamic destroyAns = rsrcServer.DestroyCommand(jsonDestroyCmd);
|
||||
|
||||
// Assert
|
||||
JObject ansAsProperty2 = destoryAns[0];
|
||||
JObject ansAsProperty2 = destroyAns[0];
|
||||
dynamic ans = ansAsProperty2.GetValue(CloudStackTypes.Answer);
|
||||
String path = jsonDestoryCmd.volume.path;
|
||||
String path = jsonDestroyCmd.volume.path;
|
||||
Assert.True((bool)ans.result, "DestroyCommand did not succeed " + ans.details);
|
||||
Assert.True(!File.Exists(path), "Failed to delete file " + path);
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ namespace ServerResource.Tests
|
||||
{
|
||||
// Arrange
|
||||
String sampleVolume = getSampleVolumeObjectTO();
|
||||
String destoryCmd = //"{\"volume\":" + getSampleVolumeObjectTO() + "}";
|
||||
String destroyCmd = //"{\"volume\":" + getSampleVolumeObjectTO() + "}";
|
||||
"{\"volume\":{\"name\":\"" + testSampleVolumeTempUUIDNoExt
|
||||
+ "\",\"storagePoolType\":\"Filesystem\","
|
||||
+ "\"mountPoint\":"
|
||||
@ -243,15 +243,15 @@ namespace ServerResource.Tests
|
||||
+ "\"type\":\"ROOT\",\"id\":9,\"size\":0}}";
|
||||
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
dynamic jsonDestoryCmd = JsonConvert.DeserializeObject(destoryCmd);
|
||||
dynamic jsonDestroyCmd = JsonConvert.DeserializeObject(destroyCmd);
|
||||
|
||||
// Act
|
||||
dynamic destoryAns = rsrcServer.DestroyCommand(jsonDestoryCmd);
|
||||
dynamic destroyAns = rsrcServer.DestroyCommand(jsonDestroyCmd);
|
||||
|
||||
// Assert
|
||||
JObject ansAsProperty2 = destoryAns[0];
|
||||
JObject ansAsProperty2 = destroyAns[0];
|
||||
dynamic ans = ansAsProperty2.GetValue(CloudStackTypes.Answer);
|
||||
String path = jsonDestoryCmd.volume.path;
|
||||
String path = jsonDestroyCmd.volume.path;
|
||||
Assert.True((bool)ans.result, "DestroyCommand did not succeed " + ans.details);
|
||||
Assert.True(!File.Exists(path), "Failed to delete file " + path);
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ public class KVMGuestOsMapper {
|
||||
s_mapper.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003");
|
||||
s_mapper.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003");
|
||||
s_mapper.put("Windows Server 2003 Web Edition", "Windows Server 2003");
|
||||
s_mapper.put("Microsoft Small Bussiness Server 2003", "Windows Server 2003");
|
||||
s_mapper.put("Microsoft Small Business Server 2003", "Windows Server 2003");
|
||||
s_mapper.put("Windows Server 2008 (32-bit)", "Windows Server 2008");
|
||||
s_mapper.put("Windows Server 2008 (64-bit)", "Windows Server 2008");
|
||||
s_mapper.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008");
|
||||
|
||||
@ -1343,8 +1343,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
}
|
||||
s_logger.debug(String.format("The memory balloon stats period [%s] has been set successfully for the VM (Libvirt Domain) with ID [%s] and name [%s].",
|
||||
currentVmBalloonStatsPeriod, vmId, dm.getName()));
|
||||
} catch (final LibvirtException e) {
|
||||
s_logger.warn("Failed to set up memory balloon stats period." + e.getMessage());
|
||||
} catch (final Exception e) {
|
||||
s_logger.warn(String.format("Failed to set up memory balloon stats period for the VM %s with exception %s", parser.getName(), e.getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,6 +59,8 @@ public class LibvirtDomainXMLParser {
|
||||
private Integer vncPort;
|
||||
private String desc;
|
||||
|
||||
private String name;
|
||||
|
||||
public boolean parseDomainXML(String domXML) {
|
||||
DocumentBuilder builder;
|
||||
try {
|
||||
@ -71,6 +73,7 @@ public class LibvirtDomainXMLParser {
|
||||
Element rootElement = doc.getDocumentElement();
|
||||
|
||||
desc = getTagValue("description", rootElement);
|
||||
name = getTagValue("name", rootElement);
|
||||
|
||||
Element devices = (Element)rootElement.getElementsByTagName("devices").item(0);
|
||||
NodeList disks = devices.getElementsByTagName("disk");
|
||||
@ -312,15 +315,19 @@ public class LibvirtDomainXMLParser {
|
||||
String path = getTagValue("backend", rng);
|
||||
String bytes = getAttrValue("rate", "bytes", rng);
|
||||
String period = getAttrValue("rate", "period", rng);
|
||||
|
||||
if (StringUtils.isEmpty(backendModel)) {
|
||||
def = new RngDef(path, Integer.parseInt(bytes), Integer.parseInt(period));
|
||||
if (StringUtils.isAnyEmpty(bytes, period)) {
|
||||
s_logger.debug(String.format("Bytes and period in the rng section should not be null, please check the VM %s", name));
|
||||
} else {
|
||||
def = new RngDef(path, RngBackendModel.valueOf(backendModel.toUpperCase()),
|
||||
Integer.parseInt(bytes), Integer.parseInt(period));
|
||||
if (StringUtils.isEmpty(backendModel)) {
|
||||
def = new RngDef(path, Integer.parseInt(bytes), Integer.parseInt(period));
|
||||
} else {
|
||||
def = new RngDef(path, RngBackendModel.valueOf(backendModel.toUpperCase()),
|
||||
Integer.parseInt(bytes), Integer.parseInt(period));
|
||||
}
|
||||
}
|
||||
if (def != null) {
|
||||
rngDefs.add(def);
|
||||
}
|
||||
|
||||
rngDefs.add(def);
|
||||
}
|
||||
|
||||
NodeList watchDogs = devices.getElementsByTagName("watchdog");
|
||||
@ -427,4 +434,8 @@ public class LibvirtDomainXMLParser {
|
||||
public String getDescription() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class OvmVolume(OvmObject):
|
||||
priStorageMountPoint = sr.mountpoint
|
||||
volDir = join(priStorageMountPoint, 'running_pool', volDirUuid)
|
||||
if exists(volDir):
|
||||
raise Exception("Volume dir %s alreay existed, can not override"%volDir)
|
||||
raise Exception("Volume dir %s already existed, can not override"%volDir)
|
||||
os.makedirs(volDir)
|
||||
OvmStoragePool()._checkDirSizeForImage(volDir, templateUrl)
|
||||
volName = volUuid + '.raw'
|
||||
|
||||
@ -1581,7 +1581,7 @@ public abstract class CitrixResourceBase extends ServerResourceBase implements S
|
||||
try {
|
||||
final Set<VDI> vdis = VDI.getByNameLabel(conn, nameLabel);
|
||||
if (vdis.size() != 1) {
|
||||
s_logger.warn("destoryVDIbyNameLabel failed due to there are " + vdis.size() + " VDIs with name " + nameLabel);
|
||||
s_logger.warn("destroyVDIbyNameLabel failed due to there are " + vdis.size() + " VDIs with name " + nameLabel);
|
||||
return;
|
||||
}
|
||||
for (final VDI vdi : vdis) {
|
||||
@ -3199,7 +3199,7 @@ public abstract class CitrixResourceBase extends ServerResourceBase implements S
|
||||
// constraint
|
||||
// for
|
||||
// stability
|
||||
if (dynamicMaxRam > staticMax) { // XS contraint that dynamic max <=
|
||||
if (dynamicMaxRam > staticMax) { // XS constraint that dynamic max <=
|
||||
// static max
|
||||
s_logger.warn("dynamic max " + toHumanReadableSize(dynamicMaxRam) + " can't be greater than static max " + toHumanReadableSize(staticMax) + ", this can lead to stability issues. Setting static max as much as dynamic max ");
|
||||
return dynamicMaxRam;
|
||||
@ -3213,7 +3213,7 @@ public abstract class CitrixResourceBase extends ServerResourceBase implements S
|
||||
return dynamicMinRam;
|
||||
}
|
||||
|
||||
if (dynamicMinRam < recommendedValue) { // XS contraint that dynamic min
|
||||
if (dynamicMinRam < recommendedValue) { // XS constraint that dynamic min
|
||||
// > static min
|
||||
s_logger.warn("Vm ram is set to dynamic min " + toHumanReadableSize(dynamicMinRam) + " and is less than the recommended static min " + toHumanReadableSize(recommendedValue) + ", this could lead to stability issues");
|
||||
}
|
||||
@ -4589,7 +4589,7 @@ public abstract class CitrixResourceBase extends ServerResourceBase implements S
|
||||
removeSR(conn, sr);
|
||||
return;
|
||||
} catch (XenAPIException | XmlRpcException e) {
|
||||
s_logger.warn(logX(sr, "Unable to get current opertions " + e.toString()), e);
|
||||
s_logger.warn(logX(sr, "Unable to get current operations " + e.toString()), e);
|
||||
}
|
||||
String msg = "Remove SR failed";
|
||||
s_logger.warn(msg);
|
||||
@ -4684,9 +4684,9 @@ public abstract class CitrixResourceBase extends ServerResourceBase implements S
|
||||
removeSR(conn, sr);
|
||||
return null;
|
||||
} catch (final XenAPIException e) {
|
||||
s_logger.warn(logX(sr, "Unable to get current opertions " + e.toString()), e);
|
||||
s_logger.warn(logX(sr, "Unable to get current operations " + e.toString()), e);
|
||||
} catch (final XmlRpcException e) {
|
||||
s_logger.warn(logX(sr, "Unable to get current opertions " + e.getMessage()), e);
|
||||
s_logger.warn(logX(sr, "Unable to get current operations " + e.getMessage()), e);
|
||||
}
|
||||
final String msg = "Remove SR failed";
|
||||
s_logger.warn(msg);
|
||||
|
||||
@ -633,7 +633,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
||||
try {
|
||||
final Set<VDI> vdis = VDI.getByNameLabel(conn, nameLabel);
|
||||
if (vdis.size() != 1) {
|
||||
s_logger.warn("destoryVDIbyNameLabel failed due to there are " + vdis.size() + " VDIs with name " + nameLabel);
|
||||
s_logger.warn("destroyVDIbyNameLabel failed due to there are " + vdis.size() + " VDIs with name " + nameLabel);
|
||||
return;
|
||||
}
|
||||
for (final VDI vdi : vdis) {
|
||||
|
||||
@ -259,8 +259,8 @@ public class XenServer610WrapperTest {
|
||||
final Connection conn = Mockito.mock(Connection.class);
|
||||
final VirtualMachineTO vmSpec = Mockito.mock(VirtualMachineTO.class);
|
||||
|
||||
final VolumeTO volume1 = Mockito.mock(VolumeTO.class);
|
||||
final VolumeTO volume2 = Mockito.mock(VolumeTO.class);
|
||||
final VolumeTO volume1 = MockVolumeTO(path);
|
||||
final VolumeTO volume2 = MockVolumeTO(path);
|
||||
|
||||
final SR sr1 = Mockito.mock(SR.class);
|
||||
final SR sr2 = Mockito.mock(SR.class);
|
||||
@ -295,9 +295,6 @@ public class XenServer610WrapperTest {
|
||||
when(xenServer610Resource.getConnection()).thenReturn(conn);
|
||||
when(vmSpec.getName()).thenReturn(vmName);
|
||||
|
||||
when(volume1.getPath()).thenReturn(path);
|
||||
when(volume2.getPath()).thenReturn(path);
|
||||
|
||||
when(nic1.getMac()).thenReturn(mac);
|
||||
when(nic2.getMac()).thenReturn(mac);
|
||||
|
||||
@ -369,8 +366,8 @@ public class XenServer610WrapperTest {
|
||||
final Connection conn = Mockito.mock(Connection.class);
|
||||
final VirtualMachineTO vmSpec = Mockito.mock(VirtualMachineTO.class);
|
||||
|
||||
final VolumeTO volume1 = Mockito.mock(VolumeTO.class);
|
||||
final VolumeTO volume2 = Mockito.mock(VolumeTO.class);
|
||||
final VolumeTO volume1 = MockVolumeTO(path);
|
||||
final VolumeTO volume2 = MockVolumeTO(path);
|
||||
|
||||
final SR sr1 = Mockito.mock(SR.class);
|
||||
final SR sr2 = Mockito.mock(SR.class);
|
||||
@ -399,9 +396,6 @@ public class XenServer610WrapperTest {
|
||||
when(xenServer610Resource.getConnection()).thenReturn(conn);
|
||||
when(vmSpec.getName()).thenReturn(vmName);
|
||||
|
||||
when(volume1.getPath()).thenReturn(path);
|
||||
when(volume2.getPath()).thenReturn(path);
|
||||
|
||||
when(xenServer610Resource.getVDIbyUuid(conn, volume1.getPath())).thenReturn(vdi1);
|
||||
when(xenServer610Resource.getVDIbyUuid(conn, volume2.getPath())).thenReturn(vdi2);
|
||||
|
||||
@ -481,4 +475,10 @@ public class XenServer610WrapperTest {
|
||||
|
||||
assertFalse(answer.getResult());
|
||||
}
|
||||
|
||||
VolumeTO MockVolumeTO(String path){
|
||||
VolumeTO vol = Mockito.mock(VolumeTO.class);
|
||||
when(vol.getPath()).thenReturn(path);
|
||||
return vol;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
// under the License.
|
||||
|
||||
package org.apache.cloudstack.network.contrail.model;
|
||||
|
||||
import static org.mockito.Matchers.anyInt;
|
||||
import static org.mockito.Matchers.anyLong;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
@ -44,26 +45,19 @@ import net.juniper.contrail.api.ApiConnectorMock;
|
||||
|
||||
public class InstanceIpModelTest extends TestCase {
|
||||
private static final Logger s_logger =
|
||||
Logger.getLogger(InstanceIpModelTest.class);
|
||||
Logger.getLogger(InstanceIpModelTest.class);
|
||||
|
||||
@Test
|
||||
public void testCreateInstanceIp() throws IOException {
|
||||
|
||||
ContrailManagerImpl contrailMgr = mock(ContrailManagerImpl.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ApiConnector api = new ApiConnectorMock(null, 0);
|
||||
when(controller.getApiAccessor()).thenReturn(api);
|
||||
when(controller.getManager()).thenReturn(contrailMgr);
|
||||
|
||||
// Create Virtual-Network (VN)
|
||||
NetworkVO network = mock(NetworkVO.class);
|
||||
when(network.getName()).thenReturn("testnetwork");
|
||||
when(network.getState()).thenReturn(Network.State.Implemented);
|
||||
when(network.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network.getDomainId()).thenReturn(10L);
|
||||
when(network.getAccountId()).thenReturn(42L);
|
||||
NetworkVO network = MockNetworkVO.getNetwork(Network.State.Implemented);
|
||||
NetworkDao networkDao = mock(NetworkDao.class);
|
||||
when(networkDao.findById(anyLong())).thenReturn(network);
|
||||
when(controller.getNetworkDao()).thenReturn(networkDao);
|
||||
@ -86,7 +80,7 @@ public class InstanceIpModelTest extends TestCase {
|
||||
when(vm.getState()).thenReturn(VirtualMachine.State.Running);
|
||||
when(vm.getDomainId()).thenReturn(10L);
|
||||
when(vm.getAccountId()).thenReturn(42L);
|
||||
UserVmDao VmDao = mock(UserVmDao.class);
|
||||
UserVmDao VmDao = mock(UserVmDao.class);
|
||||
when(VmDao.findById(anyLong())).thenReturn(null);
|
||||
when(controller.getVmDao()).thenReturn(VmDao);
|
||||
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package org.apache.cloudstack.network.contrail.model;
|
||||
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.dao.NetworkVO;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
public class MockNetworkVO {
|
||||
|
||||
private NetworkVO network;
|
||||
|
||||
MockNetworkVO(Network.State state) {
|
||||
network = mock(NetworkVO.class);
|
||||
when(network.getName()).thenReturn("testnetwork");
|
||||
when(network.getState()).thenReturn(state);
|
||||
when(network.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network.getDomainId()).thenReturn(10L);
|
||||
when(network.getAccountId()).thenReturn(42L);
|
||||
}
|
||||
|
||||
public NetworkVO getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
public static NetworkVO getNetwork(Network.State state) {
|
||||
MockNetworkVO mockNetwork = new MockNetworkVO(state);
|
||||
return mockNetwork.getNetwork();
|
||||
}
|
||||
|
||||
}
|
||||
@ -16,6 +16,7 @@
|
||||
// under the License.
|
||||
|
||||
package org.apache.cloudstack.network.contrail.model;
|
||||
|
||||
import static org.mockito.Matchers.anyInt;
|
||||
import static org.mockito.Matchers.anyLong;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
@ -45,27 +46,20 @@ import net.juniper.contrail.api.types.VirtualMachineInterface;
|
||||
|
||||
public class VMInterfaceModelTest extends TestCase {
|
||||
private static final Logger s_logger =
|
||||
Logger.getLogger(VMInterfaceModelTest.class);
|
||||
Logger.getLogger(VMInterfaceModelTest.class);
|
||||
|
||||
@Test
|
||||
public void testCreateVMInterface() throws IOException {
|
||||
|
||||
String uuid;
|
||||
ContrailManagerImpl contrailMgr = mock(ContrailManagerImpl.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ApiConnector api = new ApiConnectorMock(null, 0);
|
||||
when(controller.getManager()).thenReturn(contrailMgr);
|
||||
when(controller.getApiAccessor()).thenReturn(api);
|
||||
|
||||
// Create Virtual-Network (VN)
|
||||
NetworkVO network = mock(NetworkVO.class);
|
||||
when(network.getName()).thenReturn("testnetwork");
|
||||
when(network.getState()).thenReturn(Network.State.Implemented);
|
||||
when(network.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network.getDomainId()).thenReturn(10L);
|
||||
when(network.getAccountId()).thenReturn(42L);
|
||||
NetworkVO network = MockNetworkVO.getNetwork(Network.State.Implemented);
|
||||
NetworkDao networkDao = mock(NetworkDao.class);
|
||||
when(networkDao.findById(anyLong())).thenReturn(network);
|
||||
when(controller.getNetworkDao()).thenReturn(networkDao);
|
||||
@ -88,7 +82,7 @@ public class VMInterfaceModelTest extends TestCase {
|
||||
when(vm.getState()).thenReturn(VirtualMachine.State.Running);
|
||||
when(vm.getDomainId()).thenReturn(10L);
|
||||
when(vm.getAccountId()).thenReturn(42L);
|
||||
UserVmDao VmDao = mock(UserVmDao.class);
|
||||
UserVmDao VmDao = mock(UserVmDao.class);
|
||||
when(VmDao.findById(anyLong())).thenReturn(null);
|
||||
when(controller.getVmDao()).thenReturn(VmDao);
|
||||
|
||||
|
||||
@ -46,18 +46,18 @@ public class VirtualMachineModelTest extends TestCase {
|
||||
@Test
|
||||
public void testVirtualMachineDBLookup() {
|
||||
ModelDatabase db = new ModelDatabase();
|
||||
VMInstanceVO vm = mock(VMInstanceVO.class);
|
||||
VMInstanceVO vm = mock(VMInstanceVO.class);
|
||||
|
||||
// Create 3 dummy Virtual Machine model objects
|
||||
// Add these models to database.
|
||||
// Each VM is identified by unique UUId.
|
||||
VirtualMachineModel vm0 = new VirtualMachineModel(vm, "fbc1f8fa-4b78-45ee-bba0-b551dbf72353");
|
||||
VirtualMachineModel vm0 = new VirtualMachineModel(vm, "fbc1f8fa-4b78-45ee-bba0-b551dbf72353");
|
||||
db.getVirtualMachines().add(vm0);
|
||||
|
||||
VirtualMachineModel vm1 = new VirtualMachineModel(vm, "fbc1f8fa-4b78-45ee-bba0-b551dbf83464");
|
||||
VirtualMachineModel vm1 = new VirtualMachineModel(vm, "fbc1f8fa-4b78-45ee-bba0-b551dbf83464");
|
||||
db.getVirtualMachines().add(vm1);
|
||||
|
||||
VirtualMachineModel vm2 = new VirtualMachineModel(vm, "fbc1f8fa-4b78-45ee-bba0-b551dbf94575");
|
||||
VirtualMachineModel vm2 = new VirtualMachineModel(vm, "fbc1f8fa-4b78-45ee-bba0-b551dbf94575");
|
||||
db.getVirtualMachines().add(vm2);
|
||||
|
||||
s_logger.debug("No of Vitual Machines added to database : " + db.getVirtualMachines().size());
|
||||
@ -74,20 +74,13 @@ public class VirtualMachineModelTest extends TestCase {
|
||||
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
ContrailManagerImpl contrailMgr = mock(ContrailManagerImpl.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ApiConnector api = new ApiConnectorMock(null, 0);
|
||||
when(controller.getManager()).thenReturn(contrailMgr);
|
||||
when(controller.getApiAccessor()).thenReturn(api);
|
||||
|
||||
// Create Virtual-Network (VN)
|
||||
NetworkVO network = mock(NetworkVO.class);
|
||||
when(network.getName()).thenReturn("testnetwork");
|
||||
when(network.getState()).thenReturn(Network.State.Allocated);
|
||||
when(network.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network.getDomainId()).thenReturn(10L);
|
||||
when(network.getAccountId()).thenReturn(42L);
|
||||
NetworkVO network = MockNetworkVO.getNetwork(Network.State.Allocated);
|
||||
|
||||
when(contrailMgr.getCanonicalName(network)).thenReturn("testnetwork");
|
||||
when(contrailMgr.getProjectId(network.getDomainId(), network.getAccountId())).thenReturn("testProjectId");
|
||||
@ -99,7 +92,7 @@ public class VirtualMachineModelTest extends TestCase {
|
||||
when(vm.getDomainId()).thenReturn(10L);
|
||||
when(vm.getAccountId()).thenReturn(42L);
|
||||
|
||||
UserVmDao VmDao = mock(UserVmDao.class);
|
||||
UserVmDao VmDao = mock(UserVmDao.class);
|
||||
when(VmDao.findById(anyLong())).thenReturn(null);
|
||||
when(controller.getVmDao()).thenReturn(VmDao);
|
||||
|
||||
|
||||
@ -115,34 +115,13 @@ public class VirtualNetworkModelTest extends TestCase {
|
||||
when(vn3.getNetworkPolicy()).thenReturn(policyRefs3);
|
||||
|
||||
//Virtual-Network 1
|
||||
NetworkVO network1 = mock(NetworkVO.class);
|
||||
when(network1.getName()).thenReturn("testnetwork");
|
||||
when(network1.getState()).thenReturn(State.Allocated);
|
||||
when(network1.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network1.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network1.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network1.getDomainId()).thenReturn(10L);
|
||||
when(network1.getAccountId()).thenReturn(42L);
|
||||
NetworkVO network1 = MockNetworkVO.getNetwork(State.Allocated);
|
||||
|
||||
//Virtual-Network 2
|
||||
NetworkVO network2 = mock(NetworkVO.class);
|
||||
when(network2.getName()).thenReturn("Testnetwork");
|
||||
when(network2.getState()).thenReturn(State.Allocated);
|
||||
when(network2.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network2.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network2.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network2.getDomainId()).thenReturn(10L);
|
||||
when(network2.getAccountId()).thenReturn(42L);
|
||||
NetworkVO network2 = MockNetworkVO.getNetwork(State.Allocated);
|
||||
|
||||
//Virtual-Network 3
|
||||
NetworkVO network3 = mock(NetworkVO.class);
|
||||
when(network3.getName()).thenReturn("Testnetwork");
|
||||
when(network3.getState()).thenReturn(State.Allocated);
|
||||
when(network3.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network3.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network3.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network3.getDomainId()).thenReturn(10L);
|
||||
when(network3.getAccountId()).thenReturn(42L);
|
||||
NetworkVO network3 = MockNetworkVO.getNetwork(State.Allocated);
|
||||
|
||||
when(contrailMgr.getCanonicalName(network1)).thenReturn("testnetwork");
|
||||
when(contrailMgr.getProjectId(network1.getDomainId(), network1.getAccountId())).thenReturn("testProjectId");
|
||||
@ -179,20 +158,13 @@ public class VirtualNetworkModelTest extends TestCase {
|
||||
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
ContrailManagerImpl contrailMgr = mock(ContrailManagerImpl.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ModelController controller = mock(ModelController.class);
|
||||
ApiConnector api = new ApiConnectorMock(null, 0);
|
||||
when(controller.getManager()).thenReturn(contrailMgr);
|
||||
when(controller.getApiAccessor()).thenReturn(api);
|
||||
|
||||
// Create Virtual-Network (VN)
|
||||
NetworkVO network = mock(NetworkVO.class);
|
||||
when(network.getName()).thenReturn("testnetwork");
|
||||
when(network.getState()).thenReturn(State.Allocated);
|
||||
when(network.getGateway()).thenReturn("10.1.1.1");
|
||||
when(network.getCidr()).thenReturn("10.1.1.0/24");
|
||||
when(network.getPhysicalNetworkId()).thenReturn(42L);
|
||||
when(network.getDomainId()).thenReturn(10L);
|
||||
when(network.getAccountId()).thenReturn(42L);
|
||||
NetworkVO network = MockNetworkVO.getNetwork(State.Allocated);
|
||||
|
||||
when(contrailMgr.getCanonicalName(network)).thenReturn("testnetwork");
|
||||
when(contrailMgr.getProjectId(network.getDomainId(), network.getAccountId())).thenReturn("testProjectId");
|
||||
|
||||
@ -21,6 +21,7 @@ package com.cloud.network.nicira;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -104,36 +105,14 @@ public class NiciraNvpApiIT {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCRUDAcl() {
|
||||
Acl acl = new Acl();
|
||||
acl.setDisplayName("Acl" + timestamp);
|
||||
|
||||
// Note that if the protocol is 6 (TCP) then you cannot put ICMP code and type
|
||||
// Note that if the protocol is 1 (ICMP) then you cannot put ports
|
||||
final List<AclRule> egressRules = new ArrayList<AclRule>();
|
||||
acl.setLogicalPortEgressRules(egressRules);
|
||||
egressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 1, "allow", null, null, "1.10.10.0", "1.10.10.1", null, null, null, null, 0, 0, 5));
|
||||
egressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 6, "allow", null, null, "1.10.10.6", "1.10.10.7", 80, 80, 80, 80, 1, null, null));
|
||||
|
||||
final List<AclRule> ingressRules = new ArrayList<AclRule>();
|
||||
acl.setLogicalPortIngressRules(ingressRules);
|
||||
ingressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 1, "allow", null, null, "1.10.10.0", "1.10.10.1", null, null, null, null, 0, 0, 5));
|
||||
ingressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 6, "allow", null, null, "1.10.10.6", "1.10.10.7", 80, 80, 80, 80, 1, null, null));
|
||||
|
||||
final List<NiciraNvpTag> tags = new ArrayList<NiciraNvpTag>();
|
||||
acl.setTags(tags);
|
||||
tags.add(new NiciraNvpTag("nvp", "MyTag1"));
|
||||
tags.add(new NiciraNvpTag("nicira", "MyTag2"));
|
||||
// In the creation we don't get to specify UUID, href or schema: they don't exist yet
|
||||
|
||||
public void testCRUDAclReadAll() {
|
||||
try {
|
||||
acl = api.createAcl(acl);
|
||||
Acl acl = setupAcl();
|
||||
|
||||
// We can now update the new entity
|
||||
acl = api.createAcl(acl);
|
||||
acl.setDisplayName("UpdatedAcl" + timestamp);
|
||||
api.updateAcl(acl, acl.getUuid());
|
||||
|
||||
// Read them all
|
||||
List<Acl> acls = api.findAcl();
|
||||
Acl scInList = null;
|
||||
for (final Acl iAcl : acls) {
|
||||
@ -143,16 +122,30 @@ public class NiciraNvpApiIT {
|
||||
}
|
||||
assertEquals("Read a ACL different from the one just created and updated", acl, scInList);
|
||||
|
||||
// Read them filtered by uuid (get one)
|
||||
acls = api.findAcl(acl.getUuid());
|
||||
assertEquals("Read a ACL different from the one just created and updated", acl, acls.get(0));
|
||||
assertEquals("Read a ACL filtered by unique id (UUID) with more than one item", 1, acls.size());
|
||||
|
||||
// We can now delete the new entity
|
||||
api.deleteAcl(acl.getUuid());
|
||||
} catch (final NiciraNvpApiException e) {
|
||||
e.printStackTrace();
|
||||
assertTrue("Errors in ACL CRUD", false);
|
||||
fail("Errors in ACL CRUD");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCRUDAclReadOne() {
|
||||
try {
|
||||
Acl acl = setupAcl();
|
||||
|
||||
acl = api.createAcl(acl);
|
||||
acl.setDisplayName("UpdatedAcl" + timestamp);
|
||||
api.updateAcl(acl, acl.getUuid());
|
||||
|
||||
List<Acl> acls = api.findAcl(acl.getUuid());
|
||||
assertEquals("Read a ACL different from the one just created and updated", acl, acls.get(0));
|
||||
assertEquals("Read a ACL filtered by unique id (UUID) with more than one item", 1, acls.size());
|
||||
|
||||
api.deleteAcl(acl.getUuid());
|
||||
} catch (final NiciraNvpApiException e) {
|
||||
e.printStackTrace();
|
||||
fail("Errors in ACL CRUD");
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,4 +309,29 @@ public class NiciraNvpApiIT {
|
||||
assertTrue("Not recognizable cluster status", correctStatus);
|
||||
}
|
||||
|
||||
private Acl setupAcl() {
|
||||
Acl acl = new Acl();
|
||||
acl.setDisplayName("Acl" + timestamp);
|
||||
|
||||
// Note that if the protocol is 6 (TCP) then you cannot put ICMP code and type
|
||||
// Note that if the protocol is 1 (ICMP) then you cannot put ports
|
||||
final List<AclRule> egressRules = new ArrayList<>();
|
||||
acl.setLogicalPortEgressRules(egressRules);
|
||||
egressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 1, "allow", null, null, "1.10.10.0", "1.10.10.1", null, null, null, null, 0, 0, 5));
|
||||
egressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 6, "allow", null, null, "1.10.10.6", "1.10.10.7", 80, 80, 80, 80, 1, null, null));
|
||||
|
||||
final List<AclRule> ingressRules = new ArrayList<>();
|
||||
acl.setLogicalPortIngressRules(ingressRules);
|
||||
ingressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 1, "allow", null, null, "1.10.10.0", "1.10.10.1", null, null, null, null, 0, 0, 5));
|
||||
ingressRules.add(new AclRule(AclRule.ETHERTYPE_IPV4, 6, "allow", null, null, "1.10.10.6", "1.10.10.7", 80, 80, 80, 80, 1, null, null));
|
||||
|
||||
final List<NiciraNvpTag> tags = new ArrayList<>();
|
||||
acl.setTags(tags);
|
||||
tags.add(new NiciraNvpTag("nvp", "MyTag1"));
|
||||
tags.add(new NiciraNvpTag("nicira", "MyTag2"));
|
||||
// In the creation we don't get to specify UUID, href or schema: they don't exist yet
|
||||
|
||||
return acl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package org.apache.cloudstack.network.tungsten.service;
|
||||
|
||||
import org.apache.cloudstack.network.tungsten.agent.api.TungstenAnswer;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
public class MockTungstenAnswerFactory {
|
||||
|
||||
TungstenAnswer tungstenAnswer;
|
||||
MockTungstenAnswerFactory(boolean returnResult){
|
||||
tungstenAnswer=mock(TungstenAnswer.class);
|
||||
when(tungstenAnswer.getResult()).thenReturn(returnResult);
|
||||
}
|
||||
TungstenAnswer get() {
|
||||
return tungstenAnswer;
|
||||
}
|
||||
public static TungstenAnswer get(boolean returnResult){
|
||||
TungstenAnswer tungstenAnswers = new MockTungstenAnswerFactory(returnResult).get();
|
||||
return tungstenAnswers;
|
||||
}
|
||||
}
|
||||
@ -256,13 +256,12 @@ public class TungstenElementTest {
|
||||
StaticNatImpl staticNat = mock(StaticNatImpl.class);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
|
||||
TungstenAnswer assignFloatingIpAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer assignFloatingIpAnswer = MockTungstenAnswerFactory.get(true);
|
||||
Nic nic = mock(Nic.class);
|
||||
Network publicNetwork = mock(Network.class);
|
||||
List<StaticNatImpl> staticNatList = List.of(staticNat);
|
||||
|
||||
when(staticNat.isForRevoke()).thenReturn(false);
|
||||
when(assignFloatingIpAnswer.getResult()).thenReturn(true);
|
||||
when(ipAddressDao.findByIdIncludingRemoved(anyLong())).thenReturn(ipAddressVO);
|
||||
when(vmInstanceDao.findByIdIncludingRemoved(anyLong())).thenReturn(vmInstanceVO);
|
||||
when(networkModel.getNicInNetworkIncludingRemoved(anyLong(), anyLong())).thenReturn(nic);
|
||||
@ -278,13 +277,12 @@ public class TungstenElementTest {
|
||||
StaticNatImpl staticNat = mock(StaticNatImpl.class);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
|
||||
TungstenAnswer assignFloatingIpAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer assignFloatingIpAnswer = MockTungstenAnswerFactory.get(false);
|
||||
Nic nic = mock(Nic.class);
|
||||
Network publicNetwork = mock(Network.class);
|
||||
List<StaticNatImpl> staticNatList = List.of(staticNat);
|
||||
|
||||
when(staticNat.isForRevoke()).thenReturn(false);
|
||||
when(assignFloatingIpAnswer.getResult()).thenReturn(false);
|
||||
when(ipAddressDao.findByIdIncludingRemoved(anyLong())).thenReturn(ipAddressVO);
|
||||
when(vmInstanceDao.findByIdIncludingRemoved(anyLong())).thenReturn(vmInstanceVO);
|
||||
when(networkModel.getNicInNetworkIncludingRemoved(anyLong(), anyLong())).thenReturn(nic);
|
||||
@ -300,13 +298,12 @@ public class TungstenElementTest {
|
||||
StaticNatImpl staticNat = mock(StaticNatImpl.class);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
|
||||
TungstenAnswer releaseFloatingIpAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer releaseFloatingIpAnswer = MockTungstenAnswerFactory.get(true);
|
||||
Nic nic = mock(Nic.class);
|
||||
Network publicNetwork = mock(Network.class);
|
||||
List<StaticNatImpl> staticNatList = List.of(staticNat);
|
||||
|
||||
when(staticNat.isForRevoke()).thenReturn(true);
|
||||
when(releaseFloatingIpAnswer.getResult()).thenReturn(true);
|
||||
when(ipAddressDao.findByIdIncludingRemoved(anyLong())).thenReturn(ipAddressVO);
|
||||
when(vmInstanceDao.findByIdIncludingRemoved(anyLong())).thenReturn(vmInstanceVO);
|
||||
when(networkModel.getNicInNetworkIncludingRemoved(anyLong(), anyLong())).thenReturn(nic);
|
||||
@ -322,13 +319,12 @@ public class TungstenElementTest {
|
||||
StaticNatImpl staticNat = mock(StaticNatImpl.class);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
|
||||
TungstenAnswer releaseFloatingIpAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer releaseFloatingIpAnswer = MockTungstenAnswerFactory.get(false);
|
||||
Nic nic = mock(Nic.class);
|
||||
Network publicNetwork = mock(Network.class);
|
||||
List<StaticNatImpl> staticNatList = List.of(staticNat);
|
||||
|
||||
when(staticNat.isForRevoke()).thenReturn(true);
|
||||
when(releaseFloatingIpAnswer.getResult()).thenReturn(false);
|
||||
when(ipAddressDao.findByIdIncludingRemoved(anyLong())).thenReturn(ipAddressVO);
|
||||
when(vmInstanceDao.findByIdIncludingRemoved(anyLong())).thenReturn(vmInstanceVO);
|
||||
when(networkModel.getNicInNetworkIncludingRemoved(anyLong(), anyLong())).thenReturn(nic);
|
||||
@ -355,11 +351,11 @@ public class TungstenElementTest {
|
||||
TungstenFabricLBHealthMonitorVO tungstenFabricLBHealthMonitorVO = mock(TungstenFabricLBHealthMonitorVO.class);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
TungstenGuestNetworkIpAddressVO tungstenGuestNetworkIpAddressVO = mock(TungstenGuestNetworkIpAddressVO.class);
|
||||
TungstenAnswer createTungstenNetworkLoadbalancerAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer updateTungstenLoadBalancerPoolAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer updateTungstenLoadBalancerMemberAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer updateTungstenLoadBalancerListenerAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer updateTungstenHealthMonitorAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer createTungstenNetworkLoadbalancerAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer updateTungstenLoadBalancerPoolAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer updateTungstenLoadBalancerMemberAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer updateTungstenLoadBalancerListenerAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer updateTungstenHealthMonitorAnswer = MockTungstenAnswerFactory.get(true);
|
||||
LoadBalancingRule.LbSslCert lbSslCert = mock(LoadBalancingRule.LbSslCert.class);
|
||||
when(lbStickinessPolicy.getMethodName()).thenReturn("AppCookie");
|
||||
List<Pair<String, String>> pairList = List.of(new Pair<>("cookieName", "cookieValue"));
|
||||
@ -382,10 +378,6 @@ public class TungstenElementTest {
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(CreateTungstenNetworkLoadbalancerCommand.class), anyLong())).thenReturn(createTungstenNetworkLoadbalancerAnswer);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(UpdateTungstenLoadBalancerPoolCommand.class), anyLong())).thenReturn(updateTungstenLoadBalancerPoolAnswer);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(UpdateTungstenLoadBalancerMemberCommand.class), anyLong())).thenReturn(updateTungstenLoadBalancerMemberAnswer);
|
||||
when(createTungstenNetworkLoadbalancerAnswer.getResult()).thenReturn(true);
|
||||
when(updateTungstenLoadBalancerPoolAnswer.getResult()).thenReturn(true);
|
||||
when(updateTungstenLoadBalancerMemberAnswer.getResult()).thenReturn(true);
|
||||
when(updateTungstenHealthMonitorAnswer.getResult()).thenReturn(true);
|
||||
when(configDao.getValue(Config.NetworkLBHaproxyStatsVisbility.key())).thenReturn("enabled");
|
||||
when(tungstenService.updateLoadBalancer(any(), any())).thenReturn(true);
|
||||
when(EncryptionUtil.generateSignature(anyString(), anyString())).thenReturn("generatedString");
|
||||
@ -410,10 +402,10 @@ public class TungstenElementTest {
|
||||
List<LoadBalancerVO> loadBalancerVOList = List.of(loadBalancerVO);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
TungstenGuestNetworkIpAddressVO tungstenGuestNetworkIpAddressVO = mock(TungstenGuestNetworkIpAddressVO.class);
|
||||
TungstenAnswer createTungstenNetworkLoadbalancerAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer updateTungstenLoadBalancerPoolAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer updateTungstenLoadBalancerMemberAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer updateTungstenHealthMonitorAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer createTungstenNetworkLoadbalancerAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer updateTungstenLoadBalancerPoolAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer updateTungstenLoadBalancerMemberAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer updateTungstenHealthMonitorAnswer = MockTungstenAnswerFactory.get(true);
|
||||
List<Pair<String, String>> pairList = List.of(new Pair<>("cookieName", "cookieValue"));
|
||||
TungstenFabricLBHealthMonitorVO tungstenFabricLBHealthMonitorVO = mock(TungstenFabricLBHealthMonitorVO.class);
|
||||
|
||||
@ -435,12 +427,8 @@ public class TungstenElementTest {
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(CreateTungstenNetworkLoadbalancerCommand.class), anyLong())).thenReturn(createTungstenNetworkLoadbalancerAnswer);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(UpdateTungstenLoadBalancerPoolCommand.class), anyLong())).thenReturn(updateTungstenLoadBalancerPoolAnswer);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(UpdateTungstenLoadBalancerMemberCommand.class), anyLong())).thenReturn(updateTungstenLoadBalancerMemberAnswer);
|
||||
when(createTungstenNetworkLoadbalancerAnswer.getResult()).thenReturn(true);
|
||||
when(updateTungstenLoadBalancerPoolAnswer.getResult()).thenReturn(true);
|
||||
when(updateTungstenLoadBalancerMemberAnswer.getResult()).thenReturn(true);
|
||||
when(configDao.getValue(Config.NetworkLBHaproxyStatsVisbility.key())).thenReturn("disabled");
|
||||
when(tungstenFabricLBHealthMonitorDao.findByLbId(anyLong())).thenReturn(tungstenFabricLBHealthMonitorVO);
|
||||
when(updateTungstenHealthMonitorAnswer.getResult()).thenReturn(true);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(UpdateTungstenLoadBalancerHealthMonitorCommand.class), anyLong())).thenReturn(updateTungstenHealthMonitorAnswer);
|
||||
|
||||
assertFalse(tungstenElement.applyLBRules(network, loadBalancingRuleList1));
|
||||
@ -457,8 +445,8 @@ public class TungstenElementTest {
|
||||
List<LoadBalancingRule> loadBalancingRuleList1 = List.of(loadBalancingRule1);
|
||||
List<LoadBalancerVO> loadBalancerVOList1 = List.of(loadBalancerVO1);
|
||||
TungstenGuestNetworkIpAddressVO tungstenGuestNetworkIpAddressVO = mock(TungstenGuestNetworkIpAddressVO.class);
|
||||
TungstenAnswer deleteTungstenLoadBalancerListenerAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer deleteTungstenLoadBalancerCommand = mock(TungstenAnswer.class);
|
||||
TungstenAnswer deleteTungstenLoadBalancerListenerAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer deleteTungstenLoadBalancerCommand = MockTungstenAnswerFactory.get(true);
|
||||
|
||||
when(networkModel.getSystemNetworkByZoneAndTrafficType(anyLong(), any())).thenReturn(publicNetwork);
|
||||
when(loadBalancingRule1.getSourceIp()).thenReturn(ip1);
|
||||
@ -467,7 +455,6 @@ public class TungstenElementTest {
|
||||
when(ipAddressVO.getAddress()).thenReturn(ip1);
|
||||
when(ip1.addr()).thenReturn("10.10.10.10");
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(DeleteTungstenLoadBalancerCommand.class), anyLong())).thenReturn(deleteTungstenLoadBalancerCommand);
|
||||
when(deleteTungstenLoadBalancerCommand.getResult()).thenReturn(true);
|
||||
when(lbDao.listByIpAddress(anyLong())).thenReturn(loadBalancerVOList1);
|
||||
when(tungstenGuestNetworkIpAddressDao.findByNetworkIdAndPublicIp(anyLong(),anyString())).thenReturn(tungstenGuestNetworkIpAddressVO);
|
||||
when(tungstenGuestNetworkIpAddressDao.remove(anyLong())).thenReturn(false);
|
||||
@ -485,8 +472,8 @@ public class TungstenElementTest {
|
||||
LoadBalancerVO loadBalancerVO1 = mock(LoadBalancerVO.class);
|
||||
LoadBalancerVO loadBalancerVO2 = mock(LoadBalancerVO.class);
|
||||
TungstenGuestNetworkIpAddressVO tungstenGuestNetworkIpAddressVO = mock(TungstenGuestNetworkIpAddressVO.class);
|
||||
TungstenAnswer deleteTungstenLoadBalancerListenerAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer deleteTungstenLoadBalancerCommand = mock(TungstenAnswer.class);
|
||||
TungstenAnswer deleteTungstenLoadBalancerListenerAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer deleteTungstenLoadBalancerCommand = MockTungstenAnswerFactory.get(true);
|
||||
List<LoadBalancingRule> loadBalancingRuleList = List.of(loadBalancingRule);
|
||||
List<LoadBalancerVO> loadBalancerVOList = Arrays.asList(loadBalancerVO1, loadBalancerVO2);
|
||||
|
||||
@ -496,7 +483,6 @@ public class TungstenElementTest {
|
||||
when(ipAddressDao.findByIpAndDcId(anyLong(), anyString())).thenReturn(ipAddressVO);
|
||||
when(ip.addr()).thenReturn("10.10.10.10");
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(DeleteTungstenLoadBalancerListenerCommand.class), anyLong())).thenReturn(deleteTungstenLoadBalancerListenerAnswer);
|
||||
when(deleteTungstenLoadBalancerListenerAnswer.getResult()).thenReturn(true);
|
||||
when(tungstenService.updateLoadBalancer(any(), any())).thenReturn(true);
|
||||
when(lbDao.listByIpAddress(anyLong())).thenReturn(loadBalancerVOList);
|
||||
|
||||
@ -511,7 +497,7 @@ public class TungstenElementTest {
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
UserVm userVm = mock(UserVm.class);
|
||||
Nic nic = mock(Nic.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = MockTungstenAnswerFactory.get(true);
|
||||
List<PortForwardingRule> portForwardingRuleList = List.of(portForwardingRule);
|
||||
|
||||
when(portForwardingRule.getState()).thenReturn(FirewallRule.State.Add);
|
||||
@ -520,7 +506,6 @@ public class TungstenElementTest {
|
||||
when(ApiDBUtils.findUserVmById(anyLong())).thenReturn(userVm);
|
||||
when(networkModel.getNicInNetwork(anyLong(), anyLong())).thenReturn(nic);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(ApplyTungstenPortForwardingCommand.class), anyLong())).thenReturn(applyTungstenPortForwardingAnswer);
|
||||
when(applyTungstenPortForwardingAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.applyPFRules(network, portForwardingRuleList));
|
||||
}
|
||||
@ -533,7 +518,7 @@ public class TungstenElementTest {
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
UserVm userVm = mock(UserVm.class);
|
||||
Nic nic = mock(Nic.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = MockTungstenAnswerFactory.get(false);
|
||||
List<PortForwardingRule> portForwardingRuleList = List.of(portForwardingRule);
|
||||
|
||||
when(portForwardingRule.getState()).thenReturn(FirewallRule.State.Add);
|
||||
@ -542,7 +527,6 @@ public class TungstenElementTest {
|
||||
when(ApiDBUtils.findUserVmById(anyLong())).thenReturn(userVm);
|
||||
when(networkModel.getNicInNetwork(anyLong(), anyLong())).thenReturn(nic);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(ApplyTungstenPortForwardingCommand.class), anyLong())).thenReturn(applyTungstenPortForwardingAnswer);
|
||||
when(applyTungstenPortForwardingAnswer.getResult()).thenReturn(false);
|
||||
|
||||
assertFalse(tungstenElement.applyPFRules(network, portForwardingRuleList));
|
||||
}
|
||||
@ -555,7 +539,7 @@ public class TungstenElementTest {
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
UserVm userVm = mock(UserVm.class);
|
||||
Nic nic = mock(Nic.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = MockTungstenAnswerFactory.get(true);
|
||||
List<PortForwardingRule> portForwardingRuleList = List.of(portForwardingRule);
|
||||
|
||||
when(portForwardingRule.getState()).thenReturn(FirewallRule.State.Revoke);
|
||||
@ -564,7 +548,6 @@ public class TungstenElementTest {
|
||||
when(ApiDBUtils.findUserVmById(anyLong())).thenReturn(userVm);
|
||||
when(networkModel.getNicInNetwork(anyLong(), anyLong())).thenReturn(nic);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(ApplyTungstenPortForwardingCommand.class), anyLong())).thenReturn(applyTungstenPortForwardingAnswer);
|
||||
when(applyTungstenPortForwardingAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.applyPFRules(network, portForwardingRuleList));
|
||||
}
|
||||
@ -577,7 +560,7 @@ public class TungstenElementTest {
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
UserVm userVm = mock(UserVm.class);
|
||||
Nic nic = mock(Nic.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer applyTungstenPortForwardingAnswer = MockTungstenAnswerFactory.get(false);
|
||||
List<PortForwardingRule> portForwardingRuleList = List.of(portForwardingRule);
|
||||
|
||||
when(portForwardingRule.getState()).thenReturn(FirewallRule.State.Revoke);
|
||||
@ -586,7 +569,6 @@ public class TungstenElementTest {
|
||||
when(ApiDBUtils.findUserVmById(anyLong())).thenReturn(userVm);
|
||||
when(networkModel.getNicInNetwork(anyLong(), anyLong())).thenReturn(nic);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(ApplyTungstenPortForwardingCommand.class), anyLong())).thenReturn(applyTungstenPortForwardingAnswer);
|
||||
when(applyTungstenPortForwardingAnswer.getResult()).thenReturn(false);
|
||||
|
||||
assertFalse(tungstenElement.applyPFRules(network, portForwardingRuleList));
|
||||
}
|
||||
@ -600,9 +582,9 @@ public class TungstenElementTest {
|
||||
ReservationContext reservationContext = mock(ReservationContext.class);
|
||||
VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
|
||||
HostVO host = mock(HostVO.class);
|
||||
TungstenAnswer createTungstenVMAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer createTungstenVMAnswer = MockTungstenAnswerFactory.get(true);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
TungstenAnswer createTungstenNetworkPolicyAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer createTungstenNetworkPolicyAnswer = MockTungstenAnswerFactory.get(true);
|
||||
|
||||
nicProfile.setIPv4Address("192.168.100.100");
|
||||
when(network.getTrafficType()).thenReturn(Networks.TrafficType.Public);
|
||||
@ -612,8 +594,6 @@ public class TungstenElementTest {
|
||||
when(ipAddressDao.findByIpAndDcId(anyLong(), anyString())).thenReturn(ipAddressVO);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(CreateTungstenNetworkPolicyCommand.class), anyLong())).thenReturn(createTungstenNetworkPolicyAnswer);
|
||||
when(virtualMachineProfile.getType()).thenReturn(VirtualMachine.Type.ConsoleProxy);
|
||||
when(createTungstenVMAnswer.getResult()).thenReturn(true);
|
||||
when(createTungstenNetworkPolicyAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.prepare(network, nicProfile, virtualMachineProfile, deployDestination, reservationContext));
|
||||
assertEquals(Nic.ReservationStrategy.Create, nicProfile.getReservationStrategy());
|
||||
@ -631,7 +611,7 @@ public class TungstenElementTest {
|
||||
ReservationContext reservationContext = mock(ReservationContext.class);
|
||||
VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
|
||||
HostVO host = mock(HostVO.class);
|
||||
TungstenAnswer createTungstenVMAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer createTungstenVMAnswer = MockTungstenAnswerFactory.get(true);
|
||||
|
||||
nicProfile.setIPv4Address("192.168.100.100");
|
||||
when(network.getTrafficType()).thenReturn(Networks.TrafficType.Management);
|
||||
@ -639,7 +619,6 @@ public class TungstenElementTest {
|
||||
when(hostDao.findById(anyLong())).thenReturn(host);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(CreateTungstenVirtualMachineCommand.class), anyLong())).thenReturn(createTungstenVMAnswer);
|
||||
when(virtualMachineProfile.getType()).thenReturn(VirtualMachine.Type.SecondaryStorageVm);
|
||||
when(createTungstenVMAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.prepare(network, nicProfile, virtualMachineProfile, deployDestination, reservationContext));
|
||||
assertEquals(Nic.ReservationStrategy.Create, nicProfile.getReservationStrategy());
|
||||
@ -749,14 +728,12 @@ public class TungstenElementTest {
|
||||
Network network = mock(Network.class);
|
||||
ReservationContext reservationContext = mock(ReservationContext.class);
|
||||
List<IPAddressVO> ipAddressVOList = Arrays.asList(ipAddressVO1, ipAddressVO2);
|
||||
TungstenAnswer tungstenDeleteFIPAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer tungstenDeleteNPAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer tungstenDeleteFIPAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer tungstenDeleteNPAnswer = MockTungstenAnswerFactory.get(true);
|
||||
|
||||
when(ipAddressDao.listByAssociatedNetwork(anyLong(), anyBoolean())).thenReturn(ipAddressVOList);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(DeleteTungstenFloatingIpCommand.class), anyLong())).thenReturn(tungstenDeleteFIPAnswer);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(DeleteTungstenNetworkPolicyCommand.class), anyLong())).thenReturn(tungstenDeleteNPAnswer);
|
||||
when(tungstenDeleteFIPAnswer.getResult()).thenReturn(true);
|
||||
when(tungstenDeleteNPAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.destroy(network, reservationContext));
|
||||
}
|
||||
@ -898,8 +875,8 @@ public class TungstenElementTest {
|
||||
Network network = mock(Network.class);
|
||||
FirewallRuleVO firewallRuleVO = mock(FirewallRuleVO.class);
|
||||
Network publicNetwork = mock(Network.class);
|
||||
TungstenAnswer createNetworkPolicyAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer applyNetworkPolicyAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer createNetworkPolicyAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer applyNetworkPolicyAnswer = MockTungstenAnswerFactory.get(true);
|
||||
|
||||
when(firewallRuleVO.getState()).thenReturn(FirewallRule.State.Add);
|
||||
when(firewallRuleVO.getSourceCidrList()).thenReturn(List.of("192.168.100.0/24"));
|
||||
@ -909,8 +886,6 @@ public class TungstenElementTest {
|
||||
when(firewallRuleVO.getTrafficType()).thenReturn(FirewallRule.TrafficType.Egress);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(CreateTungstenNetworkPolicyCommand.class), anyLong())).thenReturn(createNetworkPolicyAnswer);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(ApplyTungstenNetworkPolicyCommand.class), anyLong())).thenReturn(applyNetworkPolicyAnswer);
|
||||
when(createNetworkPolicyAnswer.getResult()).thenReturn(true);
|
||||
when(applyNetworkPolicyAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.applyFWRules(network, List.of(firewallRuleVO)));
|
||||
}
|
||||
@ -920,8 +895,8 @@ public class TungstenElementTest {
|
||||
Network network = mock(Network.class);
|
||||
FirewallRuleVO firewallRuleVO = mock(FirewallRuleVO.class);
|
||||
Network publicNetwork = mock(Network.class);
|
||||
TungstenAnswer createNetworkPolicyAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer applyNetworkPolicyAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer createNetworkPolicyAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenAnswer applyNetworkPolicyAnswer = MockTungstenAnswerFactory.get(true);
|
||||
IPAddressVO ipAddressVO = mock(IPAddressVO.class);
|
||||
Ip ip = mock(Ip.class);
|
||||
|
||||
@ -935,8 +910,6 @@ public class TungstenElementTest {
|
||||
when(firewallRuleVO.getTrafficType()).thenReturn(FirewallRule.TrafficType.Ingress);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(CreateTungstenNetworkPolicyCommand.class), anyLong())).thenReturn(createNetworkPolicyAnswer);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(ApplyTungstenNetworkPolicyCommand.class), anyLong())).thenReturn(applyNetworkPolicyAnswer);
|
||||
when(createNetworkPolicyAnswer.getResult()).thenReturn(true);
|
||||
when(applyNetworkPolicyAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.applyFWRules(network, List.of(firewallRuleVO)));
|
||||
}
|
||||
@ -992,14 +965,13 @@ public class TungstenElementTest {
|
||||
ReservationContext context = mock(ReservationContext.class);
|
||||
VMInstanceVO vmInstanceVO = mock(VMInstanceVO.class);
|
||||
HostVO hostVO = mock(HostVO.class);
|
||||
TungstenAnswer tungstenAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer tungstenAnswer = MockTungstenAnswerFactory.get(true);
|
||||
|
||||
when(vm.getType()).thenReturn(VirtualMachine.Type.ConsoleProxy);
|
||||
when(network.getTrafficType()).thenReturn(Networks.TrafficType.Public);
|
||||
when(vmInstanceDao.findById(anyLong())).thenReturn(vmInstanceVO);
|
||||
when(hostDao.findById(anyLong())).thenReturn(hostVO);
|
||||
when(tungstenFabricUtils.sendTungstenCommand(any(CreateTungstenVirtualMachineCommand.class), anyLong())).thenReturn(tungstenAnswer);
|
||||
when(tungstenAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertTrue(tungstenElement.prepareMigration(nic, network, vm, dest, context));
|
||||
}
|
||||
|
||||
@ -63,12 +63,11 @@ public class TungstenFabricUtilsTest {
|
||||
@Test
|
||||
public void sendTungstenCommandSuccessTest() {
|
||||
TungstenProviderVO tungstenProviderVO = mock(TungstenProviderVO.class);
|
||||
TungstenAnswer tungstenAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer tungstenAnswer = MockTungstenAnswerFactory.get(true);
|
||||
TungstenCommand tungstenCommand = mock(TungstenCommand.class);
|
||||
|
||||
when(tungstenProviderDao.findByZoneId(anyLong())).thenReturn(tungstenProviderVO);
|
||||
when(agentMgr.easySend(anyLong(), any(TungstenCommand.class))).thenReturn(tungstenAnswer);
|
||||
when(tungstenAnswer.getResult()).thenReturn(true);
|
||||
|
||||
assertEquals(tungstenAnswer, tungstenFabricUtils.sendTungstenCommand(tungstenCommand, anyLong()));
|
||||
}
|
||||
@ -93,12 +92,11 @@ public class TungstenFabricUtilsTest {
|
||||
@Test(expected = InvalidParameterValueException.class)
|
||||
public void sendTungstenCommandWithFalseAnswer() {
|
||||
TungstenProviderVO tungstenProviderVO = mock(TungstenProviderVO.class);
|
||||
TungstenAnswer tungstenAnswer = mock(TungstenAnswer.class);
|
||||
TungstenAnswer tungstenAnswer = MockTungstenAnswerFactory.get(false);
|
||||
TungstenCommand tungstenCommand = mock(TungstenCommand.class);
|
||||
|
||||
when(tungstenProviderDao.findByZoneId(anyLong())).thenReturn(tungstenProviderVO);
|
||||
when(agentMgr.easySend(anyLong(), any(TungstenCommand.class))).thenReturn(tungstenAnswer);
|
||||
when(tungstenAnswer.getResult()).thenReturn(false);
|
||||
|
||||
tungstenFabricUtils.sendTungstenCommand(tungstenCommand, anyLong());
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -244,7 +244,7 @@ public class ElastistorUtil {
|
||||
|
||||
if (listAccountResponse.getAccounts().getCount() != 0) {
|
||||
int i;
|
||||
// check weather a account in elasticenter with given Domain name is
|
||||
// check whether an account in elasticenter with given Domain name is
|
||||
// already present in the list of accounts
|
||||
for (i = 0; i < listAccountResponse.getAccounts().getCount(); i++) {
|
||||
if (domainName.equals(listAccountResponse.getAccounts().getAccount(i).getName())) {
|
||||
|
||||
@ -943,7 +943,7 @@ public class DateraUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks wether a host initiator is present in an initiator group
|
||||
* Checks whether a host initiator is present in an initiator group
|
||||
*
|
||||
* @param initiator Host initiator to check
|
||||
* @param initiatorGroup the initiator group
|
||||
|
||||
@ -255,7 +255,7 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
s_logger.debug("Unable to destoy volume" + data.getId(), ex);
|
||||
s_logger.debug("Unable to destroy volume" + data.getId(), ex);
|
||||
result.setResult(ex.toString());
|
||||
}
|
||||
callback.complete(result);
|
||||
|
||||
2
pom.xml
2
pom.xml
@ -50,7 +50,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<project.systemvm.template.location>https://download.cloudstack.org/systemvm</project.systemvm.template.location>
|
||||
<project.systemvm.template.version>4.18.1.0</project.systemvm.template.version>
|
||||
<project.systemvm.template.version>4.19.0.0</project.systemvm.template.version>
|
||||
<sonar.organization>apache</sonar.organization>
|
||||
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||
|
||||
|
||||
@ -105,7 +105,7 @@ def manageAvailability(path, value):
|
||||
return
|
||||
|
||||
|
||||
def checkVolumeAvailablility(path):
|
||||
def checkVolumeAvailability(path):
|
||||
try:
|
||||
if not isVolumeAvailable(path):
|
||||
# The VHD file is not available on XenSever. The volume is probably
|
||||
@ -172,7 +172,7 @@ def getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI):
|
||||
|
||||
baseCopyUuid = ''
|
||||
if isISCSI:
|
||||
checkVolumeAvailablility(snapshotPath)
|
||||
checkVolumeAvailability(snapshotPath)
|
||||
baseCopyUuid = scanParent(snapshotPath)
|
||||
else:
|
||||
baseCopyUuid = getParent(snapshotPath, isISCSI)
|
||||
|
||||
@ -769,7 +769,7 @@ def add_to_ipset(ipsetname, ips, action):
|
||||
logging.debug("vm ip " + ip)
|
||||
util.pread2(['ipset', action, ipsetname, ip])
|
||||
except:
|
||||
logging.debug("vm ip alreday in ip set" + ip)
|
||||
logging.debug("vm ip already in ip set" + ip)
|
||||
continue
|
||||
|
||||
return result
|
||||
@ -1023,7 +1023,7 @@ def network_rules_for_rebooted_vm(session, vmName):
|
||||
[vm_ip, vm_mac] = get_vm_mac_ip_from_log(vmchain)
|
||||
default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac)
|
||||
|
||||
#check wether the vm has secondary ips
|
||||
#check whether the vm has secondary ips
|
||||
if is_secondary_ips_set(vm_name) == True:
|
||||
vmips = get_vm_sec_ips(vm_name)
|
||||
#add arp rules for the secondaryp ip
|
||||
|
||||
@ -190,7 +190,7 @@ def isfile(path, isISCSI):
|
||||
errMsg = ''
|
||||
exists = True
|
||||
if isISCSI:
|
||||
exists = checkVolumeAvailablility(path)
|
||||
exists = checkVolumeAvailability(path)
|
||||
else:
|
||||
exists = os.path.isfile(path)
|
||||
|
||||
@ -269,7 +269,7 @@ def getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI):
|
||||
|
||||
baseCopyUuid = ''
|
||||
if isISCSI:
|
||||
checkVolumeAvailablility(snapshotPath)
|
||||
checkVolumeAvailability(snapshotPath)
|
||||
baseCopyUuid = scanParent(snapshotPath)
|
||||
else:
|
||||
baseCopyUuid = getParent(snapshotPath, isISCSI)
|
||||
@ -439,7 +439,7 @@ def manageAvailability(path, value):
|
||||
return
|
||||
|
||||
|
||||
def checkVolumeAvailablility(path):
|
||||
def checkVolumeAvailability(path):
|
||||
try:
|
||||
if not isVolumeAvailable(path):
|
||||
# The VHD file is not available on XenSever. The volume is probably
|
||||
|
||||
@ -1729,7 +1729,7 @@ public enum Config {
|
||||
String.class,
|
||||
"baremetal.ipmi.fail.retry",
|
||||
"5",
|
||||
"ipmi interface will be temporary out of order after power opertions(e.g. cycle, on), it leads following commands fail immediately. The value specifies retry times before accounting it as real failure",
|
||||
"ipmi interface will be temporary out of order after power operations(e.g. cycle, on), it leads following commands fail immediately. The value specifies retry times before accounting it as real failure",
|
||||
null),
|
||||
|
||||
ApiLimitEnabled("Advanced", ManagementServer.class, Boolean.class, "api.throttling.enabled", "false", "Enable/disable Api rate limit", null),
|
||||
|
||||
@ -44,6 +44,7 @@ import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
|
||||
import org.apache.cloudstack.network.NetworkPermissionVO;
|
||||
import org.apache.cloudstack.network.dao.NetworkPermissionDao;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiDBUtils;
|
||||
@ -122,7 +123,6 @@ import com.cloud.user.DomainManager;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.dao.AccountDao;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.StringUtils;
|
||||
import com.cloud.utils.component.AdapterBase;
|
||||
import com.cloud.utils.component.ManagerBase;
|
||||
import com.cloud.utils.db.DB;
|
||||
@ -2377,7 +2377,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
@Override
|
||||
public void checkIp6Parameters(String startIPv6, String endIPv6, String ip6Gateway, String ip6Cidr) throws InvalidParameterValueException {
|
||||
|
||||
if (org.apache.commons.lang3.StringUtils.isAnyBlank(ip6Gateway, ip6Cidr)) {
|
||||
if (StringUtils.isAnyBlank(ip6Gateway, ip6Cidr)) {
|
||||
throw new InvalidParameterValueException("ip6Gateway and ip6Cidr should be defined for an IPv6 network work properly");
|
||||
}
|
||||
|
||||
@ -2392,7 +2392,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
throw new InvalidParameterValueException("ip6Gateway is not in ip6cidr indicated network!");
|
||||
}
|
||||
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(startIPv6)) {
|
||||
if (StringUtils.isNotBlank(startIPv6)) {
|
||||
if (!NetUtils.isValidIp6(startIPv6)) {
|
||||
throw new InvalidParameterValueException("Invalid format for the startIPv6 parameter");
|
||||
}
|
||||
@ -2401,7 +2401,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
}
|
||||
}
|
||||
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(endIPv6)) {
|
||||
if (StringUtils.isNotBlank(endIPv6)) {
|
||||
if (!NetUtils.isValidIp6(endIPv6)) {
|
||||
throw new InvalidParameterValueException("Invalid format for the endIPv6 parameter");
|
||||
}
|
||||
@ -2601,15 +2601,15 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
if (userData != null) {
|
||||
vmData.add(new String[]{USERDATA_DIR, USERDATA_FILE, userData});
|
||||
}
|
||||
vmData.add(new String[]{METATDATA_DIR, SERVICE_OFFERING_FILE, StringUtils.unicodeEscape(serviceOffering)});
|
||||
vmData.add(new String[]{METATDATA_DIR, AVAILABILITY_ZONE_FILE, StringUtils.unicodeEscape(zoneName)});
|
||||
vmData.add(new String[]{METATDATA_DIR, LOCAL_HOSTNAME_FILE, StringUtils.unicodeEscape(vmHostName)});
|
||||
vmData.add(new String[]{METATDATA_DIR, SERVICE_OFFERING_FILE, com.cloud.utils.StringUtils.unicodeEscape(serviceOffering)});
|
||||
vmData.add(new String[]{METATDATA_DIR, AVAILABILITY_ZONE_FILE, com.cloud.utils.StringUtils.unicodeEscape(zoneName)});
|
||||
vmData.add(new String[]{METATDATA_DIR, LOCAL_HOSTNAME_FILE, com.cloud.utils.StringUtils.unicodeEscape(vmHostName)});
|
||||
vmData.add(new String[]{METATDATA_DIR, LOCAL_IPV4_FILE, guestIpAddress});
|
||||
|
||||
addUserDataDetailsToCommand(vmData, userDataDetails);
|
||||
|
||||
String publicIpAddress = guestIpAddress;
|
||||
String publicHostName = StringUtils.unicodeEscape(vmHostName);
|
||||
String publicHostName = com.cloud.utils.StringUtils.unicodeEscape(vmHostName);
|
||||
|
||||
if (dcVo.getNetworkType() != DataCenter.NetworkType.Basic) {
|
||||
if (publicIp != null) {
|
||||
@ -2654,7 +2654,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
throw new CloudRuntimeException("Unable to get MD5 MessageDigest", e);
|
||||
}
|
||||
md5.reset();
|
||||
md5.update(password.getBytes(StringUtils.getPreferredCharset()));
|
||||
md5.update(password.getBytes(com.cloud.utils.StringUtils.getPreferredCharset()));
|
||||
byte[] digest = md5.digest();
|
||||
BigInteger bigInt = new BigInteger(1, digest);
|
||||
String hashtext = bigInt.toString(16);
|
||||
@ -2687,8 +2687,8 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
String[] keyValuePairs = userDataDetails.split(",");
|
||||
for(String pair : keyValuePairs)
|
||||
{
|
||||
final Pair<String, String> keyValue = StringUtils.getKeyValuePairWithSeparator(pair, "=");
|
||||
vmData.add(new String[]{METATDATA_DIR, keyValue.first(), StringUtils.unicodeEscape(keyValue.second())});
|
||||
final Pair<String, String> keyValue = com.cloud.utils.StringUtils.getKeyValuePairWithSeparator(pair, "=");
|
||||
vmData.add(new String[]{METATDATA_DIR, keyValue.first(), com.cloud.utils.StringUtils.unicodeEscape(keyValue.second())});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2711,7 +2711,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
|
||||
@Override
|
||||
public Pair<String, String> getNetworkIp4Dns(final Network network, final DataCenter zone) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(network.getDns1())) {
|
||||
if (StringUtils.isNotBlank(network.getDns1())) {
|
||||
return new Pair<>(network.getDns1(), network.getDns2());
|
||||
}
|
||||
return new Pair<>(zone.getDns1(), zone.getDns2());
|
||||
@ -2719,7 +2719,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
|
||||
@Override
|
||||
public Pair<String, String> getNetworkIp6Dns(final Network network, final DataCenter zone) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(network.getIp6Dns1())) {
|
||||
if (StringUtils.isNotBlank(network.getIp6Dns1())) {
|
||||
return new Pair<>(network.getIp6Dns1(), network.getIp6Dns2());
|
||||
}
|
||||
return new Pair<>(zone.getIp6Dns1(), zone.getIp6Dns2());
|
||||
@ -2727,26 +2727,26 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
|
||||
|
||||
@Override
|
||||
public void verifyIp4DnsPair(String ip4Dns1, String ip4Dns2) {
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(ip4Dns1) && org.apache.commons.lang3.StringUtils.isNotEmpty(ip4Dns2)) {
|
||||
if (StringUtils.isEmpty(ip4Dns1) && StringUtils.isNotEmpty(ip4Dns2)) {
|
||||
throw new InvalidParameterValueException("Second IPv4 DNS can be specified only with the first IPv4 DNS");
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ip4Dns1) && !NetUtils.isValidIp4(ip4Dns1)) {
|
||||
if (StringUtils.isNotEmpty(ip4Dns1) && !NetUtils.isValidIp4(ip4Dns1)) {
|
||||
throw new InvalidParameterValueException("Invalid IPv4 for DNS1");
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ip4Dns2) && !NetUtils.isValidIp4(ip4Dns2)) {
|
||||
if (StringUtils.isNotEmpty(ip4Dns2) && !NetUtils.isValidIp4(ip4Dns2)) {
|
||||
throw new InvalidParameterValueException("Invalid IPv4 for DNS2");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifyIp6DnsPair(String ip6Dns1, String ip6Dns2) {
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(ip6Dns1) && org.apache.commons.lang3.StringUtils.isNotEmpty(ip6Dns2)) {
|
||||
if (StringUtils.isEmpty(ip6Dns1) && StringUtils.isNotEmpty(ip6Dns2)) {
|
||||
throw new InvalidParameterValueException("Second IPv6 DNS can be specified only with the first IPv6 DNS");
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ip6Dns1) && !NetUtils.isValidIp6(ip6Dns1)) {
|
||||
if (StringUtils.isNotEmpty(ip6Dns1) && !NetUtils.isValidIp6(ip6Dns1)) {
|
||||
throw new InvalidParameterValueException("Invalid IPv6 for IPv6 DNS1");
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ip6Dns2) && !NetUtils.isValidIp6(ip6Dns2)) {
|
||||
if (StringUtils.isNotEmpty(ip6Dns2) && !NetUtils.isValidIp6(ip6Dns2)) {
|
||||
throw new InvalidParameterValueException("Invalid IPv6 for IPv6 DNS2");
|
||||
}
|
||||
}
|
||||
|
||||
@ -5175,7 +5175,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
|
||||
List<SecondaryStorageVmVO> ssvms = _stnwMgr.getSSVMWithNoStorageNetwork(network.getDataCenterId());
|
||||
if (!ssvms.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder("Cannot add " + trafficType
|
||||
+ " traffic type as there are below secondary storage vm still running. Please stop them all and add Storage traffic type again, then destory them all to allow CloudStack recreate them with storage network(If you have added storage network ip range)");
|
||||
+ " traffic type as there are below secondary storage vm still running. Please stop them all and add Storage traffic type again, then destroy them all to allow CloudStack recreate them with storage network(If you have added storage network ip range)");
|
||||
sb.append("SSVMs:");
|
||||
for (SecondaryStorageVmVO ssvm : ssvms) {
|
||||
sb.append(ssvm.getInstanceName()).append(":").append(ssvm.getState());
|
||||
|
||||
@ -2533,7 +2533,7 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
|
||||
boolean revoke = false;
|
||||
if (ip.getState() == IpAddress.State.Releasing ) {
|
||||
// for ips got struck in releasing state we need to delete the rule not add.
|
||||
s_logger.debug("Rule revoke set to true for the ip " + ip.getAddress() +" becasue it is in releasing state");
|
||||
s_logger.debug("Rule revoke set to true for the ip " + ip.getAddress() +" because it is in releasing state");
|
||||
revoke = true;
|
||||
}
|
||||
final StaticNatImpl staticNat = new StaticNatImpl(ip.getAccountId(), ip.getDomainId(), guestNetworkId, ip.getId(), ip.getVmIp(), revoke);
|
||||
|
||||
@ -670,7 +670,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
|
||||
" as it's already assigned to antoher vm");
|
||||
}
|
||||
|
||||
//check wether the vm ip is alreday associated with any public ip address
|
||||
//check whether the vm ip is already associated with any public ip address
|
||||
IPAddressVO oldIP = _ipAddressDao.findByAssociatedVmIdAndVmIp(vmId, vmIp);
|
||||
|
||||
if (oldIP != null) {
|
||||
|
||||
@ -1170,7 +1170,7 @@ public class NetworkACLServiceImplTest {
|
||||
}
|
||||
|
||||
@Test(expected = InvalidParameterValueException.class)
|
||||
public void moveRuleBetweenAclRulesTestThereIsSpaceBetweenPreviousRuleAndNextRuleToAccomodateTheNewRuleWithOtherruleColliding() {
|
||||
public void moveRuleBetweenAclRulesTestThereIsSpaceBetweenPreviousRuleAndNextRuleToAccommodateTheNewRuleWithOtherRuleColliding() {
|
||||
Mockito.when(previousAclRuleMock.getNumber()).thenReturn(10);
|
||||
Mockito.when(nextAclRuleMock.getNumber()).thenReturn(15);
|
||||
|
||||
@ -1186,7 +1186,7 @@ public class NetworkACLServiceImplTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void moveRuleBetweenAclRulesTestThereIsSpaceBetweenPreviousRuleAndNextRuleToAccomodateTheNewRule() {
|
||||
public void moveRuleBetweenAclRulesTestThereIsSpaceBetweenPreviousRuleAndNextRuleToAccommodateTheNewRule() {
|
||||
Mockito.when(previousAclRuleMock.getNumber()).thenReturn(10);
|
||||
Mockito.when(nextAclRuleMock.getNumber()).thenReturn(11);
|
||||
Mockito.when(aclRuleBeingMovedMock.getId()).thenReturn(1l);
|
||||
@ -1218,7 +1218,7 @@ public class NetworkACLServiceImplTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void moveRuleBetweenAclRulesTestThereIsNoSpaceBetweenPreviousRuleAndNextRuleToAccomodateTheNewRule() {
|
||||
public void moveRuleBetweenAclRulesTestThereIsNoSpaceBetweenPreviousRuleAndNextRuleToAccommodateTheNewRule() {
|
||||
Mockito.when(previousAclRuleMock.getNumber()).thenReturn(10);
|
||||
Mockito.when(nextAclRuleMock.getNumber()).thenReturn(15);
|
||||
Mockito.when(aclRuleBeingMovedMock.getNumber()).thenReturn(50);
|
||||
|
||||
@ -62,6 +62,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
@ -330,7 +331,7 @@ public class StatsCollectorTest {
|
||||
VmStatsVO actual = vmStatsVOCaptor.getAllValues().get(0);
|
||||
Assert.assertEquals(Long.valueOf(2L), actual.getVmId());
|
||||
Assert.assertEquals(Long.valueOf(1L), actual.getMgmtServerId());
|
||||
Assert.assertEquals(expectedVmStatsStr, actual.getVmStatsData());
|
||||
Assert.assertEquals(convertJsonToOrderedMap(expectedVmStatsStr), convertJsonToOrderedMap(actual.getVmStatsData()));
|
||||
Assert.assertEquals(timestamp, actual.getTimestamp());
|
||||
}
|
||||
|
||||
@ -511,4 +512,14 @@ public class StatsCollectorTest {
|
||||
public void testPersistVolumeStatsVmware() {
|
||||
performPersistVolumeStatsTest(Hypervisor.HypervisorType.VMware);
|
||||
}
|
||||
|
||||
private Map<String, String> convertJsonToOrderedMap(String json) {
|
||||
Map<String, String> jsonMap = new TreeMap<String, String>();
|
||||
String[] keyValuePairs = json.replace("{", "").replace("}","").split(",");
|
||||
for (String pair: keyValuePairs) {
|
||||
String[] keyValue = pair.split(":");
|
||||
jsonMap.put(keyValue[0], keyValue[1]);
|
||||
}
|
||||
return jsonMap;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1927,7 +1927,7 @@ CREATE TABLE `cloud`.`keystore` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`name` varchar(64) NOT NULL COMMENT 'unique name for the certifiation',
|
||||
`certificate` text NOT NULL COMMENT 'the actual certificate being stored in the db',
|
||||
`key` text COMMENT 'private key associated wih the certificate',
|
||||
`key` text COMMENT 'private key associated with the certificate',
|
||||
`domain_suffix` varchar(256) NOT NULL COMMENT 'DNS domain suffix associated with the certificate',
|
||||
`seq` int,
|
||||
PRIMARY KEY (`id`),
|
||||
|
||||
@ -147,7 +147,7 @@ INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (88,
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (89, UUID(), 6, 'Windows Server 2003 Standard Edition(32-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (90, UUID(), 6, 'Windows Server 2003 Standard Edition(64-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (91, UUID(), 6, 'Windows Server 2003 Web Edition');
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (92, UUID(), 6, 'Microsoft Small Bussiness Server 2003');
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (92, UUID(), 6, 'Microsoft Small Business Server 2003');
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (93, UUID(), 6, 'Windows XP (32-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (94, UUID(), 6, 'Windows XP (64-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (95, UUID(), 6, 'Windows 2000 Advanced Server');
|
||||
@ -395,7 +395,7 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (32-bit)', 89);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (64-bit)', 90);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Web Edition', 91);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Small Bussiness Server 2003', 92);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Small Business Server 2003', 92);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (32-bit)', 56);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (64-bit)', 101);
|
||||
INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 93);
|
||||
|
||||
@ -2083,9 +2083,9 @@ class TestBrowseUploadVolume(cloudstackTestCase):
|
||||
|
||||
vm4details = self.deploy_vm()
|
||||
|
||||
newvolumetodestoy_VM = self.browse_upload_volume()
|
||||
newvolumetodestroy_VM = self.browse_upload_volume()
|
||||
|
||||
self.attach_volume(vm4details, newvolumetodestoy_VM.id)
|
||||
self.attach_volume(vm4details, newvolumetodestroy_VM.id)
|
||||
|
||||
self.destroy_vm(vm4details)
|
||||
|
||||
@ -2095,7 +2095,7 @@ class TestBrowseUploadVolume(cloudstackTestCase):
|
||||
self.expunge_vm(vm4details)
|
||||
|
||||
cmd = deleteVolume.deleteVolumeCmd()
|
||||
cmd.id = newvolumetodestoy_VM.id
|
||||
cmd.id = newvolumetodestroy_VM.id
|
||||
self.apiclient.deleteVolume(cmd)
|
||||
|
||||
self.debug(
|
||||
|
||||
@ -627,7 +627,7 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
|
||||
"""
|
||||
|
||||
# Validate the following
|
||||
# 1. Destory the virtual machines.
|
||||
# 1. Destroy the virtual machines.
|
||||
# 2. Rules should be still configured on virtual router.
|
||||
# 3. Recover the virtual machines.
|
||||
# 4. Vm should be in stopped state. State both the instances
|
||||
@ -1751,7 +1751,7 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
|
||||
"""
|
||||
|
||||
# Validate the following
|
||||
# 1. Destory the virtual machines.
|
||||
# 1. Destroy the virtual machines.
|
||||
# 2. Rules should be still configured on virtual router.
|
||||
# 3. Recover the virtual machines.
|
||||
# 4. Vm should be in stopped state. State both the instances
|
||||
@ -2466,7 +2466,7 @@ class TestVMLifeCycleDiffHosts(cloudstackTestCase):
|
||||
"""
|
||||
|
||||
# Validate the following
|
||||
# 1. Destory the virtual machines.
|
||||
# 1. Destroy the virtual machines.
|
||||
# 2. Rules should be still configured on virtual router.
|
||||
# 3. Recover the virtual machines.
|
||||
# 4. Vm should be in stopped state. State both the instances
|
||||
|
||||
102
test/integration/smoke/test_host_ping.py
Normal file
102
test/integration/smoke/test_host_ping.py
Normal file
@ -0,0 +1,102 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
""" Check state transition of host from Alert to Up on Ping
|
||||
"""
|
||||
|
||||
# Import Local Modules
|
||||
from marvin.cloudstackTestCase import *
|
||||
from marvin.lib.common import *
|
||||
from marvin.lib.utils import *
|
||||
from nose.plugins.attrib import attr
|
||||
|
||||
_multiprocess_shared_ = False
|
||||
|
||||
|
||||
class TestHostPing(cloudstackTestCase):
|
||||
|
||||
def setUp(self, handler=logging.StreamHandler()):
|
||||
self.logger = logging.getLogger('TestHM')
|
||||
self.stream_handler = handler
|
||||
self.logger.setLevel(logging.DEBUG)
|
||||
self.logger.addHandler(self.stream_handler)
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.hypervisor = self.testClient.getHypervisorInfo()
|
||||
self.mgtSvrDetails = self.config.__dict__["mgtSvr"][0].__dict__
|
||||
self.dbConnection = self.testClient.getDbConnection()
|
||||
self.services = self.testClient.getParsedTestDataConfig()
|
||||
self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
|
||||
self.pod = get_pod(self.apiclient, self.zone.id)
|
||||
self.cleanup = []
|
||||
|
||||
def tearDown(self):
|
||||
super(TestHostPing, self).tearDown()
|
||||
|
||||
def checkHostStateInCloudstack(self, state, host_id):
|
||||
try:
|
||||
listHost = Host.list(
|
||||
self.apiclient,
|
||||
type='Routing',
|
||||
zoneid=self.zone.id,
|
||||
podid=self.pod.id,
|
||||
id=host_id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(listHost, list),
|
||||
True,
|
||||
"Check if listHost returns a valid response"
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
len(listHost),
|
||||
1,
|
||||
"Check if listHost returns a host"
|
||||
)
|
||||
self.logger.debug(" Host state is %s " % listHost[0].state)
|
||||
if listHost[0].state == state:
|
||||
return True, 1
|
||||
else:
|
||||
return False, 1
|
||||
except Exception as e:
|
||||
self.logger.debug("Got exception %s" % e)
|
||||
return False, 1
|
||||
|
||||
@attr(
|
||||
tags=[
|
||||
"advanced",
|
||||
"advancedns",
|
||||
"smoke",
|
||||
"basic"],
|
||||
required_hardware="true")
|
||||
def test_01_host_ping_on_alert(self):
|
||||
listHost = Host.list(
|
||||
self.apiclient,
|
||||
type='Routing',
|
||||
zoneid=self.zone.id,
|
||||
podid=self.pod.id,
|
||||
)
|
||||
for host in listHost:
|
||||
self.logger.debug('Hypervisor = {}'.format(host.id))
|
||||
|
||||
hostToTest = listHost[0]
|
||||
sql_query = "UPDATE host SET status = 'Alert' WHERE uuid = '" + hostToTest.id + "'"
|
||||
self.dbConnection.execute(sql_query)
|
||||
|
||||
hostUpInCloudstack = wait_until(30, 8, self.checkHostStateInCloudstack, "Up", hostToTest.id)
|
||||
|
||||
if not (hostUpInCloudstack):
|
||||
raise self.fail("Host is not up %s, in cloudstack so failing test " % (hostToTest.ipaddress))
|
||||
return
|
||||
@ -19,7 +19,7 @@
|
||||
set -e
|
||||
set -x
|
||||
|
||||
CLOUDSTACK_RELEASE=4.18.1
|
||||
CLOUDSTACK_RELEASE=4.19.0
|
||||
|
||||
function configure_apache2() {
|
||||
# Enable ssl, rewrite and auth
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
"format": "qcow2",
|
||||
"headless": true,
|
||||
"http_directory": "http",
|
||||
"iso_checksum": "sha512:4460ef6470f6d8ae193c268e213d33a6a5a0da90c2d30c1024784faa4e4473f0c9b546a41e2d34c43fbbd43542ae4fb93cfd5cb6ac9b88a476f1a6877c478674",
|
||||
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/11.7.0/amd64/iso-cd/debian-11.7.0-amd64-netinst.iso",
|
||||
"iso_checksum": "sha512:da7e7867ed043b784f5ae7e4adaaf4f023b5235f0fa2ead1279dc93f74bc17801ed906d330e3cd68ee8d3e96b697d21d23cfe2b755f5a9eb555bd5390a8c4dac",
|
||||
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/11.8.0/amd64/iso-cd/debian-11.8.0-amd64-netinst.iso",
|
||||
"net_device": "virtio-net",
|
||||
"output_directory": "../dist",
|
||||
"qemuargs": [
|
||||
|
||||
@ -651,7 +651,7 @@
|
||||
"label.level": "Level",
|
||||
"label.limitcpuuse": "CPU Cap",
|
||||
"label.link.domain.to.ldap": "Link Domain to LDAP",
|
||||
"label.linklocalip": "Link Local IP Address",
|
||||
"label.linklocalip": "Control IP Address",
|
||||
"label.load.balancer": "Load Balancer",
|
||||
"label.loadbalancerinstance": "Assigned VMs",
|
||||
"label.loadbalancerrule": "Load balancing rule",
|
||||
|
||||
@ -651,7 +651,7 @@
|
||||
"label.level": "Level",
|
||||
"label.limitcpuuse": "CPU Cap",
|
||||
"label.link.domain.to.ldap": "Link Domain to LDAP",
|
||||
"label.linklocalip": "Link Local IP Address",
|
||||
"label.linklocalip": "Control IP Address",
|
||||
"label.load.balancer": "Load Balancer",
|
||||
"label.loadbalancerinstance": "Assigned VMs",
|
||||
"label.loadbalancerrule": "Load balancing rule",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -651,7 +651,7 @@
|
||||
"label.level": "Szint",
|
||||
"label.limitcpuuse": "CPU Cap",
|
||||
"label.link.domain.to.ldap": "Link Domain to LDAP",
|
||||
"label.linklocalip": "Link Local IP Address",
|
||||
"label.linklocalip": "Control IP Address",
|
||||
"label.load.balancer": "Terhel\u00e9seloszt\u00f3",
|
||||
"label.loadbalancerinstance": "Hozz\u00e1rendelt VM-ek",
|
||||
"label.loadbalancerrule": "Terhel\u00e9seloszt\u00f3 szab\u00e1ly",
|
||||
|
||||
@ -651,7 +651,7 @@
|
||||
"label.level": "Livello",
|
||||
"label.limitcpuuse": "Limite CPU",
|
||||
"label.link.domain.to.ldap": "Link Domain to LDAP",
|
||||
"label.linklocalip": "Link Local IP Address",
|
||||
"label.linklocalip": "Control IP Address",
|
||||
"label.load.balancer": "Load Balancer",
|
||||
"label.loadbalancerinstance": "Assigned VMs",
|
||||
"label.loadbalancerrule": "Load balancing rule",
|
||||
|
||||
@ -652,7 +652,7 @@
|
||||
"label.level": "Level",
|
||||
"label.limitcpuuse": "CPU Cap",
|
||||
"label.link.domain.to.ldap": "link domein aan LDAP",
|
||||
"label.linklocalip": "Link Local IP Adres",
|
||||
"label.linklocalip": "Control IP Adres",
|
||||
"label.load.balancer": "Load Balancer",
|
||||
"label.loadbalancerinstance": "toegewezen VMs",
|
||||
"label.loadbalancerrule": "load balancing regel",
|
||||
|
||||
@ -651,7 +651,7 @@
|
||||
"label.level": "Poziom",
|
||||
"label.limitcpuuse": "CPU Cap",
|
||||
"label.link.domain.to.ldap": "Link Domain to LDAP",
|
||||
"label.linklocalip": "Link Local IP Address",
|
||||
"label.linklocalip": "Control IP Address",
|
||||
"label.load.balancer": "Load Balancer",
|
||||
"label.loadbalancerinstance": "Assigned VMs",
|
||||
"label.loadbalancerrule": "Load balancing rule",
|
||||
|
||||
@ -928,7 +928,7 @@
|
||||
"label.limitcpuuse": "Limite da CPU",
|
||||
"label.limits": "Configurar limites",
|
||||
"label.link.domain.to.ldap": "Link dom\u00ednio para LDAP",
|
||||
"label.linklocalip": "Endere\u00e7o IP do link local",
|
||||
"label.linklocalip": "Endere\u00e7o IP do Control",
|
||||
"label.linux": "Linux",
|
||||
"label.list.ciscoasa1000v": "ASA 1000v",
|
||||
"label.list.ciscovnmc": "Cisco VNMC",
|
||||
|
||||
@ -170,7 +170,10 @@
|
||||
<router-link :to="{ path: '/volume/' + record.volumeid }">{{ text }}</router-link>
|
||||
</template>
|
||||
<template v-if="column.key === 'size'">
|
||||
<span v-if="text">
|
||||
<span v-if="text && $route.path === '/kubernetes'">
|
||||
{{ text }}
|
||||
</span>
|
||||
<span v-else-if="text">
|
||||
{{ parseFloat(parseFloat(text) / 1024.0 / 1024.0 / 1024.0).toFixed(2) }} GiB
|
||||
</span>
|
||||
</template>
|
||||
@ -187,17 +190,18 @@
|
||||
</template>
|
||||
<template v-if="column.key === 'hypervisor'">
|
||||
<span v-if="$route.name === 'hypervisorcapability'">
|
||||
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
|
||||
</span>
|
||||
<span v-else-if="$route.name === 'guestoshypervisormapping'">
|
||||
<QuickView
|
||||
style="margin-left: 5px"
|
||||
:actions="actions"
|
||||
:resource="record"
|
||||
:enabled="quickViewEnabled() && actions.length > 0 && columns && columns[0].dataIndex === 'hypervisor' "
|
||||
@exec-action="$parent.execAction"/>
|
||||
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
|
||||
</span>
|
||||
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
|
||||
</span>
|
||||
<span v-else-if="$route.name === 'guestoshypervisormapping'">
|
||||
<QuickView
|
||||
style="margin-left: 5px"
|
||||
:actions="actions"
|
||||
:resource="record"
|
||||
:enabled="quickViewEnabled() && actions.length > 0 && columns && columns[0].dataIndex === 'hypervisor' "
|
||||
@exec-action="$parent.execAction"/>
|
||||
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
|
||||
</span>
|
||||
</template>
|
||||
<span v-else>{{ text }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'osname'">
|
||||
@ -268,8 +272,6 @@
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'level'">
|
||||
<router-link :to="{ path: '/event/' + record.id }">{{ text }}</router-link>
|
||||
</template>
|
||||
|
||||
@ -454,6 +454,77 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'vmsnapshot',
|
||||
title: 'label.vm.snapshots',
|
||||
icon: 'camera-outlined',
|
||||
docHelp: 'adminguide/storage.html#working-with-volume-snapshots',
|
||||
permission: ['listVMSnapshot'],
|
||||
resourceType: 'VMSnapshot',
|
||||
columns: () => {
|
||||
const fields = ['displayname', 'state', 'name', 'type', 'current', 'parentName', 'created']
|
||||
if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
|
||||
fields.push('domain')
|
||||
fields.push('account')
|
||||
}
|
||||
return fields
|
||||
},
|
||||
details: ['name', 'id', 'displayname', 'description', 'type', 'current', 'parentName', 'virtualmachineid', 'account', 'domain', 'created'],
|
||||
searchFilters: ['name', 'domainid', 'account', 'tags'],
|
||||
tabs: [
|
||||
{
|
||||
name: 'details',
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
|
||||
},
|
||||
{
|
||||
name: 'comments',
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
api: 'createSnapshotFromVMSnapshot',
|
||||
icon: 'camera-outlined',
|
||||
label: 'label.action.create.snapshot.from.vmsnapshot',
|
||||
message: 'message.action.create.snapshot.from.vmsnapshot',
|
||||
dataView: true,
|
||||
popup: true,
|
||||
show: (record) => { return (record.state === 'Ready' && record.hypervisor === 'KVM') },
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/CreateSnapshotFromVMSnapshot.vue')))
|
||||
},
|
||||
{
|
||||
api: 'revertToVMSnapshot',
|
||||
icon: 'sync-outlined',
|
||||
label: 'label.action.vmsnapshot.revert',
|
||||
message: 'label.action.vmsnapshot.revert',
|
||||
dataView: true,
|
||||
show: (record) => { return record.state === 'Ready' },
|
||||
args: ['vmsnapshotid'],
|
||||
mapping: {
|
||||
vmsnapshotid: {
|
||||
value: (record) => { return record.id }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
api: 'deleteVMSnapshot',
|
||||
icon: 'delete-outlined',
|
||||
label: 'label.action.vmsnapshot.delete',
|
||||
message: 'message.action.vmsnapshot.delete',
|
||||
dataView: true,
|
||||
show: (record) => { return ['Ready', 'Expunging', 'Error'].includes(record.state) },
|
||||
args: ['vmsnapshotid'],
|
||||
mapping: {
|
||||
vmsnapshotid: {
|
||||
value: (record) => { return record.id }
|
||||
}
|
||||
},
|
||||
groupAction: true,
|
||||
popup: true,
|
||||
groupMap: (selection) => { return selection.map(x => { return { vmsnapshotid: x } }) }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'kubernetes',
|
||||
title: 'label.kubernetes',
|
||||
|
||||
@ -23,7 +23,7 @@ export default {
|
||||
docHelp: 'adminguide/accounts.html#roles',
|
||||
permission: ['listRoles', 'listRolePermissions'],
|
||||
columns: ['name', 'type', 'description'],
|
||||
details: ['name', 'id', 'type', 'description'],
|
||||
details: ['name', 'id', 'type', 'description', 'ispublic'],
|
||||
tabs: [{
|
||||
name: 'details',
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
|
||||
@ -53,7 +53,7 @@ export default {
|
||||
icon: 'edit-outlined',
|
||||
label: 'label.edit.role',
|
||||
dataView: true,
|
||||
args: ['name', 'description', 'type'],
|
||||
args: ['name', 'description', 'type', 'ispublic'],
|
||||
mapping: {
|
||||
type: {
|
||||
options: ['Admin', 'DomainAdmin', 'User']
|
||||
|
||||
@ -387,77 +387,6 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'vmsnapshot',
|
||||
title: 'label.vm.snapshots',
|
||||
icon: 'camera-outlined',
|
||||
docHelp: 'adminguide/storage.html#working-with-volume-snapshots',
|
||||
permission: ['listVMSnapshot'],
|
||||
resourceType: 'VMSnapshot',
|
||||
columns: () => {
|
||||
const fields = ['displayname', 'state', 'name', 'type', 'current', 'parentName', 'created']
|
||||
if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
|
||||
fields.push('account')
|
||||
fields.push('domain')
|
||||
}
|
||||
return fields
|
||||
},
|
||||
details: ['name', 'id', 'displayname', 'description', 'type', 'current', 'parentName', 'virtualmachineid', 'account', 'domain', 'created'],
|
||||
searchFilters: ['name', 'domainid', 'account', 'tags'],
|
||||
tabs: [
|
||||
{
|
||||
name: 'details',
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
|
||||
},
|
||||
{
|
||||
name: 'comments',
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
api: 'createSnapshotFromVMSnapshot',
|
||||
icon: 'camera-outlined',
|
||||
label: 'label.action.create.snapshot.from.vmsnapshot',
|
||||
message: 'message.action.create.snapshot.from.vmsnapshot',
|
||||
dataView: true,
|
||||
popup: true,
|
||||
show: (record) => { return (record.state === 'Ready' && record.hypervisor === 'KVM') },
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/CreateSnapshotFromVMSnapshot.vue')))
|
||||
},
|
||||
{
|
||||
api: 'revertToVMSnapshot',
|
||||
icon: 'sync-outlined',
|
||||
label: 'label.action.vmsnapshot.revert',
|
||||
message: 'label.action.vmsnapshot.revert',
|
||||
dataView: true,
|
||||
show: (record) => { return record.state === 'Ready' },
|
||||
args: ['vmsnapshotid'],
|
||||
mapping: {
|
||||
vmsnapshotid: {
|
||||
value: (record) => { return record.id }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
api: 'deleteVMSnapshot',
|
||||
icon: 'delete-outlined',
|
||||
label: 'label.action.vmsnapshot.delete',
|
||||
message: 'message.action.vmsnapshot.delete',
|
||||
dataView: true,
|
||||
show: (record) => { return ['Ready', 'Expunging', 'Error'].includes(record.state) },
|
||||
args: ['vmsnapshotid'],
|
||||
mapping: {
|
||||
vmsnapshotid: {
|
||||
value: (record) => { return record.id }
|
||||
}
|
||||
},
|
||||
groupAction: true,
|
||||
popup: true,
|
||||
groupMap: (selection) => { return selection.map(x => { return { vmsnapshotid: x } }) }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'backup',
|
||||
title: 'label.backup',
|
||||
|
||||
@ -99,6 +99,13 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item name="ispublic" ref="ispublic">
|
||||
<template #label>
|
||||
<tooltip-label :title="$t('label.ispublic')" :tooltip="apiParams.ispublic.description"/>
|
||||
</template>
|
||||
<a-switch v-model:checked="form.ispublic"/>
|
||||
</a-form-item>
|
||||
|
||||
<div :span="24" class="action-button">
|
||||
<a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
|
||||
<a-button :loading="loading" ref="submit" type="primary" @click="handleSubmit">{{ $t('label.ok') }}</a-button>
|
||||
@ -150,7 +157,8 @@ export default {
|
||||
initForm () {
|
||||
this.formRef = ref()
|
||||
this.form = reactive({
|
||||
using: 'type'
|
||||
using: 'type',
|
||||
ispublic: true
|
||||
})
|
||||
this.rules = reactive({
|
||||
name: [{ required: true, message: this.$t('message.error.required.input') }],
|
||||
|
||||
@ -80,6 +80,13 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item name="ispublic" ref="ispublic">
|
||||
<template #label>
|
||||
<tooltip-label :title="$t('label.ispublic')" :tooltip="apiParams.ispublic.description"/>
|
||||
</template>
|
||||
<a-switch v-model:checked="form.ispublic"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item name="forced" ref="forced">
|
||||
<template #label>
|
||||
<tooltip-label :title="$t('label.forced')" :tooltip="apiParams.forced.description"/>
|
||||
@ -124,7 +131,7 @@ export default {
|
||||
methods: {
|
||||
initForm () {
|
||||
this.formRef = ref()
|
||||
this.form = reactive({})
|
||||
this.form = reactive({ ispublic: true })
|
||||
this.rules = reactive({
|
||||
file: [
|
||||
{ required: true, message: this.$t('message.error.required.input') },
|
||||
|
||||
@ -244,14 +244,19 @@
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item name="pcidevice" ref="pcidevice" :label="$t('label.gpu')" v-if="!isSystem">
|
||||
<a-radio-group
|
||||
<a-select
|
||||
v-model:value="form.pcidevice"
|
||||
buttonStyle="solid"
|
||||
@change="selected => { handleGpuChange(selected.target.value) }">
|
||||
<a-radio-button v-for="(opt, optIndex) in gpuTypes" :key="optIndex" :value="opt.value">
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
:filterOption="(input, option) => {
|
||||
return option.children[0].children.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}"
|
||||
:placeholder="$t('label.gpu')"
|
||||
@change="handleGpuChange">
|
||||
<a-select-option v-for="(opt, optIndex) in gpuTypes" :key="optIndex" :value="opt.value">
|
||||
{{ opt.title }}
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item name="vgputype" ref="vgputype" :label="$t('label.vgputype')" v-if="vGpuVisible">
|
||||
<a-select
|
||||
@ -643,14 +648,34 @@ export default {
|
||||
vgpu: []
|
||||
},
|
||||
{
|
||||
value: 'Group of NVIDIA Corporation GK107GL [GRID K1] GPUs',
|
||||
title: 'NVIDIA GRID K1',
|
||||
vgpu: ['', 'passthrough', 'GRID K100', 'GRID K120Q', 'GRID K140Q', 'GRID K160Q', 'GRID K180Q']
|
||||
value: 'Group of NVIDIA Corporation GV100GL [TESLA V100] GPUs',
|
||||
title: 'NVIDIA TESLA V100',
|
||||
vgpu: ['', 'passthrough', 'GRID V100D-1A', 'GRID V100D-1B', 'GRID V100D-1Q', 'GRID V100D-2A', 'GRID V100D-2B', 'GRID V100D-2B4', 'GRID V100D-2Q', 'GRID V100D-4A', 'GRID V100D-4Q', 'GRID V100D-8A', 'GRID V100D-8Q', 'GRID V100D-16A', 'GRID V100D-16Q', 'GRID V100D-32A', 'GRID V100D-32Q']
|
||||
},
|
||||
{
|
||||
value: 'Group of NVIDIA Corporation GK104GL [GRID K2] GPUs',
|
||||
title: 'NVIDIA GRID K2',
|
||||
vgpu: ['', 'passthrough', 'GRID K200', 'GRID K220Q', 'GRID K240Q', 'GRID K260Q', 'GRID K280Q']
|
||||
value: 'Group of Nvidia Corporation TU104GL [Tesla T4] GPUs',
|
||||
title: 'NVIDIA TESLA T4',
|
||||
vgpu: ['', 'passthrough', 'GRID T4-1A', 'GRID T4-1B', 'GRID T4-1Q', 'GRID T4-2A', 'GRID T4-2B', 'GRID T4-2B4', 'GRID T4-2Q', 'GRID T4-4A', 'GRID T4-4Q', 'GRID T4-8A', 'GRID T4-8Q', 'GRID T4-16A', 'GRID T4-16Q']
|
||||
},
|
||||
{
|
||||
value: 'Group of Nvidia Corporation GA102 [RTX A5500] GPUs',
|
||||
title: 'NVIDIA RTX A5500',
|
||||
vgpu: ['', 'passthrough', 'NVIDIA RTXA5500-1A', 'NVIDIA RTXA5500-1B', 'NVIDIA RTXA5500-1Q', 'NVIDIA RTXA5500-2A', 'NVIDIA RTXA5500-2B', 'NVIDIA RTXA5500-2Q', 'NVIDIA RTXA5500-3A', 'NVIDIA RTXA5500-3Q', 'NVIDIA RTXA5500-4A', 'NVIDIA RTXA5500-4Q', 'NVIDIA RTXA5500-6A', 'NVIDIA RTXA5500-6Q', 'NVIDIA RTXA5500-8A', 'NVIDIA RTXA5500-8Q', 'NVIDIA RTXA5500-12A', 'NVIDIA RTXA5500-12Q', 'NVIDIA RTXA5500-24A', 'NVIDIA RTXA5500-24Q']
|
||||
},
|
||||
{
|
||||
value: 'Group of NVIDIA Corporation GA102GL [A40] GPUs',
|
||||
title: 'NVIDIA RTX A40',
|
||||
vgpu: ['', 'passthrough', 'NVIDIA A40-1A', 'NVIDIA A40-1B', 'NVIDIA A40-1Q', 'NVIDIA A40-2A', 'NVIDIA A40-2B', 'NVIDIA A40-2Q', 'NVIDIA A40-3A', 'NVIDIA A40-3Q', 'NVIDIA A40-4A', 'NVIDIA A40-4Q', 'NVIDIA A40-6A', 'NVIDIA A40-6Q', 'NVIDIA A40-8A', 'NVIDIA A40-8Q', 'NVIDIA A40-12A', 'NVIDIA A40-12Q', 'NVIDIA A40-16A', 'NVIDIA A40-16Q', 'NVIDIA A40-24A', 'NVIDIA A40-24Q', 'NVIDIA A40-48A', 'NVIDIA A40-48Q']
|
||||
},
|
||||
{
|
||||
value: 'Group of NVIDIA Corporation GA107 [NVIDIA A16/NVIDIA A2] GPUs',
|
||||
title: 'NVIDIA RTX A2',
|
||||
vgpu: ['', 'passthrough', 'NVIDIA A2-1A', 'NVIDIA A2-1B', 'NVIDIA A2-1Q', 'NVIDIA A2-2A', 'NVIDIA A2-2B', 'NVIDIA A2-2Q', 'NVIDIA A2-4A', 'NVIDIA A2-4Q', 'NVIDIA A2-8A', 'NVIDIA A2-8Q', 'NVIDIA A2-16A', 'NVIDIA A2-16Q']
|
||||
},
|
||||
{
|
||||
value: 'Group of NVIDIA Corporation GA102GL [A10] GPUs',
|
||||
title: 'NVIDIA RTX A10',
|
||||
vgpu: ['', 'passthrough', 'NVIDIA A10-1A', 'NVIDIA A10-1B', 'NVIDIA A10-1Q', 'NVIDIA A10-2A', 'NVIDIA A10-2B', 'NVIDIA A10-2Q', 'NVIDIA A10-3A', 'NVIDIA A10-3Q', 'NVIDIA A10-4A', 'NVIDIA A10-4Q', 'NVIDIA A10-6A', 'NVIDIA A10-6Q', 'NVIDIA A10-8A', 'NVIDIA A10-8Q', 'NVIDIA A10-12A', 'NVIDIA A10-12Q', 'NVIDIA A10-24A', 'NVIDIA A10-24Q']
|
||||
}
|
||||
],
|
||||
vGpuVisible: false,
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<dataset>
|
||||
<configuration name="usage.stats.job.aggregation.range" value="600" instance="test"/>
|
||||
|
||||
<vm_instance type="User" id="8" account_id="1" domain_id="1" name="test" instance_name="test" state="destoyed" guest_os_id="1" service_offering_id="1" data_center_id="1" vnc_password="xyz" vm_type="User" created="2019-01-01 00:00:01" removed="2018-01-01 00:00:01" />
|
||||
<vm_instance type="User" id="8" account_id="1" domain_id="1" name="test" instance_name="test" state="destroyed" guest_os_id="1" service_offering_id="1" data_center_id="1" vnc_password="xyz" vm_type="User" created="2019-01-01 00:00:01" removed="2018-01-01 00:00:01" />
|
||||
|
||||
<volumes id="16" account_id="1" domain_id="1" size="1" data_center_id="1" volume_type="root" disk_offering_id="1" removed="2018-01-01 00:00:01"/>
|
||||
<volumes id="17" account_id="1" domain_id="1" size="1" data_center_id="1" volume_type="root" disk_offering_id="1" removed="2019-01-01 00:00:01"/>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<dataset>
|
||||
<configuration name="usage.stats.job.aggregation.range" value="600" instance="test" />
|
||||
|
||||
<vm_instance type="User" id="8" account_id="1" domain_id="1" name="test" instance_name="test" state="destoyed" guest_os_id="1" service_offering_id="1" data_center_id="1" vnc_password="xyz" vm_type="User" created="2019-01-01 00:00:01" removed="2018-01-01 00:00:01" />
|
||||
<vm_instance type="User" id="8" account_id="1" domain_id="1" name="test" instance_name="test" state="destroyed" guest_os_id="1" service_offering_id="1" data_center_id="1" vnc_password="xyz" vm_type="User" created="2019-01-01 00:00:01" removed="2018-01-01 00:00:01" />
|
||||
|
||||
<volumes id="16" account_id="1" domain_id="1" size="1" data_center_id="1" volume_type="root" disk_offering_id="1" removed="2018-01-01 00:00:01"/>
|
||||
<volumes id="17" account_id="1" domain_id="1" size="1" data_center_id="1" volume_type="root" disk_offering_id="1" removed="2018-01-01 00:00:01"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user