Merge branch 'master' into scaleupvm

This commit is contained in:
Nitin Mehta 2013-03-27 16:33:42 +05:30
commit 2423d4a579
254 changed files with 9351 additions and 2610 deletions

View File

@ -1,7 +1,7 @@
Apache CloudStack (Incubating) CHANGES
======================================
Full release notes for each release are located in the project's documentation website: http://incubator.apache.org/cloudstack/docs
Full release notes for each release are located in the project's documentation website: http://cloudstack.apache.org/docs
Version 4.0.0-incubating
------------------------

View File

@ -1,7 +1,7 @@
This document describes how to develop, build, package and install Apache CloudStack
(Incubating). For more information please refer to the project's website:
http://incubator.apache.org/cloudstack
http://cloudstack.apache.org
Apache CloudStack developers use various platforms for development, this guide
was tested against a CentOS 6.2 x86_64 setup.
@ -77,7 +77,7 @@ Start the MySQL service:
You may get the source code from the repository hosted on Apache:
$ git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git
$ git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git
Or, you may fork a repository from the official Apache CloudStack mirror by
Apache on [Github](https://github.com/apache/incubator-cloudstack)

View File

@ -370,7 +370,7 @@ Within the scripts/vm/hypervisor/xenserver directory
from OpenStack, LLC http://www.openstack.org
swift
Within the tools/appliance/definitions/systemvmtemplate and tools/appliance/definitions/systemvmtemplate64 directory
Within the tools/appliance/definitions/{devcloud,systemvmtemplate,systemvmtemplate64} directories
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright (c) 2010-2012 Patrick Debois

View File

@ -17,12 +17,14 @@ Apache CloudStack offers three methods for managing cloud
computing environments: an easy to use Web interface, command
line tools, and a full-featured RESTful API.
Visit us at [cloudstack.org](http://incubator.apache.org/cloudstack).
Visit us at [Apache CloudStack](http://cloudstack.apache.org).
## Mailing lists
[Development Mailing List](mailto:cloudstack-dev-subscribe@incubator.apache.org)
[Users Mailing list](mailto:cloudstack-users-subscribe@incubator.apache.org)
[Commits mailing list](mailto:cloudstack-commits-subscribe@incubator.apache.org)
[Development Mailing List](mailto:dev-subscribe@cloudstack.apache.org)
[Users Mailing List](mailto:users-subscribe@cloudstack.apache.org)
[Commits Mailing List](mailto:commits-subscribe@cloudstack.apache.org)
[Issues Mailing List](mailto:issues-subscribe@cloudstack.apache.org)
[Marketing Mailing List](mailto:marketing-subscribe@cloudstack.apache.org)
# License

View File

@ -61,7 +61,7 @@ Once installed per the Vagrant installation process, run:
$ vagrant box add devcloud [path to devcloud.box]
Then, either go into the devcloudbox folder of your checked out version of the
CloudStack code (incubator-cloudstack/tools/devcloud/devcloudbox), or copy the
CloudStack code (cloudstack/tools/devcloud/devcloudbox), or copy the
contents of that folder to another location.
Assuming the patched Vagrant installation is working, you then

View File

@ -0,0 +1,42 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.agent.api.routing;
import java.util.List;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.to.LoadBalancerTO;
import com.cloud.agent.api.to.NicTO;
/**
* LoadBalancerConfigCommand sends the load balancer configuration
*/
public class HealthCheckLBConfigAnswer extends Answer {
List<LoadBalancerTO> loadBalancers;
protected HealthCheckLBConfigAnswer() {
}
public HealthCheckLBConfigAnswer(List<LoadBalancerTO> loadBalancers) {
this.loadBalancers = loadBalancers;
}
public List<LoadBalancerTO> getLoadBalancers() {
return loadBalancers;
}
}

View File

@ -0,0 +1,39 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.agent.api.routing;
import com.cloud.agent.api.to.LoadBalancerTO;
import com.cloud.agent.api.to.NicTO;
/**
* LoadBalancerConfigCommand sends the load balancer configuration
*/
public class HealthCheckLBConfigCommand extends NetworkElementCommand {
LoadBalancerTO[] loadBalancers;
protected HealthCheckLBConfigCommand() {
}
public HealthCheckLBConfigCommand(LoadBalancerTO[] loadBalancers) {
this.loadBalancers = loadBalancers;
}
public LoadBalancerTO[] getLoadBalancers() {
return loadBalancers;
}
}

View File

@ -31,6 +31,7 @@ import com.cloud.network.lb.LoadBalancingRule.LbAutoScaleVmGroup;
import com.cloud.network.lb.LoadBalancingRule.LbAutoScaleVmProfile;
import com.cloud.network.lb.LoadBalancingRule.LbCondition;
import com.cloud.network.lb.LoadBalancingRule.LbDestination;
import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy;
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
import com.cloud.utils.Pair;
@ -46,8 +47,10 @@ public class LoadBalancerTO {
boolean inline;
DestinationTO[] destinations;
private StickinessPolicyTO[] stickinessPolicies;
private HealthCheckPolicyTO[] healthCheckPolicies;
private AutoScaleVmGroupTO autoScaleVmGroupTO;
final static int MAX_STICKINESS_POLICIES = 1;
final static int MAX_HEALTHCHECK_POLICIES = 1;
public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List<LbDestination> destinations) {
if (destinations == null) { // for autoscaleconfig destinations will be null;
@ -69,23 +72,52 @@ public class LoadBalancerTO {
}
}
public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List<LbDestination> arg_destinations, List<LbStickinessPolicy> stickinessPolicies) {
public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked,
boolean alreadyAdded, boolean inline, List<LbDestination> arg_destinations,
List<LbStickinessPolicy> stickinessPolicies) {
this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations,
stickinessPolicies, null);
}
public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked,
boolean alreadyAdded, boolean inline, List<LbDestination> arg_destinations,
List<LbStickinessPolicy> stickinessPolicies, List<LbHealthCheckPolicy> healthCheckPolicies) {
this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations);
this.stickinessPolicies = null;
this.healthCheckPolicies = null;
if (stickinessPolicies != null && stickinessPolicies.size() > 0) {
this.stickinessPolicies = new StickinessPolicyTO[MAX_STICKINESS_POLICIES];
int index = 0;
for (LbStickinessPolicy stickinesspolicy : stickinessPolicies) {
if (!stickinesspolicy.isRevoked()) {
this.stickinessPolicies[index] = new StickinessPolicyTO(stickinesspolicy.getMethodName(), stickinesspolicy.getParams());
this.stickinessPolicies[index] = new StickinessPolicyTO(stickinesspolicy.getMethodName(),
stickinesspolicy.getParams());
index++;
if (index == MAX_STICKINESS_POLICIES) break;
}
if (index == MAX_STICKINESS_POLICIES)
break;
}
if (index == 0) this.stickinessPolicies = null;
}
if (index == 0)
this.stickinessPolicies = null;
}
if (healthCheckPolicies != null && healthCheckPolicies.size() > 0) {
this.healthCheckPolicies = new HealthCheckPolicyTO[MAX_HEALTHCHECK_POLICIES];
int index = 0;
for (LbHealthCheckPolicy hcp : healthCheckPolicies) {
this.healthCheckPolicies[0] = new HealthCheckPolicyTO(hcp.getpingpath(), hcp.getDescription(),
hcp.getResponseTime(), hcp.getHealthcheckInterval(), hcp.getHealthcheckThresshold(),
hcp.getUnhealthThresshold(), hcp.isRevoked());
index++;
if (index == MAX_HEALTHCHECK_POLICIES)
break;
}
if (index == 0)
this.healthCheckPolicies = null;
}
}
protected LoadBalancerTO() {
}
@ -126,6 +158,10 @@ public class LoadBalancerTO {
return stickinessPolicies;
}
public HealthCheckPolicyTO[] getHealthCheckPolicies() {
return healthCheckPolicies;
}
public DestinationTO[] getDestinations() {
return destinations;
}
@ -158,6 +194,65 @@ public class LoadBalancerTO {
this._methodName = methodName;
this._paramsList = paramsList;
}
}
public static class HealthCheckPolicyTO {
private String pingPath;
private String description;
private int responseTime;
private int healthcheckInterval;
private int healthcheckThresshold;
private int unhealthThresshold;
private boolean revoke = false;
public HealthCheckPolicyTO(String pingPath, String description, int responseTime, int healthcheckInterval,
int healthcheckThresshold, int unhealthThresshold, boolean revoke) {
this.description = description;
this.pingPath = pingPath;
this.responseTime = responseTime;
this.healthcheckInterval = healthcheckInterval;
this.healthcheckThresshold = healthcheckThresshold;
this.unhealthThresshold = unhealthThresshold;
this.revoke = revoke;
}
public HealthCheckPolicyTO() {
}
public String getpingPath() {
return pingPath;
}
public String getDescription() {
return description;
}
public int getResponseTime() {
return responseTime;
}
public int getHealthcheckInterval() {
return healthcheckInterval;
}
public int getHealthcheckThresshold() {
return healthcheckThresshold;
}
public int getUnhealthThresshold() {
return unhealthThresshold;
}
public void setRevoke(boolean revoke) {
this.revoke = revoke;
}
public boolean isRevoked() {
return revoke;
}
}
public static class DestinationTO {
@ -165,6 +260,7 @@ public class LoadBalancerTO {
int destPort;
boolean revoked;
boolean alreadyAdded;
String monitorState;
public DestinationTO(String destIp, int destPort, boolean revoked, boolean alreadyAdded) {
this.destIp = destIp;
this.destPort = destPort;
@ -190,6 +286,14 @@ public class LoadBalancerTO {
public boolean isAlreadyAdded() {
return alreadyAdded;
}
public void setMonitorState(String state) {
this.monitorState = state;
}
public String getMonitorState() {
return monitorState;
}
}
public static class CounterTO implements Serializable {
private final String name;

View File

@ -111,6 +111,8 @@ public class EventTypes {
public static final String EVENT_LOAD_BALANCER_DELETE = "LB.DELETE";
public static final String EVENT_LB_STICKINESSPOLICY_CREATE = "LB.STICKINESSPOLICY.CREATE";
public static final String EVENT_LB_STICKINESSPOLICY_DELETE = "LB.STICKINESSPOLICY.DELETE";
public static final String EVENT_LB_HEALTHCHECKPOLICY_CREATE = "LB.HEALTHCHECKPOLICY.CREATE";
public static final String EVENT_LB_HEALTHCHECKPOLICY_DELETE = "LB.HEALTHCHECKPOLICY.DELETE";
public static final String EVENT_LOAD_BALANCER_UPDATE = "LB.UPDATE";
// Account events

View File

@ -188,6 +188,7 @@ public interface Network extends ControlledEntity, StateObject<Network.State>, I
public static final Capability InlineMode = new Capability("InlineMode");
public static final Capability SupportedTrafficDirection = new Capability("SupportedTrafficDirection");
public static final Capability SupportedEgressProtocols = new Capability("SupportedEgressProtocols");
public static final Capability HealthCheckPolicy = new Capability("HealthCheckPolicy");
private String name;
@ -235,6 +236,8 @@ public interface Network extends ControlledEntity, StateObject<Network.State>, I
s_fsm.addTransition(State.Implemented, Event.DestroyNetwork, State.Shutdown);
s_fsm.addTransition(State.Shutdown, Event.OperationSucceeded, State.Allocated);
s_fsm.addTransition(State.Shutdown, Event.OperationFailed, State.Implemented);
s_fsm.addTransition(State.Setup, Event.DestroyNetwork, State.Destroy);
s_fsm.addTransition(State.Allocated, Event.DestroyNetwork, State.Destroy);
}
public static StateMachine2<State, Network.Event, Network> getStateMachine() {

View File

@ -259,4 +259,6 @@ public interface NetworkModel {
void checkRequestedIpAddresses(long networkId, String ip4, String ip6) throws InvalidParameterValueException;
String getStartIpv6Address(long id);
Nic getPlaceholderNic(Network network, Long podId);
}

View File

@ -18,6 +18,7 @@ package com.cloud.network.element;
import java.util.List;
import com.cloud.agent.api.to.LoadBalancerTO;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
import com.cloud.network.lb.LoadBalancingRule;
@ -25,6 +26,7 @@ import com.cloud.network.lb.LoadBalancingRule;
public interface LoadBalancingServiceProvider extends NetworkElement, IpDeployingRequester {
/**
* Apply rules
*
* @param network
* @param rules
* @return
@ -34,10 +36,14 @@ public interface LoadBalancingServiceProvider extends NetworkElement, IpDeployin
/**
* Validate rules
*
* @param network
* @param rule
* @return true/false. true should be return if there are no validations. false should be return if any oneof the validation fails.
* @return true/false. true should be return if there are no validations.
*false should be return if any oneof the validation fails.
* @throws
*/
boolean validateLBRule(Network network, LoadBalancingRule rule);
List<LoadBalancerTO> updateHealthChecks(Network network, List<LoadBalancingRule> lbrules);
}

View File

@ -32,11 +32,14 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
private List<LbDestination> destinations;
private List<LbStickinessPolicy> stickinessPolicies;
private LbAutoScaleVmGroup autoScaleVmGroup;
private List<LbHealthCheckPolicy> healthCheckPolicies;
public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations, List<LbStickinessPolicy> stickinessPolicies) {
public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations,
List<LbStickinessPolicy> stickinessPolicies, List<LbHealthCheckPolicy> healthCheckPolicies) {
this.lb = lb;
this.destinations = destinations;
this.stickinessPolicies = stickinessPolicies;
this.healthCheckPolicies = healthCheckPolicies;
}
@Override
@ -128,6 +131,10 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
return lb;
}
public void setDestinations(List<LbDestination> destinations) {
this.destinations = destinations;
}
public List<LbDestination> getDestinations() {
return destinations;
}
@ -136,11 +143,21 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
return stickinessPolicies;
}
public void setHealthCheckPolicies(List<LbHealthCheckPolicy> healthCheckPolicies) {
this.healthCheckPolicies = healthCheckPolicies;
}
public List<LbHealthCheckPolicy> getHealthCheckPolicies() {
return healthCheckPolicies;
}
public interface Destination {
String getIpAddress();
int getDestinationPortStart();
int getDestinationPortEnd();
boolean isRevoked();
}
@ -174,6 +191,64 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
}
}
public static class LbHealthCheckPolicy {
private String pingpath;
private String description;
private int responseTime;
private int healthcheckInterval;
private int healthcheckThresshold;
private int unhealthThresshold;
private boolean _revoke;
public LbHealthCheckPolicy(String pingpath, String description, int responseTime, int healthcheckInterval,
int healthcheckThresshold, int unhealthThresshold) {
this(pingpath, description, responseTime, healthcheckInterval, healthcheckThresshold, unhealthThresshold, false);
}
public LbHealthCheckPolicy(String pingpath, String description, int responseTime, int healthcheckInterval,
int healthcheckThresshold, int unhealthThresshold, boolean revoke) {
this.pingpath = pingpath;
this.description = description;
this.responseTime = responseTime;
this.healthcheckInterval = healthcheckInterval;
this.healthcheckThresshold = healthcheckThresshold;
this.unhealthThresshold = unhealthThresshold;
this._revoke = revoke;
}
public LbHealthCheckPolicy() {
}
public String getpingpath() {
return pingpath;
}
public String getDescription() {
return description;
}
public int getResponseTime() {
return responseTime;
}
public int getHealthcheckInterval() {
return healthcheckInterval;
}
public int getHealthcheckThresshold() {
return healthcheckThresshold;
}
public int getUnhealthThresshold() {
return unhealthThresshold;
}
public boolean isRevoked() {
return _revoke;
}
}
public static class LbDestination implements Destination {
private int portStart;
private int portEnd;
@ -191,10 +266,12 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
public String getIpAddress() {
return ip;
}
@Override
public int getDestinationPortStart() {
return portStart;
}
@Override
public int getDestinationPortEnd() {
return portEnd;
@ -230,15 +307,16 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
return null;
}
@Override
public TrafficType getTrafficType() {
return null;
}
@Override
public FirewallRuleType getType() {
return FirewallRuleType.User;
}
public LbAutoScaleVmGroup getAutoScaleVmGroup() {
return autoScaleVmGroup;
}
@ -274,8 +352,7 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
private final AutoScalePolicy policy;
private boolean revoked;
public LbAutoScalePolicy(AutoScalePolicy policy, List<LbCondition> conditions)
{
public LbAutoScalePolicy(AutoScalePolicy policy, List<LbCondition> conditions) {
this.policy = policy;
this.conditions = conditions;
}
@ -309,7 +386,9 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
private final String networkId;
private final String vmName;
public LbAutoScaleVmProfile(AutoScaleVmProfile profile, String autoScaleUserApiKey, String autoScaleUserSecretKey, String csUrl, String zoneId, String domainId, String serviceOfferingId, String templateId, String vmName, String networkId) {
public LbAutoScaleVmProfile(AutoScaleVmProfile profile, String autoScaleUserApiKey,
String autoScaleUserSecretKey, String csUrl, String zoneId, String domainId, String serviceOfferingId,
String templateId, String vmName, String networkId) {
this.profile = profile;
this.autoScaleUserApiKey = autoScaleUserApiKey;
this.autoScaleUserSecretKey = autoScaleUserSecretKey;
@ -369,7 +448,8 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
private final LbAutoScaleVmProfile profile;
private final String currentState;
public LbAutoScaleVmGroup(AutoScaleVmGroup vmGroup, List<LbAutoScalePolicy> policies, LbAutoScaleVmProfile profile, String currentState) {
public LbAutoScaleVmGroup(AutoScaleVmGroup vmGroup, List<LbAutoScalePolicy> policies,
LbAutoScaleVmProfile profile, String currentState) {
this.vmGroup = vmGroup;
this.policies = policies;
this.profile = profile;

View File

@ -18,8 +18,10 @@ package com.cloud.network.lb;
import java.util.List;
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLBHealthCheckPoliciesCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLBStickinessPoliciesCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRuleInstancesCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRulesCmd;
@ -28,6 +30,8 @@ import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRul
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
import com.cloud.network.rules.HealthCheckPolicy;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.network.rules.StickinessPolicy;
import com.cloud.uservm.UserVm;
@ -66,6 +70,22 @@ public interface LoadBalancingRulesService {
public boolean applyLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd) throws ResourceUnavailableException;
boolean deleteLBStickinessPolicy(long stickinessPolicyId, boolean apply);
/**
* Create a healthcheck policy to a load balancer from the given healthcheck
* parameters in (name,value) pairs.
*
* @param cmd
* the command specifying the stickiness method name, params
* (name,value pairs), policy name and description.
* @return the newly created stickiness policy if successfull, null
* otherwise
* @thows NetworkRuleConflictException
*/
public HealthCheckPolicy createLBHealthCheckPolicy(CreateLBHealthCheckPolicyCmd cmd);
public boolean applyLBHealthCheckPolicy(CreateLBHealthCheckPolicyCmd cmd) throws ResourceUnavailableException;
boolean deleteLBHealthCheckPolicy(long healthCheckPolicyId, boolean apply);
/**
* Assign a virtual machine, or list of virtual machines, to a load balancer.
*/
@ -104,8 +124,18 @@ public interface LoadBalancingRulesService {
*/
List<? extends StickinessPolicy> searchForLBStickinessPolicies(ListLBStickinessPoliciesCmd cmd);
/**
* List healthcheck policies based on the given criteria
*
* @param cmd
* the command specifies the load balancing rule id.
* @return list of healthcheck policies that match the criteria.
*/
List<? extends HealthCheckPolicy> searchForLBHealthCheckPolicies(ListLBHealthCheckPoliciesCmd cmd);
List<LoadBalancingRule> listByNetworkId(long networkId);
LoadBalancer findById(long LoadBalancer);
public void updateLBHealthChecks() throws ResourceUnavailableException;
}

View File

@ -0,0 +1,45 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.network.rules;
import java.util.List;
import com.cloud.utils.Pair;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
/**
*/
public interface HealthCheckPolicy extends InternalIdentity, Identity {
public long getLoadBalancerId();
public String getpingpath();
public String getDescription();
public int getResponseTime();
public int getHealthcheckInterval();
public int getHealthcheckThresshold();
public int getUnhealthThresshold();
public boolean isRevoke();
}

View File

@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.cloud.storage;
import java.util.List;
import org.apache.cloudstack.api.response.StorageProviderResponse;
public interface DataStoreProviderApiService {
public List<StorageProviderResponse> getDataStoreProviders(String type);
}

View File

@ -99,7 +99,7 @@ public interface StoragePool extends Identity, InternalIdentity {
/**
* @return
*/
Long getStorageProviderId();
String getStorageProviderName();
boolean isInMaintenance();
}

View File

@ -460,6 +460,11 @@ public class ApiConstants {
public static final String UCS_BLADE_ID = "bladeid";
public static final String VM_GUEST_IP = "vmguestip";
public static final String OLDER_THAN = "olderthan";
public static final String HEALTHCHECK_RESPONSE_TIMEOUT = "responsetimeout";
public static final String HEALTHCHECK_INTERVAL_TIME = "intervaltime";
public static final String HEALTHCHECK_HEALTHY_THRESHOLD = "healthythreshold";
public static final String HEALTHCHECK_UNHEALTHY_THRESHOLD = "unhealthythreshold";
public static final String HEALTHCHECK_PINGPATH = "pingpath";
public enum HostDetails {
all, capacity, events, stats, min;

View File

@ -61,6 +61,7 @@ import com.cloud.projects.ProjectService;
import com.cloud.resource.ResourceService;
import com.cloud.server.ManagementService;
import com.cloud.server.TaggedResourceService;
import com.cloud.storage.DataStoreProviderApiService;
import com.cloud.storage.StorageService;
import com.cloud.storage.VolumeApiService;
import com.cloud.storage.snapshot.SnapshotService;
@ -131,6 +132,7 @@ public abstract class BaseCmd {
@Inject public UsageService _usageService;
@Inject public NetworkUsageService _networkUsageService;
@Inject public VMSnapshotService _vmSnapshotService;
@Inject public DataStoreProviderApiService dataStoreProviderApiService;
public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException;

View File

@ -47,6 +47,7 @@ import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.InstanceGroupResponse;
import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
import org.apache.cloudstack.api.response.LBStickinessResponse;
import org.apache.cloudstack.api.response.LDAPConfigResponse;
import org.apache.cloudstack.api.response.LoadBalancerResponse;
@ -133,6 +134,7 @@ import com.cloud.network.as.Condition;
import com.cloud.network.as.Counter;
import com.cloud.network.router.VirtualRouter;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.HealthCheckPolicy;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.network.rules.PortForwardingRule;
import com.cloud.network.rules.StaticNatRule;
@ -213,6 +215,11 @@ public interface ResponseGenerator {
LBStickinessResponse createLBStickinessPolicyResponse(StickinessPolicy stickinessPolicy, LoadBalancer lb);
LBHealthCheckResponse createLBHealthCheckPolicyResponse(List<? extends HealthCheckPolicy> healthcheckPolicies,
LoadBalancer lb);
LBHealthCheckResponse createLBHealthCheckPolicyResponse(HealthCheckPolicy healthcheckPolicy, LoadBalancer lb);
PodResponse createPodResponse(Pod pod, Boolean showCapacities);
ZoneResponse createZoneResponse(DataCenter dataCenter, Boolean showCapacities);

View File

@ -33,7 +33,7 @@ import com.cloud.user.Account;
@APICommand(name = "removeRegion", description="Removes specified region", responseObject=SuccessResponse.class)
public class RemoveRegionCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(RemoveRegionCmd.class.getName());
private static final String s_name = "updateregionresponse";
private static final String s_name = "removeregionresponse";
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -73,8 +73,8 @@ public class CreateStoragePoolCmd extends BaseCmd {
private Long zoneId;
@Parameter(name=ApiConstants.PROVIDER, type=CommandType.STRING,
required=false, description="the storage provider uuid")
private String storageProviderUuid;
required=false, description="the storage provider name")
private String storageProviderName;
@Parameter(name=ApiConstants.SCOPE, type=CommandType.STRING,
required=false, description="the scope of the storage: cluster or zone")
@ -112,8 +112,8 @@ public class CreateStoragePoolCmd extends BaseCmd {
return zoneId;
}
public String getStorageProviderUuid() {
return this.storageProviderUuid;
public String getStorageProviderName() {
return this.storageProviderName;
}
public String getScope() {

View File

@ -0,0 +1,72 @@
/*
* 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.api.command.admin.storage;
import java.util.List;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.StorageProviderResponse;
import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
@APICommand(name = "listStorageProviders", description="Lists storage providers.", responseObject=StorageProviderResponse.class)
public class ListStorageProvidersCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListStorageProvidersCmd.class.getName());
private static final String s_name = "liststorageprovidersresponse";
@Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="the type of storage provider: either primary or image", required = true)
private String type;
@Override
public String getCommandName() {
return s_name;
}
public String getType() {
return this.type;
}
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException,
NetworkRuleConflictException {
if (getType() == null) {
throw new ServerApiException(ApiErrorCode.MALFORMED_PARAMETER_ERROR, "need to specify type: either primary or image");
}
List<StorageProviderResponse> providers = this.dataStoreProviderApiService.getDataStoreProviders(getType());
ListResponse<StorageProviderResponse> responses = new ListResponse<StorageProviderResponse>();
for (StorageProviderResponse provider : providers) {
provider.setObjectName("dataStoreProvider");
}
responses.setResponses(providers);
responses.setResponseName(this.getCommandName());
this.setResponseObject(responses);
}
}

View File

@ -35,7 +35,7 @@ import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
@APICommand(name = "assignVirtualMachine", description="Move a user VM to another user under same domain.", responseObject=UserVmResponse.class, since="3.0.0")
@APICommand(name = "assignVirtualMachine", description="Assign a VM from one account to another under the same domain. This API is available for Basic zones with security groups and Advance zones with guest networks. The VM is restricted to move between accounts under same domain.", responseObject=UserVmResponse.class, since="3.0.0")
public class AssignVMCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(AssignVMCmd.class.getName());
@ -46,7 +46,7 @@ public class AssignVMCmd extends BaseCmd {
/////////////////////////////////////////////////////
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType=UserVmResponse.class,
required=true, description="the vm ID of the user VM to be moved")
required=true, description="id of the VM to be moved")
private Long virtualMachineId;
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="account name of the new VM owner.")
@ -58,11 +58,11 @@ public class AssignVMCmd extends BaseCmd {
//Network information
@Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.UUID, entityType=NetworkResponse.class,
description="list of network ids that will be part of VM network after move in advanced network setting.")
description="list of new network ids in which the moved VM will participate. In case no network ids are provided the VM will be part of the default network for that zone. In case there is no network yet created for the new account the default network will be created.")
private List<Long> networkIds;
@Parameter(name=ApiConstants.SECURITY_GROUP_IDS, type=CommandType.LIST, collectionType=CommandType.UUID, entityType=SecurityGroupResponse.class,
description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is moved in a zone with Basic Network support.")
description="list of security group ids to be applied on the virtual machine. In case no security groups are provided the VM is part of the default security group.")
private List<Long> securityGroupIdList;
/////////////////////////////////////////////////////

View File

@ -0,0 +1,168 @@
// 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.api.command.user.loadbalancer;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.HealthCheckPolicy;
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
@APICommand(name = "createLBHealthCheckPolicy", description = "Creates a Load Balancer healthcheck policy ", responseObject = LBHealthCheckResponse.class, since="4.2.0")
@SuppressWarnings("rawtypes")
public class CreateLBHealthCheckPolicyCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger
.getLogger(CreateLBHealthCheckPolicyCmd.class.getName());
private static final String s_name = "createlbhealthcheckpolicyresponse";
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the load balancer rule")
private Long lbRuleId;
@Parameter(name = ApiConstants.DESCRIPTION, type = CommandType.STRING, description = "the description of the load balancer HealthCheck policy")
private String description;
@Parameter(name = ApiConstants.HEALTHCHECK_PINGPATH, type = CommandType.STRING, required = false, description = "HTTP Ping Path")
private String pingPath;
@Parameter(name = ApiConstants.HEALTHCHECK_RESPONSE_TIMEOUT, type = CommandType.INTEGER, required = false, description = "Time to wait when receiving a response from the health check (2sec - 60 sec)")
private int responsTimeOut;
@Parameter(name = ApiConstants.HEALTHCHECK_INTERVAL_TIME, type = CommandType.INTEGER, required = false, description = "Amount of time between health checks (1 sec - 20940 sec)")
private int healthCheckInterval;
@Parameter(name = ApiConstants.HEALTHCHECK_HEALTHY_THRESHOLD, type = CommandType.INTEGER, required = false, description = "Number of consecutive health check success before declaring an instance healthy")
private int healthyThreshold;
@Parameter(name = ApiConstants.HEALTHCHECK_UNHEALTHY_THRESHOLD, type = CommandType.INTEGER, required = false, description = "Number of consecutive health check failures before declaring an instance unhealthy")
private int unhealthyThreshold;
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
public Long getLbRuleId() {
return lbRuleId;
}
public String getDescription() {
return description;
}
public String getPingPath() {
return pingPath;
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public String getCommandName() {
return s_name;
}
@Override
public long getEntityOwnerId() {
Account account = UserContext.current().getCaller();
if (account != null) {
return account.getId();
}
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
public int getResponsTimeOut() {
return responsTimeOut;
}
public int getHealthCheckInterval() {
return healthCheckInterval;
}
public int getHealthyThreshold() {
return healthyThreshold;
}
public int getUnhealthyThreshold() {
return unhealthyThreshold;
}
@Override
public void execute() throws ResourceAllocationException, ResourceUnavailableException {
HealthCheckPolicy policy = null;
boolean success = false;
try {
UserContext.current().setEventDetails("Load balancer healthcheck policy Id : " + getEntityId());
success = _lbService.applyLBHealthCheckPolicy(this);
if (success) {
// State might be different after the rule is applied, so get new object here
policy = _entityMgr.findById(HealthCheckPolicy.class, getEntityId());
LoadBalancer lb = _lbService.findById(policy.getLoadBalancerId());
LBHealthCheckResponse hcResponse = _responseGenerator.createLBHealthCheckPolicyResponse(policy, lb);
setResponseObject(hcResponse);
hcResponse.setResponseName(getCommandName());
}
} finally {
if (!success || (policy == null)) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create healthcheck policy ");
}
}
}
@Override
public void create() {
try {
HealthCheckPolicy result = _lbService.createLBHealthCheckPolicy(this);
this.setEntityId(result.getId());
this.setEntityUuid(result.getUuid());
} catch (InvalidParameterValueException e) {
s_logger.warn("Exception: ", e);
throw new ServerApiException(ApiErrorCode.MALFORMED_PARAMETER_ERROR , e.getMessage());
}
}
@Override
public String getEventType() {
return EventTypes.EVENT_LB_HEALTHCHECKPOLICY_CREATE;
}
@Override
public String getEventDescription() {
return "Create Load Balancer HealthCheck policy";
}
}

View File

@ -0,0 +1,116 @@
// 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.api.command.user.loadbalancer;
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.rules.HealthCheckPolicy;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
@APICommand(name = "deleteLBHealthCheckPolicy", description = "Deletes a load balancer HealthCheck policy.", responseObject = SuccessResponse.class, since="4.2.0")
public class DeleteLBHealthCheckPolicyCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteLBHealthCheckPolicyCmd.class.getName());
private static final String s_name = "deletelbhealthcheckpolicyresponse";
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = LBHealthCheckResponse.class,
required = true, description = "the ID of the load balancer HealthCheck policy")
private Long id;
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
public Long getId() {
return id;
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public String getCommandName() {
return s_name;
}
@Override
public long getEntityOwnerId() {
Account account = UserContext.current().getCaller();
if (account != null) {
return account.getId();
}
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
@Override
public String getEventType() {
return EventTypes.EVENT_LB_HEALTHCHECKPOLICY_DELETE;
}
@Override
public String getEventDescription() {
return "deleting load balancer HealthCheck policy: " + getId();
}
@Override
public void execute() {
UserContext.current().setEventDetails("Load balancer healthcheck policy Id: " + getId());
boolean result = _lbService.deleteLBHealthCheckPolicy(getId() , true);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete load balancer healthcheck policy");
}
}
@Override
public String getSyncObjType() {
return BaseAsyncCmd.networkSyncObject;
}
@Override
public Long getSyncObjId() {
HealthCheckPolicy policy = _entityMgr.findById(HealthCheckPolicy.class,
getId());
if (policy == null) {
throw new InvalidParameterValueException("Unable to find load balancer healthcheck rule: " + id);
}
LoadBalancer lb = _lbService.findById(policy.getLoadBalancerId());
if (lb == null) {
throw new InvalidParameterValueException("Unable to find load balancer rule for healthcheck rule: " + id);
}
return lb.getNetworkId();
}
}

View File

@ -0,0 +1,85 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.ArrayList;
import java.util.List;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
import org.apache.cloudstack.api.response.LBStickinessResponse;
import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.network.rules.HealthCheckPolicy;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
@APICommand(name = "listLBHealthCheckPolicies", description = "Lists load balancer HealthCheck policies.", responseObject = LBHealthCheckResponse.class, since="4.2.0")
public class ListLBHealthCheckPoliciesCmd extends BaseListCmd {
public static final Logger s_logger = Logger
.getLogger(ListLBHealthCheckPoliciesCmd.class.getName());
private static final String s_name = "listlbhealthcheckpoliciesresponse";
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class,
required = true, description = "the ID of the load balancer rule")
private Long lbRuleId;
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
public Long getLbRuleId() {
return lbRuleId;
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public String getCommandName() {
return s_name;
}
@Override
public void execute() {
List<LBHealthCheckResponse> hcpResponses = new ArrayList<LBHealthCheckResponse>();
LoadBalancer lb = _lbService.findById(getLbRuleId());
ListResponse<LBHealthCheckResponse> response = new ListResponse<LBHealthCheckResponse>();
if (lb != null) {
List<? extends HealthCheckPolicy> healthCheckPolicies = _lbService.searchForLBHealthCheckPolicies(this);
LBHealthCheckResponse spResponse = _responseGenerator.createLBHealthCheckPolicyResponse(healthCheckPolicies, lb);
hcpResponses.add(spResponse);
response.setResponses(hcpResponses);
}
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
}

View File

@ -0,0 +1,98 @@
// 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.api.response;
import com.cloud.network.rules.HealthCheckPolicy;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
public class LBHealthCheckPolicyResponse extends BaseResponse {
@SerializedName("id")
@Param(description = "the LB HealthCheck policy ID")
private String id;
@SerializedName("pingpath")
@Param(description = "the pingpath of the healthcheck policy")
private String pingpath;
@SerializedName("description")
@Param(description = "the description of the healthcheck policy")
private String description;
@SerializedName("state")
@Param(description = "the state of the policy")
private String state;
@SerializedName("responsetime")
@Param(description = "Time to wait when receiving a response from the health check")
private int responseTime;
@SerializedName("healthcheckinterval")
@Param(description = "Amount of time between health checks")
private int healthcheckInterval;
@SerializedName("healthcheckthresshold")
@Param(description = "Number of consecutive health check success before declaring an instance healthy")
private int healthcheckthresshold;
@SerializedName("unhealthcheckthresshold")
@Param(description = "Number of consecutive health check failures before declaring an instance unhealthy.")
private int unhealthcheckthresshold;
public void setId(String id) {
this.id = id;
}
public String getpingpath() {
return pingpath;
}
public void setpingpath(String pingpath) {
this.pingpath = pingpath;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public LBHealthCheckPolicyResponse(HealthCheckPolicy healthcheckpolicy) {
if (healthcheckpolicy.isRevoke()) {
this.setState("Revoked");
}
if (healthcheckpolicy.getUuid() != null)
setId(healthcheckpolicy.getUuid());
this.pingpath = healthcheckpolicy.getpingpath();
this.healthcheckInterval = healthcheckpolicy.getHealthcheckInterval();
this.responseTime = healthcheckpolicy.getResponseTime();
this.healthcheckthresshold = healthcheckpolicy.getHealthcheckThresshold();
this.unhealthcheckthresshold = healthcheckpolicy.getUnhealthThresshold();
setObjectName("healthcheckpolicy");
}
}

View 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.
package org.apache.cloudstack.api.response;
import com.cloud.network.rules.HealthCheckPolicy;
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import java.util.List;
import java.util.UUID;
@EntityReference(value=HealthCheckPolicy.class)
public class LBHealthCheckResponse extends BaseResponse {
@SerializedName("lbruleid")
@Param(description = "the LB rule ID")
private String lbRuleId;
@SerializedName("account")
@Param(description = "the account of the HealthCheck policy")
private String accountName;
@SerializedName(ApiConstants.DOMAIN_ID)
@Param(description = "the domain ID of the HealthCheck policy")
private String domainId;
@SerializedName("domain")
@Param(description = "the domain of the HealthCheck policy")
private String domainName;
@SerializedName(ApiConstants.ZONE_ID)
@Param(description = "the id of the zone the HealthCheck policy belongs to")
private String zoneId;
@SerializedName("healthcheckpolicy")
@Param(description = "the list of healthcheckpolicies", responseObject = LBHealthCheckPolicyResponse.class)
private List<LBHealthCheckPolicyResponse> healthCheckPolicies;
public void setlbRuleId(String lbRuleId) {
this.lbRuleId = lbRuleId;
}
public void setRules(List<LBHealthCheckPolicyResponse> policies) {
this.healthCheckPolicies = policies;
}
public List<LBHealthCheckPolicyResponse> getHealthCheckPolicies() {
return healthCheckPolicies;
}
public void setHealthCheckPolicies(List<LBHealthCheckPolicyResponse> healthCheckPolicies) {
this.healthCheckPolicies = healthCheckPolicies;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public void setDomainId(String domainId) {
this.domainId = domainId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getDomainName() {
return domainName;
}
public void setDomainName(String domainName) {
this.domainName = domainName;
}
public LBHealthCheckResponse() {
}
public LBHealthCheckResponse(HealthCheckPolicy healthcheckpolicy) {
setObjectName("healthcheckpolicy");
}
}

View File

@ -0,0 +1,62 @@
/*
* 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.api.response;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
public class StorageProviderResponse extends BaseResponse {
@SerializedName("name") @Param(description="the name of the storage provider")
private String name;
@SerializedName("type") @Param(description="the type of the storage provider: primary or image provider")
private String type;
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}

View File

@ -48,6 +48,8 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
@SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
private String projectName;
@SerializedName(ApiConstants.STATE) @Param(description="the state of the Vpn User")
private String state;
public void setId(String id) {
this.id = id;
@ -80,4 +82,12 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
this.projectName = projectName;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}

View File

@ -133,7 +133,7 @@ public class BackupSnapshotCommandTest {
}
@Override
public Long getStorageProviderId() {
public String getStorageProviderName() {
// TODO Auto-generated method stub
return null;
}

View File

@ -115,7 +115,7 @@ public class SnapshotCommandTest {
}
@Override
public Long getStorageProviderId() {
public String getStorageProviderName() {
// TODO Auto-generated method stub
return null;
}

View File

@ -134,7 +134,7 @@ public class ResizeVolumeCommandTest {
}
@Override
public Long getStorageProviderId() {
public String getStorageProviderName() {
// TODO Auto-generated method stub
return null;
}

View File

@ -20,7 +20,7 @@
# Cloud.com Bridge setup script.
#
settingsFile="/usr/share/cloud/bridge/conf/ec2-service.properties"
settingsFile="/etc/cloudstack/management/ec2-service.properties"
function readCurrentSettings () {
readVar managementServer

View File

@ -36,7 +36,7 @@ import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
public class EncryptionSecretKeyCheckerUtil {
private static final Logger s_logger = Logger.getLogger(EncryptionSecretKeyCheckerUtil.class);
private static final String s_keyFile = "/etc/cloud/management/key";
private static final String s_keyFile = "/etc/cloudstack/management/key";
private static final String s_envKey = "CLOUD_SECRET_KEY";
private static StandardPBEStringEncryptor s_encryptor = new StandardPBEStringEncryptor();
private static boolean s_useEncryption = false;

View File

@ -17,6 +17,7 @@
#new labels (begin) **********************************************************************************************
message.redirecting.region=Redirecting to region...
label.use.vm.ip=Use VM IP:
label.menu.regions=Regions
label.region=Region

View File

@ -65,6 +65,11 @@
<artifactId>cloud-plugin-network-nvp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-snmp-alerts</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-ovs</artifactId>
@ -214,6 +219,16 @@
<artifactId>cloud-engine-storage-volume</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-simulator</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-volume-default</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
@ -238,7 +253,6 @@
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<jvmArgs>-XX:MaxPermSize=512m -Xmx2g</jvmArgs>
<webXml>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</webXml>
<webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
<webAppConfig>
@ -476,21 +490,6 @@
</pluginManagement>
</build>
<profiles>
<profile>
<id>simulator</id>
<activation>
<property>
<name>simulator</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-simulator</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>netapp</id>
<activation>

View File

@ -152,6 +152,9 @@ createLBStickinessPolicy=15
deleteLBStickinessPolicy=15
listLoadBalancerRules=15
listLBStickinessPolicies=15
listLBHealthCheckPolicies=15
createLBHealthCheckPolicy=15
deleteLBHealthCheckPolicy=15
listLoadBalancerRuleInstances=15
updateLoadBalancerRule=15
@ -276,6 +279,7 @@ listAsyncJobs=15
#### storage pools commands
listStoragePools=3
listStorageProviders=3
createStoragePool=1
updateStoragePool=1
deleteStoragePool=1

View File

@ -36,9 +36,25 @@
-->
<bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
<bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
<bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" />
<bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
<bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" >
<property name="UserAuthenticators">
<list>
<ref bean="MD5UserAuthenticator"/>
<ref bean="LDAPUserAuthenticator"/>
</list>
</property>
</bean>
<bean id ="AccountManagerImpl" class="com.cloud.user.AccountManagerImpl">
<property name="UserAuthenticators">
<list>
<ref bean="MD5UserAuthenticator"/>
<ref bean="LDAPUserAuthenticator"/>
</list>
</property>
</bean>
<bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
<bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
@ -191,6 +207,12 @@
<property name="name" value="XCP Agent"/>
</bean>
<!--
<bean id="SimulatorSecondaryStorageDiscoverer" class="com.cloud.resource.SimulatorSecondaryDiscoverer">
<property name="name" value="SecondaryStorage"/>
</bean>
-->
<bean id="SecondaryStorageDiscoverer" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer">
<property name="name" value="SecondaryStorage"/>
</bean>
@ -199,11 +221,9 @@
<property name="name" value="KVM Agent"/>
</bean>
<!--
<bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
<property name="name" value="KVM Agent"/>
<property name="name" value="Simulator Agent"/>
</bean>
-->
<bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
@ -302,14 +322,15 @@
<property name="name" value="OvmGuru"/>
</bean>
<!--
<bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
<property name="name" value="SimulatorGuru"/>
</bean>
-->
<bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
<property name="name" value="BaremetalGuru"/>
</bean>
<bean id="ClassicalPrimaryDataStoreProvider" class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl">
</bean>
</beans>

View File

@ -74,6 +74,20 @@ under the License.
<param name="ConversionPattern" value="%-5p [%c{3}] (%t:%x) %m%n"/>
</layout>
</appender>
<!-- ============================== -->
<!-- send alert warnings+ as the SNMP trap if it is configured! -->
<!-- ============================== -->
<appender name="SNMP" class="org.apache.cloudstack.alert.snmp.SnmpTrapAppender">
<param name="Threshold" value="WARN"/>
<param name="SnmpManagerIpAddresses" value=""/>
<param name="SnmpManagerPorts" value=""/>
<param name="SnmpManagerCommunities" value=""/>
<layout class="org.apache.cloudstack.alert.snmp.SnmpEnhancedPatternLayout">
<param name="PairDelimiter" value="//"/>
<param name="KeyValueDelimiter" value="::"/>
</layout>
</appender>
<!-- ============================== -->
<!-- Append messages to the console -->
@ -142,6 +156,17 @@ under the License.
<appender-ref ref="AWSAPI"/>
</logger>
<!-- ============================== -->
<!-- Add or remove these logger for SNMP, this logger is for SNMP alerts plugin -->
<!-- ============================== -->
<logger name="org.apache.cloudstack.alerts" additivity="false">
<level value="WARN"/>
<appender-ref ref="SYSLOG"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="SNMP"/>
</logger>
<!-- ======================= -->
<!-- Setup the Root category -->

View File

@ -37,8 +37,24 @@
-->
<bean id="premiumDatabaseUpgradeChecker" class="com.cloud.upgrade.PremiumDatabaseUpgradeChecker"/>
<bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" />
<bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
<bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" >
<property name="UserAuthenticators">
<list>
<ref bean="MD5UserAuthenticator"/>
<ref bean="LDAPUserAuthenticator"/>
</list>
</property>
</bean>
<bean id ="AccountManagerImpl" class="com.cloud.user.AccountManagerImpl">
<property name="UserAuthenticators">
<list>
<ref bean="MD5UserAuthenticator"/>
<ref bean="LDAPUserAuthenticator"/>
</list>
</property>
</bean>
<bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
<bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
@ -310,6 +326,9 @@
<property name="name" value="HypervisorPlannerSelector"/>
</bean>
<bean id="ClassicalPrimaryDataStoreProvider" class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl">
</bean>
<!--
DAO with customized configuration
-->

View File

@ -27,26 +27,27 @@ public interface AlertManager extends Manager {
public static final short ALERT_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = CapacityVO.CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP;
public static final short ALERT_TYPE_PRIVATE_IP = CapacityVO.CAPACITY_TYPE_PRIVATE_IP;
public static final short ALERT_TYPE_SECONDARY_STORAGE = CapacityVO.CAPACITY_TYPE_SECONDARY_STORAGE;
public static final short ALERT_TYPE_HOST = 6;
public static final short ALERT_TYPE_USERVM = 7;
public static final short ALERT_TYPE_DOMAIN_ROUTER = 8;
public static final short ALERT_TYPE_CONSOLE_PROXY = 9;
public static final short ALERT_TYPE_ROUTING = 10; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_STORAGE_MISC = 11; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_USAGE_SERVER = 12; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_MANAGMENT_NODE = 13; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = 14;
public static final short ALERT_TYPE_CONSOLE_PROXY_MIGRATE = 15;
public static final short ALERT_TYPE_USERVM_MIGRATE = 16;
public static final short ALERT_TYPE_VLAN = 17;
public static final short ALERT_TYPE_SSVM = 18;
public static final short ALERT_TYPE_USAGE_SERVER_RESULT = 19; // Usage job result
public static final short ALERT_TYPE_STORAGE_DELETE = 20;
public static final short ALERT_TYPE_UPDATE_RESOURCE_COUNT = 21; // Generated when we fail to update the resource count
public static final short ALERT_TYPE_USAGE_SANITY_RESULT = 22;
public static final short ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 23;
public static final short ALERT_TYPE_LOCAL_STORAGE = 24;
public static final short ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = 25; // Generated when the resource limit exceeds the limit. Currently used for recurring snapshots only
public static final short ALERT_TYPE_HOST = 7;
public static final short ALERT_TYPE_USERVM = 8;
public static final short ALERT_TYPE_DOMAIN_ROUTER = 9;
public static final short ALERT_TYPE_CONSOLE_PROXY = 10;
public static final short ALERT_TYPE_ROUTING = 11; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_STORAGE_MISC = 12; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_USAGE_SERVER = 13; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_MANAGMENT_NODE = 14; // lost connection to default route (to the gateway)
public static final short ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = 15;
public static final short ALERT_TYPE_CONSOLE_PROXY_MIGRATE = 16;
public static final short ALERT_TYPE_USERVM_MIGRATE = 17;
public static final short ALERT_TYPE_VLAN = 18;
public static final short ALERT_TYPE_SSVM = 19;
public static final short ALERT_TYPE_USAGE_SERVER_RESULT = 20; // Usage job result
public static final short ALERT_TYPE_STORAGE_DELETE = 21;
public static final short ALERT_TYPE_UPDATE_RESOURCE_COUNT = 22; // Generated when we fail to update the resource
// count
public static final short ALERT_TYPE_USAGE_SANITY_RESULT = 23;
public static final short ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 24;
public static final short ALERT_TYPE_LOCAL_STORAGE = 25;
public static final short ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = 26; // Generated when the resource limit exceeds the limit. Currently used for recurring snapshots only
void clearAlert(short alertType, long dataCenterId, long podId);

View File

@ -19,8 +19,8 @@
/etc/cloudstack/agent/environment.properties
/etc/cloudstack/agent/log4j-cloud.xml
/etc/init.d/cloudstack-agent
/usr/bin/cloud-setup-agent
/usr/bin/cloudstack-setup-agent
/usr/bin/cloud-ssh
/var/log/cloudstack/agent
/usr/share/cloudstack-agent/lib/*
/usr/share/cloudstack-agent/plugins
/usr/share/cloudstack-agent/plugins

View File

@ -31,3 +31,5 @@
/usr/bin/cloud-setup-databases
/usr/bin/cloud-migrate-databases
/usr/share/cloudstack-management/*
/usr/share/java/*
/usr/share/tomcat6/lib/*

View File

@ -22,5 +22,20 @@ if [ "$1" = configure ]; then
else
usermod -m -d /var/lib/cloudstack/management cloud
fi
chown cloud /var/log/cloudstack/management
fi
for i in /var/cache/cloudstack/management \
/var/cache/cloudstack/management/work \
/var/cache/cloudstack/management/temp \
/var/log/cloudstack/management \
/etc/cloudstack/management/Catalina \
/etc/cloudstack/management/Catalina/localhost \
/var/lib/cloudstack/management \
/etc/cloudstack/management/Catalina/localhost/client
do
chmod 0770 $i
chgrp cloud $i
done
chmod 0640 /etc/cloudstack/management/db.properties
chgrp cloud /etc/cloudstack/management/db.properties
fi

9
debian/rules vendored
View File

@ -68,7 +68,7 @@ install:
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-$(VERSION)-SNAPSHOT.jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
install -D plugins/hypervisors/kvm/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
install -D packaging/debian/init/cloud-agent $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-agent
install -D agent/bindir/cloud-setup-agent.in $(DESTDIR)/usr/bin/cloud-setup-agent
install -D agent/bindir/cloud-setup-agent.in $(DESTDIR)/usr/bin/cloudstack-setup-agent
install -D agent/bindir/cloud-ssh.in $(DESTDIR)/usr/bin/cloud-ssh
install -D agent/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/agent
@ -99,12 +99,15 @@ install:
ln -s tomcat6-nonssl.conf $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/Catalina/localhost/client
mkdir -p ${DESTDIR}/usr/share/tomcat6/lib
mkdir -p ${DESTDIR}/usr/share/java
install -D packaging/debian/init/cloud-management $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-management
install -D client/bindir/cloud-update-xenserver-licenses.in $(DESTDIR)/usr/bin/cloud-update-xenserver-licenses
install -D server/target/cloud-server-$(VERSION)-SNAPSHOT.jar $(DESTDIR)/usr/share/$(PACKAGE)-management/lib/$(PACKAGE)-server.jar
install -D server/target/cloud-server-$(VERSION)-SNAPSHOT.jar $(DESTDIR)/usr/share/java/$(PACKAGE)-server.jar
ln -s /usr/share/tomcat6/bin $(DESTDIR)/usr/share/$(PACKAGE)-management/bin
ln -s ../../..$(SYSCONFDIR)/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/conf
ln -s /usr/share/tomcat6/lib $(DESTDIR)/usr/share/$(PACKAGE)-management/lib
ln -s ../../../usr/share/tomcat6/lib $(DESTDIR)/usr/share/$(PACKAGE)-management/lib
ln -s ../../java/$(PACKAGE)-server.jar $(DESTDIR)/usr/share/tomcat6/lib/$(PACKAGE)-server.jar
ln -s ../../../var/log/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/logs
ln -s ../../../var/cache/$(PACKAGE)/management/temp $(DESTDIR)/usr/share/$(PACKAGE)-management/temp
ln -s ../../../var/cache/$(PACKAGE)/management/work $(DESTDIR)/usr/share/$(PACKAGE)-management/work

View File

@ -10,7 +10,7 @@
language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-developer</artifactId>
<name>Apache CloudStack Developer Tools</name>
@ -21,25 +21,98 @@
<version>4.2.0-SNAPSHOT</version>
</parent>
<dependencies>
<!-- specify the dependent jdbc driver here -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
<scope>runtime</scope>
<version>${cs.mysql.version}</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>${cs.dbcp.version}</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>${cs.pool.version}</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>${cs.jasypt.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-simulator</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-simulator</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/../utils/conf/db.properties</file>
<file>${basedir}/../utils/conf/db.properties.override</file>
</files>
<quiet>true</quiet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<filter token="VERSION" value="${project.version}"/>
<copy todir="${basedir}/target/db" filtering="true">
<fileset dir="${basedir}/../setup/db/"/>
</copy>
<copy todir="${basedir}/target/db" filtering="true">
<fileset
dir="${basedir}/../awsapi-setup/db/mysql/">
<include name="**/*.sql"/>
</fileset>
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- default deploydb property -->
<id>deploydb</id>
<activation>
<property>
@ -48,91 +121,10 @@
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.parent.basedir}/utils/conf/db.properties</file>
<file>${project.parent.basedir}/utils/conf/db.properties.override</file>
</files>
<quiet>true</quiet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<filter token="VERSION" value="${project.version}" />
<copy todir="${basedir}/target/db" filtering="true">
<fileset dir="${project.basedir}/../setup/db/" />
</copy>
<copy todir="${basedir}/target/db" filtering="true">
<fileset
dir="${project.basedir}/../awsapi-setup/db/mysql/">
<include name="**/*.sql" />
</fileset>
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
<!-- DatabaseCreator driver here -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<dependencies>
<!-- specify the dependent jdbc driver here -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${cs.mysql.version}</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>${cs.dbcp.version}</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>${cs.pool.version}</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>${cs.jasypt.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-server</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>process-resources</phase>
@ -143,17 +135,11 @@
</execution>
</executions>
<configuration>
<includeProjectDependencies>false</includeProjectDependencies>
<includePluginDependencies>true</includePluginDependencies>
<executableDependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-server</artifactId>
</executableDependency>
<mainClass>com.cloud.upgrade.DatabaseCreator</mainClass>
<arguments>
<!-- db properties file -->
<argument>${project.parent.basedir}/utils/conf/db.properties</argument>
<argument>${project.parent.basedir}/utils/conf/db.properties.override</argument>
<argument>${basedir}/../utils/conf/db.properties</argument>
<argument>${basedir}/../utils/conf/db.properties.override</argument>
<!-- Create default schema and db table views -->
<argument>${basedir}/target/db/create-schema.sql</argument>
<argument>${basedir}/target/db/create-schema-premium.sql</argument>
@ -181,7 +167,59 @@
<systemProperties>
<systemProperty>
<key>catalina.home</key>
<value>${project.parent.basedir}/utils</value>
<value>${basedir}/../utils</value>
</systemProperty>
<systemProperty>
<key>paths.script</key>
<value>${basedir}/target/db</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- simulator deploydb property -->
<id>deploydb-simulator</id>
<activation>
<property>
<name>deploydb-simulator</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>process-resources</phase>
<id>create-schema-simulator</id>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.cloud.upgrade.DatabaseCreator</mainClass>
<arguments>
<!-- db properties file -->
<argument>${basedir}/../utils/conf/db.properties</argument>
<argument>${basedir}/../utils/conf/db.properties.override</argument>
<!-- simulator sql files -->
<argument>${basedir}/target/db/create-schema-simulator.sql</argument>
<argument>${basedir}/target/db/templates.simulator.sql</argument>
<!-- upgrade -->
<argument>com.cloud.upgrade.DatabaseUpgradeChecker</argument>
<argument>--database=simulator</argument>
<argument>--rootpassword=${db.root.password}</argument>
</arguments>
<systemProperties>
<systemProperty>
<key>catalina.home</key>
<value>${basedir}/../utils</value>
</systemProperty>
<systemProperty>
<key>paths.script</key>
@ -194,4 +232,4 @@
</build>
</profile>
</profiles>
</project>
</project>

View File

@ -57,5 +57,6 @@
<xi:include href="aws-interface-compatibility.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="network-setup.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="networks.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="best-practices.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Revision_History_Install_Guide.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>

View File

@ -92,11 +92,11 @@
<tbody>
<row>
<entry><para>Name</para></entry>
<entry><para>systemvm-vmware-3.0.0</para></entry>
<entry><para>systemvm-vmware-4.0</para></entry>
</row>
<row>
<entry><para>Description</para></entry>
<entry><para>systemvm-vmware-3.0.0</para></entry>
<entry><para>systemvm-vmware-4.0</para></entry>
</row>
<row>
<entry><para>URL</para></entry>

View File

@ -52,7 +52,7 @@
<para>Of course, the database secret key itself can not be stored in the open it must be
encrypted. How then does &PRODUCT; read it? A second secret key must be provided from an
external source during Management Server startup. This key can be provided in one of two ways:
loaded from a file or provided by the &PRODUCT; administrator. The &PRODUCT; database has a new
loaded from a file or provided by the &PRODUCT; administrator. The &PRODUCT; database has a
configuration setting that lets it know which of these methods will be used. If the encryption
type is set to "file," the key must be in a file in a known location. If the encryption type is
set to "web," the administrator runs the utility

View File

@ -0,0 +1,49 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<!-- 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.
-->
<section id="about-regions">
<title>About Regions</title>
<para>To increase reliability of the cloud, you can optionally group resources into multiple geographic regions.
A region is the largest available organizational unit within a &PRODUCT; deployment.
A region is made up of several availability zones, where each zone is roughly equivalent to a datacenter.
Each region is controlled by its own cluster of Management Servers, running in one of the zones.
The zones in a region are typically located in close geographical proximity.
Regions are a useful technique for providing fault tolerance and disaster recovery.</para>
<para>By grouping zones into regions, the cloud can achieve higher availability and scalability.
User accounts can span regions, so that users can deploy VMs in multiple, widely-dispersed regions.
Even if one of the regions becomes unavailable, the services are still available to the end-user through VMs deployed in another region.
And by grouping communities of zones under their own nearby Management Servers, the latency of communications within the cloud is reduced
compared to managing widely-dispersed zones from a single central Management Server.
</para>
<para>
Usage records can also be consolidated and tracked at the region level, creating reports or invoices for each geographic region.
</para>
<mediaobject>
<imageobject>
<imagedata fileref="./images/region-overview.png" />
</imageobject>
<textobject><phrase>region-overview.png: Nested structure of a region.</phrase></textobject>
</mediaobject>
<para>Regions are visible to the end user. When a user starts a guest VM, the user must select a region for their guest.
Users might also be required to copy their private templates to additional regions to enable creation of guest VMs using their templates in those regions.</para>
</section>

View File

@ -23,7 +23,12 @@
-->
<section id="about-zones">
<title>About Zones</title>
<para>A zone is the largest organizational unit within a &PRODUCT; deployment. A zone typically corresponds to a single datacenter, although it is permissible to have multiple zones in a datacenter. The benefit of organizing infrastructure into zones is to provide physical isolation and redundancy. For example, each zone can have its own power supply and network uplink, and the zones can be widely separated geographically (though this is not required).</para>
<para>A zone is the second largest organizational unit within a &PRODUCT; deployment. A zone
typically corresponds to a single datacenter, although it is permissible to have multiple
zones in a datacenter. The benefit of organizing infrastructure into zones is to provide
physical isolation and redundancy. For example, each zone can have its own power supply and
network uplink, and the zones can be widely separated geographically (though this is not
required).</para>
<para>A zone consists of:</para>
<itemizedlist>
<listitem><para>One or more pods. Each pod contains one or more clusters of hosts and one or more primary storage servers.</para></listitem>
@ -46,5 +51,6 @@
<listitem><para>How many primary storage servers to place in each cluster and total capacity for the storage servers.</para></listitem>
<listitem><para>How much secondary storage to deploy in a zone.</para></listitem>
</itemizedlist>
<para>When you add a new zone, you will be prompted to configure the zones physical network and add the first pod, cluster, host, primary storage, and secondary storage.</para>
<para>When you add a new zone using the &PRODUCT; UI, you will be prompted to configure the zones physical network
and add the first pod, cluster, host, primary storage, and secondary storage.</para>
</section>

View File

@ -19,7 +19,7 @@
under the License.
-->
<section id="added-API-commands-4.1">
<title>Added API Commands in 4.1-incubating</title>
<title>Added API Commands in 4.1</title>
<itemizedlist>
<listitem>
<para>createEgressFirewallRules (creates an egress firewall rule on the guest network.)</para>
@ -65,5 +65,10 @@
<para>getUser (This API can only be used by the Admin. Get user details by using the API Key.)
</para>
</listitem>
<listitem><para>addRegion (Add a region)</para></listitem>
<listitem><para>removeRegion (Delete a region)</para></listitem>
<listitem><para>updateRegion (Modify attributes of a region)</para></listitem>
<listitem><para>listRegions (List regions)</para></listitem>
<listitem><para></para></listitem>
</itemizedlist>
</section>

View File

@ -25,8 +25,9 @@
<chapter id="api-calls">
<title>Calling the &PRODUCT; API</title>
<xi:include href="making-api-request.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="enabling-api-call-expiration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="signing-api-requests.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="enabling-api-call-expiration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="api-throttling.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="responses.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="asynchronous-commands.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>

View File

@ -19,6 +19,6 @@
<section id="api-reference">
<title>API Reference Documentation</title>
<para>You can find all the API reference documentation at the below site:</para>
<para><ulink url="http://incubator.apache.org/cloudstack/docs/api/">http://incubator.apache.org/cloudstack/docs/api/</ulink></para>
<para><ulink url="http://cloudstack.apache.org/docs/api/">http://cloudstack.apache.org/docs/api/</ulink></para>
</section>

View File

@ -0,0 +1,67 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<!-- 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.
-->
<section id="api-throttling">
<title>Limiting the Rate of API Requests</title>
<para>You can limit the rate at which API requests can be placed for each
account. This is useful to avoid malicious attacks on the Management Server, prevent
performance degradation, and provide fairness to all accounts.</para>
<para>If the number of API calls exceeds the threshold, an error message is returned for any additional API calls.
The caller will have to retry these API calls at another time.</para>
<section id="api-throttling-configure">
<title>Configuring the API Request Rate</title>
<para>To control the API request rate, use the following global configuration
settings:</para>
<itemizedlist>
<listitem><para>api.throttling.enabled - Enable/Disable API throttling. By default, this setting is false, so
API throttling is not enabled.</para></listitem>
<listitem><para>api.throttling.interval (in seconds) - Time interval during which the number of API requests is to be counted.
When the interval has passed, the API count is reset to 0.</para></listitem>
<listitem><para>api.throttling.max - Maximum number of APIs that can be placed within the api.throttling.interval period.</para></listitem>
<listitem><para>api.throttling.cachesize - Cache size for storing API counters.
Use a value higher than the total number of accounts managed by the cloud.
One cache entry is needed for each account, to store the running API total for that account.
</para></listitem>
</itemizedlist>
</section>
<section id="api-throttling-limitations">
<title>Limitations on API Throttling</title>
<para>The following limitations exist in the current implementation of this feature.</para>
<note><para>Even with these limitations, &PRODUCT; is still able to effectively use API throttling to
avoid malicious attacks causing denial of service.</para></note>
<para/>
<itemizedlist>
<listitem><para>In a deployment with multiple Management Servers,
the cache is not synchronized across them.
In this case, &PRODUCT; might not be able to
ensure that only the exact desired number of API requests are allowed.
In the worst case, the number of API calls that might be allowed is
(number of Management Servers) * (api.throttling.max).
</para></listitem>
<listitem><para>The API commands resetApiLimit and getApiLimit are limited to the
Management Server where the API is invoked.
</para></listitem>
</itemizedlist>
</section>
</section>

View File

@ -66,7 +66,7 @@
cloudstack-aws-api-register. If you do not have the source then download the script using the following command.
</para>
<para>
<programlisting>wget -O cloudstack-aws-api-register <ulink url="https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=awsapi-setup/setup/cloudstack-aws-api-register;hb=HEAD">"https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=awsapi-setup/setup/cloudstack-aws-api-register;hb=HEAD"</ulink>
<programlisting>wget -O cloudstack-aws-api-register <ulink url="https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;a=blob_plain;f=awsapi-setup/setup/cloudstack-aws-api-register;hb=4.1">"https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;a=blob_plain;f=awsapi-setup/setup/cloudstack-aws-api-register;hb=4.1"</ulink>
</programlisting>
</para>
<para> Then execute it, using the access and secret keys that were obtained in step <xref linkend="obtain-access-secret-keys"/>. An example is shown below.</para>

View File

@ -0,0 +1,82 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<!-- 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.
-->
<chapter id="best-practices">
<title>Best Practices</title>
<para>Deploying a cloud is challenging. There are many different technology choices to make, and &PRODUCT; is flexible enough in its configuration that there are many possible ways to combine and configure the chosen technology. This section contains suggestions and requirements about cloud deployments.</para>
<para>These should be treated as suggestions and not absolutes. However, we do encourage anyone planning to build a cloud outside of these guidelines to seek guidance and advice on the project mailing lists.</para>
<section id="process-best-practices">
<title>Process Best Practices</title>
<itemizedlist>
<listitem>
<para>A staging system that models the production environment is strongly advised. It is critical if customizations have been applied to &PRODUCT;.</para>
</listitem>
<listitem>
<para>Allow adequate time for installation, a beta, and learning the system. Installs with basic networking can be done in hours. Installs with advanced networking usually take several days for the first attempt, with complicated installations taking longer. For a full production system, allow at least 4-8 weeks for a beta to work through all of the integration issues. You can get help from fellow users on the cloudstack-users mailing list.</para>
</listitem>
</itemizedlist>
</section>
<section id="setup-best-practices">
<title>Setup Best Practices</title>
<itemizedlist>
<listitem>
<para>Each host should be configured to accept connections only from well-known entities such as the &PRODUCT; Management Server or your network monitoring software.</para>
</listitem>
<listitem>
<para>Use multiple clusters per pod if you need to achieve a certain switch density.</para>
</listitem>
<listitem>
<para>Primary storage mountpoints or LUNs should not exceed 6 TB in size. It is better to have multiple smaller primary storage elements per cluster than one large one.</para>
</listitem>
<listitem>
<para>When exporting shares on primary storage, avoid data loss by restricting the range of IP addresses that can access the storage. See "Linux NFS on Local Disks and DAS" or "Linux NFS on iSCSI".</para>
</listitem>
<listitem>
<para>NIC bonding is straightforward to implement and provides increased reliability.</para>
</listitem>
<listitem>
<para>10G networks are generally recommended for storage access when larger servers that can support relatively more VMs are used.</para>
</listitem>
<listitem>
<para>Host capacity should generally be modeled in terms of RAM for the guests. Storage and CPU may be overprovisioned. RAM may not. RAM is usually the limiting factor in capacity designs.</para>
</listitem>
<listitem>
<para>(XenServer) Configure the XenServer dom0 settings to allocate more memory to dom0. This can enable XenServer to handle larger numbers of virtual machines. We recommend 2940 MB of RAM for XenServer dom0. For instructions on how to do this, see <ulink url="http://support.citrix.com/article/CTX126531">http://support.citrix.com/article/CTX126531</ulink>. The article refers to XenServer 5.6, but the same information applies to XenServer 6.0.</para>
</listitem>
</itemizedlist>
</section>
<section id="maintenance-best-practices">
<title>Maintenance Best Practices</title>
<itemizedlist>
<listitem>
<para>Monitor host disk space. Many host failures occur because the host's root disk fills up from logs that were not rotated adequately.</para>
</listitem>
<listitem>
<para>Monitor the total number of VM instances in each cluster, and disable allocation to the cluster if the total is approaching the maximum that the hypervisor can handle. Be sure to leave a safety margin to allow for the possibility of one or more hosts failing, which would increase the VM load on the other hosts as the VMs are redeployed. Consult the documentation for your chosen hypervisor to find the maximum permitted number of VMs per host, then use &PRODUCT; global configuration settings to set this as the default limit. Monitor the VM activity in each cluster and keep the total number of VMs below a safe level that allows for the occasional host failure. For example, if there are N hosts in the cluster, and you want to allow for one host in the cluster to be down at any given time, the total number of VM instances you can permit in the cluster is at most (N-1) * (per-host-limit). Once a cluster reaches this number of VMs, use the &PRODUCT; UI to disable allocation to the cluster.</para>
</listitem>
</itemizedlist>
<warning><para>The lack of up-do-date hotfixes can lead to data corruption and lost VMs.</para></warning>
<para>Be sure all the hotfixes provided by the hypervisor vendor are applied. Track the release of hypervisor patches through your hypervisor vendors support channel, and apply patches as soon as possible after they are released. &PRODUCT; will not track or notify you of required hypervisor patches. It is essential that your hosts are completely up to date with the provided hypervisor patches. The hypervisor vendor is likely to refuse to support any system that is not up to date with patches.</para>
</section>
</chapter>

View File

@ -25,7 +25,7 @@
<section id="building-with-maven-steps">
<title>Building Steps</title>
<para>&PRODUCT; uses git for source version control, first make sure you have the source code by pulling it:</para>
<programlisting>git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git</programlisting>
<programlisting>git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git</programlisting>
<para>Several Project Object Models (POM) are defined to deal with the various build targets of &PRODUCT;. Certain features require some packages that are not compatible with the Apache license and therefore need to be downloaded on your own. Check the wiki for additional information <ulink url="https://cwiki.apache.org/CLOUDSTACK/building-with-maven.html">https://cwiki.apache.org/CLOUDSTACK/building-with-maven.html</ulink>. In order to build all the open source targets of &PRODUCT; do:</para>
<para><programlisting>mvn clean install</programlisting></para>
<para>The resulting jar files will be in the target directory of the subdirectory of the compiled module.</para>

View File

@ -34,8 +34,7 @@
<para>To configure CAStor:</para>
<orderedlist>
<listitem>
<para>Install &PRODUCT; 4.0.0-incubating by following the instructions given in the INSTALL.txt
file.</para>
<para>Install &PRODUCT; by following the instructions given in the INSTALL.txt file.</para>
<note>
<para>You can use the S3 storage system in &PRODUCT; without setting up and installing the
compute components.</para>

View File

@ -19,7 +19,7 @@
under the License.
-->
<section id="changed-apicommands-4.1">
<title>Changed API Commands in 4.1-incubating</title>
<title>Changed API Commands in 4.1</title>
<informaltable>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<colspec colwidth="1.0*" colname="1" colnum="1"/>
@ -34,13 +34,148 @@
<row>
<entry>
<para>createNetworkOffering</para>
</entry>
<entry>
<para>The following request parameters have been added:</para>
<itemizedlist>
<listitem>
<para>isPersistent</para>
</listitem>
<listitem>
<para>startipv6</para>
</listitem>
<listitem>
<para>endipv6</para>
</listitem>
<listitem>
<para>ip6gateway</para>
</listitem>
<listitem>
<para>ip6cidr</para>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<para>listNetworkOfferings</para>
<para>listNetworks</para>
</entry>
<entry>
<para>The following request parameters is added: isPersistent.</para>
<para>This parameter determines if the network or network offering created or listed by
using this offering are persistent or not.</para>
<para>The following request parameters have been added:</para>
<itemizedlist>
<listitem>
<para>isPersistent</para>
<para>This parameter determines if the network or network offering listed are
persistent or not.</para>
</listitem>
<listitem>
<para>ip6gateway</para>
</listitem>
<listitem>
<para>ip6cidr</para>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<para>createVlanIpRange</para>
</entry>
<entry>
<para>The following request parameters have been added:</para>
<itemizedlist>
<listitem>
<para>startipv6</para>
</listitem>
<listitem>
<para>endipv6</para>
</listitem>
<listitem>
<para>ip6gateway</para>
</listitem>
<listitem>
<para>ip6cidr</para>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<para>deployVirtualMachine</para>
</entry>
<entry>
<para>The following parameter has been added: ip6Address.</para>
<para>The following parameter is updated to accept the IPv6 address:
iptonetworklist.</para>
</entry>
</row>
<row>
<entry>
<para>CreateZoneCmd</para>
</entry>
<entry>
<para>The following parameter have been added: ip6dns1, ip6dns2.</para>
</entry>
</row>
<row>
<entry>
<para>listRouters</para>
<para>listVirtualMachines</para>
</entry>
<entry>
<para>For nic responses, the following fields have been added.</para>
<itemizedlist>
<listitem>
<para>ip6address</para>
</listitem>
<listitem>
<para>ip6gateway</para>
</listitem>
<listitem>
<para>ip6cidr</para>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<para>listVlanIpRanges</para>
</entry>
<entry>
<para>For nic responses, the following fields have been added.</para>
<itemizedlist>
<listitem>
<para>startipv6</para>
</listitem>
<listitem>
<para>endipv6</para>
</listitem>
<listitem>
<para>ip6gateway</para>
</listitem>
<listitem>
<para>ip6cidr</para>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<para>listRouters</para>
<para>listZones</para>
</entry>
<entry>
<para>For DomainRouter and DataCenter response, the following fields have been
added.</para>
<itemizedlist>
<listitem>
<para>ip6dns1</para>
</listitem>
<listitem>
<para>ip6dns2</para>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
@ -97,9 +232,21 @@
<para>listZones</para>
</entry>
<entry>
<para>The following request parameters is added: securitygroupenabled</para>
<para>The following request parameter is added: securitygroupenabled</para>
</entry>
</row>
<row>
<entry><para>createAccount</para></entry>
<entry><para>The following new request parameters are added: accountid, userid</para></entry>
</row>
<row>
<entry><para>createUser</para></entry>
<entry><para>The following new request parameter is added: userid</para></entry>
</row>
<row>
<entry><para>createDomain</para></entry>
<entry><para>The following new request parameter is added: domainid</para></entry>
</row>
</tbody>
</tgroup>
</informaltable>

View File

@ -23,7 +23,8 @@
-->
<chapter id="cloud-infrastructure-concepts">
<title>Cloud Infrastructure Concepts</title>
<title>Cloud Infrastructure Concepts</title>
<xi:include href="about-regions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="about-zones.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="about-pods.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="about-clusters.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />

View File

@ -24,7 +24,7 @@
<section id="cloudmonkey">
<title>CloudMonkey</title>
<para>CloudMonkey is the &PRODUCT; Command Line Interface (CLI). It is written in Python and leverages Marvin. CloudMonkey can be used both as an interactive shell and as a command line tool which simplifies &PRODUCT; configuration and management.</para>
<para>CloudMonkey is the &PRODUCT; Command Line Interface (CLI). It is written in Python. CloudMonkey can be used both as an interactive shell and as a command line tool which simplifies &PRODUCT; configuration and management. It can be used with &PRODUCT; releases since the 4.0.x branch.</para>
<warning>
<para>CloudMonkey is still under development and should be considered a Work In Progress (WIP), the wiki is the most up to date documentation:</para>
<para><ulink url="https://cwiki.apache.org/CLOUDSTACK/cloudstack-cloudmonkey-cli.html">https://cwiki.apache.org/CLOUDSTACK/cloudstack-cloudmonkey-cli.html</ulink></para>
@ -32,13 +32,15 @@
<section id="gettingcloudmonkey">
<title>Installing CloudMonkey</title>
<para>There are two ways to get CloudMonkey:</para>
<para><itemizedlist>
<para>CloudMonkey is dependent on <emphasis>readline, pygments, prettytable</emphasis>, when installing from source you will need to resolve those dependencies. Using the cheese shop, the dependencies will be automatically installed.</para>
<para>There are three ways to get CloudMonkey. Via the official &PRODUCT; source releases or via a community maintained distribution at <ulink url="http://pypi.python.org/pypi/cloudmonkey/">the cheese shop</ulink>. Developers can also get it directly from the git repository in <emphasis>tools/cli/</emphasis>.</para>
<para>
<itemizedlist>
<listitem>
<para>Via the official Apache &PRODUCT; releases (starting with 4.1).</para>
<para>Via the official Apache &PRODUCT; releases as well as the git repository.</para>
<programlisting>
<![CDATA[
$ git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git
$ git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git # (optional if using a release download)
$ mvn clean install -P developer
$ cd tools/cli # cloudmonkey-x.x.x.tar.gz will be built in dist
$ python setup.py build
@ -56,42 +58,80 @@ $ python setup.py install
<section id="configuringcloudmonkey">
<title>Configuration</title>
<para>To configure CloudMonkey you can edit the .cloudmonkey_config file in the user's home directory as shown below. The values can also be set interactively at the cloudmonkey prompt</para>
<para>To configure CloudMonkey you can edit the ~/.cloudmonkey/config file in the user's home directory as shown below. The values can also be set interactively at the cloudmonkey prompt. Logs are kept in ~/.cloudmonkey/log, and history is stored in ~/.cloudmonkey/history. Discovered apis are listed in ~/.cloudmonkey/cache. Only the log and history files can be custom paths and can be configured by setting appropriate file paths in ~/.cloudmonkey/config</para>
<programlisting>
$ cat .cloudmonkey_config
[CLI]
protocol = http
$ cat ~/.cloudmonkey/config
[core]
log_file = /Users/sebastiengoasguen/.cloudmonkey/log
asyncblock = true
paramcompletion = false
history_file = /Users/sebastiengoasguen/.cloudmonkey/history
[ui]
color = true
prompt = cloudmonkey>
history_file = /Users/sebastiengoasguen/.cloudmonkey_history
host = localhost
prompt = >
tabularize = false
[user]
secretkey =VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ
apikey = plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdMkAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg
[server]
path = /client/api
host = localhost
protocol = http
port = 8080
apikey = plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg
secretkey = VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ
timeout = 600
log_file = /Users/sebastiengoasguen/.cloudmonkey_log
timeout = 3600
</programlisting>
<para>The values can also be set at the cloudmonkey prompt. The API and secret keys are obtained via the &PRODUCT; UI or via a raw api call.</para>
<para>The values can also be set at the CloudMonkey prompt. The API and secret keys are obtained via the &PRODUCT; UI or via a raw api call.</para>
<programlisting>
<![CDATA[
$ cloudmonkey
☁ Apache CloudStack cloudmonkey 4.0.0. Type help or ? to list commands.
cloudmonkey> set prompt myprompt>
☁ Apache CloudStack cloudmonkey 4.1.0-snapshot. Type help or ? to list commands.
> set prompt myprompt>
myprompt> set host localhost
myprompt> set port 8080
myprompt> set apikey <your api key>
myprompt> set secretkey <your secret key>
]]>
</programlisting>
<para>You can use cloudmonkey to interact with a local cloud, and even with a remote public cloud. You just need to set the host value properly and obtain the keys from the cloud administrator.</para>
<para>You can use CloudMonkey to interact with a local cloud, and even with a remote public cloud. You just need to set the host value properly and obtain the keys from the cloud administrator.</para>
</section>
<section id="cliapidiscovery">
<title>API Discovery</title>
<note>
<para>In &PRODUCT; 4.0.* releases, the list of api calls available will be pre-cached, while starting with &PRODUCT; 4.1 releases and above an API discovery service is enabled. CloudMonkey will discover automatically the api calls available on the management server. The sync command in CloudMonkey pulls a list of apis which are accessible to your user role, along with help docs etc. and stores them in ~/.cloudmonkey/cache. This allows cloudmonkey to be adaptable to changes in mgmt server, so in case the sysadmin enables a plugin such as Nicira NVP for that user role, the users can get those changes. New verbs and grammar (DSL) rules are created on the fly.</para>
</note>
<para>To discover the APIs available do:</para>
<programlisting>
> sync
324 APIs discovered and cached
</programlisting>
</section>
<section id="clitabularoutput">
<title>Tabular Output</title>
<para>The number of key/value pairs returned by the api calls can be large resulting in a very long output. To enable easier viewing of the output, a tabular formatting can be setup. You may enable tabular listing and even choose set of column fields, this allows you to create your own field using the filter param which takes in comma separated argument. If argument has a space, put them under double quotes. The create table will have the same sequence of field filters provided</para>
<para>To enable it, use the <emphasis>set</emphasis> function and create filters like so:</para>
<programlisting>
> set tabularize true
> list users filter=id,domain,account
count = 1
user:
+--------------------------------------+--------+---------+
| id | domain | account |
+--------------------------------------+--------+---------+
| 7ed6d5da-93b2-4545-a502-23d20b48ef2a | ROOT | admin |
+--------------------------------------+--------+---------+
</programlisting>
</section>
<section id="interactivecli">
<title>Interactive Shell Usage</title>
<para>To start learning cloudmonkey, the best is to use the interactive shell. Simply type cloudmonkey at the prompt and you should get the interactive shell.</para>
<para>At the cloudmonkey prompt press the tab key twice, you will see all potential verbs available. Pick on, enter a space and then press tab twice. You will see all actions available for that verb</para>
<para>To start learning CloudMonkey, the best is to use the interactive shell. Simply type CloudMonkey at the prompt and you should get the interactive shell.</para>
<para>At the CloudMonkey prompt press the tab key twice, you will see all potential verbs available. Pick on, enter a space and then press tab twice. You will see all actions available for that verb</para>
<programlisting>
<![CDATA[
cloudmonkey>

View File

@ -34,7 +34,7 @@
in the sections for <xref linkend="sect-source-buildrpm" /> or
<xref linkend="sect-source-builddebs" /> you may find pre-built
DEB and RPM packages for your convience linked from the
<ulink url="http://incubator.apache.org/cloudstack/downloads.html">downloads</ulink>
<ulink url="http://cloudstack.apache.org/downloads.html">downloads</ulink>
page.
</para>
<note>

View File

@ -27,10 +27,10 @@
<para>
Extracting the &PRODUCT; release is relatively simple and can be done
with a single command as follows:
<programlisting><prompt>$</prompt> <command>tar</command> -jxvf apache-cloudstack-4.0.0-incubating-src.tar.bz2</programlisting>
<programlisting><prompt>$</prompt> <command>tar</command> -jxvf apache-cloudstack-4.1.0.src.tar.bz2</programlisting>
</para>
<para>
You can now move into the directory:
<programlisting><prompt>$</prompt> <command>cd</command> ./apache-cloudstack-4.0.0-incubating-src</programlisting>
<programlisting><prompt>$</prompt> <command>cd</command> ./apache-cloudstack-4.1.0-src</programlisting>
</para>
</section>

View File

@ -56,9 +56,9 @@
documented. This API enables the creation of command line tools and
new user interfaces to suit particular needs. See the Developers
Guide and API Reference, both available at
<ulink url="http://incubator.apache.org/cloudstack/docs">Apache CloudStack Guides</ulink>
<ulink url="http://cloudstack.apache.org/docs/en-US/index.html">Apache CloudStack Guides</ulink>
and
<ulink url="http://incubator.apache.org/cloudstack/docs/api">Apache CloudStack API Reference</ulink>
<ulink url="http://cloudstack.apache.org/docs/api/index.html">Apache CloudStack API Reference</ulink>
respectively.
</para>
<para>

View File

@ -29,8 +29,7 @@
<ulink url="http://incubator.apache.org/cloudstack/downloads.html">
Apache CloudStack project download page</ulink>.
</para>
<para>Prior releases are available via archive.apache.org at <ulink url="http://archive.apache.org/dist/incubator/cloudstack/releases/">http://archive.apache.org/dist/incubator/cloudstack/releases/</ulink>.
</para>
<para>Prior releases are available via archive.apache.org as well. See the downloads page for more information on archived releases.</para>
<para>You'll notice several links under the 'Latest release' section. A link to a file ending in <filename>tar.bz2</filename>, as well as a PGP/GPG signature, MD5, and SHA512 file.</para>
<itemizedlist>
<listitem><para>The <filename>tar.bz2</filename> file contains the Bzip2-compressed tarball with the source code.</para></listitem>

View File

@ -54,12 +54,11 @@
addTrafficMonitor. Pass in the URL of the Traffic Sentinel as protocol + host + port
(optional); for example, http://10.147.28.100:8080. For the addTrafficMonitor command
syntax, see the API Reference at <ulink
url="http://incubator.apache.org/cloudstack/docs/api/index.html">API
url="http://cloudstack.apache.org/docs/api/index.html">API
Documentation</ulink>.</para>
<para>For information about how to call the &PRODUCT; API, see the Developers Guide at
<ulink
url="http://incubator.apache.org/cloudstack/docs/en-US/Apache_CloudStack/4.0.0-incubating/html/API_Developers_Guide/index.html"
>CloudStack API Developer's Guide</ulink>.</para>
<ulink url="http://cloudstack.apache.org/docs/en-US/index.html">
&PRODUCT; API Developer's Guide</ulink>.</para>
</listitem>
<listitem>
<para>Log in to the &PRODUCT; UI as administrator.</para>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -20,13 +20,15 @@
-->
<section id="ip-forwarding-firewalling">
<title>IP Forwarding and Firewalling</title>
<para>By default, all incoming traffic to the public IP address is rejected. All outgoing traffic
from the guests is translated via NAT to the public IP address and is allowed.</para>
<para>By default, all incoming traffic to the public IP address is rejected.
All outgoing traffic from the guests is also blocked by default.</para>
<para>To allow outgoing traffic, follow the procedure in <xref linkend="egress-firewall-rule"/>.</para>
<para>To allow incoming traffic, users may set up firewall rules and/or port forwarding rules. For
example, you can use a firewall rule to open a range of ports on the public IP address, such as
33 through 44. Then use port forwarding rules to direct traffic from individual ports within
that range to specific ports on user VMs. For example, one port forwarding rule could route
incoming traffic on the public IP's port 33 to port 100 on one user VM's private IP.</para>
<xi:include href="egress-firewall-rule.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="egress-firewall-rule.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="firewall-rules.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="port-forwarding.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</section>

191
docs/en-US/ipv6-support.xml Normal file
View File

@ -0,0 +1,191 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<!-- 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.
-->
<section id="ipv6-support">
<title>IPv6 Support in &PRODUCT;</title>
<para>&PRODUCT;supports Internet Protocol version 6 (IPv6), the recent version of the Internet
Protocol (IP) that defines routing the network traffic. IPv6 uses a 128-bit address that
exponentially expands the current address space that is available to the users. IPv6 addresses
consist of eight groups of four hexadecimal digits separated by colons, for example,
5001:0dt8:83a3:1012:1000:8s2e:0870:7454. &PRODUCT; supports IPv6 for public IPs in shared
networks. With IPv6 support, VMs in shared networks can obtain both IPv4 and IPv6 addresses from
the DHCP server. You can deploy VMs either in a IPv6 or IPv4 network, or in a dual network
environment. If IPv6 network is used, the VM generates a link-local IPv6 address by itself, and
receives a stateful IPv6 address from the DHCPv6 server.</para>
<para>IPv6 is supported only on KVM and XenServer hypervisors. The IPv6 support is only an
experimental feature.</para>
<para>Here's the sequence of events when IPv6 is used: </para>
<orderedlist>
<listitem>
<para>The administrator creates an IPv6 shared network in an advanced zone.</para>
</listitem>
<listitem>
<para>The user deploys a VM in an IPv6 shared network.</para>
</listitem>
<listitem>
<para>The user VM generates an IPv6 link local address by itself, and gets an IPv6 global or
site local address through DHCPv6.</para>
<para>For information on API changes, see <xref linkend="changed-apicommands-4.1"/>.</para>
</listitem>
</orderedlist>
<section id="guidelines-ipv6">
<title>Prerequisites and Guidelines</title>
<para>Consider the following:</para>
<itemizedlist>
<listitem>
<para>CIDR size must be 64 for IPv6 networks.</para>
</listitem>
<listitem>
<para>The DHCP client of the guest VMs should support generating DUID based on Link-layer
Address (DUID- LL). DUID-LL derives from the MAC address of guest VMs, and therefore the
user VM can be identified by using DUID. See <ulink
url="http://tools.ietf.org/html/rfc3315">Dynamic Host Configuration Protocol for IPv6
</ulink>for more information.</para>
</listitem>
<listitem>
<para>The gateway of the guest network generates Router Advisement and Response messages to
Router Solicitation. The M (Managed Address Configuration) flag of Router Advisement
should enable stateful IP address configuration. Set the M flag to where the end nodes
receive their IPv6 addresses from the DHCPv6 server as opposed to the router or
switch.</para>
<note>
<para>The M flag is the 1-bit Managed Address Configuration flag for Router Advisement.
When set, Dynamic Host Configuration Protocol (DHCPv6) is available for address
configuration in addition to any IPs set by using stateless address
auto-configuration.</para>
</note>
</listitem>
<listitem>
<para>Use the System VM template exclusively designed to support IPv6. Download the System
VM template from <ulink url="http://nfs1.lab.vmops.com/templates/routing/debian/ipv6/"
>http://nfs1.lab.vmops.com/templates/routing/debian/ipv6/</ulink>.</para>
</listitem>
<listitem>
<para>The concept of Default Network applies to IPv6 networks. However, unlike IPv4
&PRODUCT; does not control the routing information of IPv6 in shared network; the choice
of Default Network will not affect the routing in the user VM.</para>
</listitem>
<listitem>
<para>In a multiple shared network, the default route is set by the rack router, rather than
the DHCP server, which is out of &PRODUCT; control. Therefore, in order for the user VM to
get only the default route from the default NIC, modify the configuration of the user VM,
and set non-default NIC's <code>accept_ra</code> to 0 explicitly. The
<code>accept_ra</code> parameter accepts Router Advertisements and auto-configure
<code>/proc/sys/net/ipv6/conf/interface</code> with received data.</para>
</listitem>
</itemizedlist>
</section>
<section id="limitsipv6">
<title>Limitations of IPv6 in &PRODUCT; </title>
<para>The following are not yet supported:</para>
<orderedlist>
<listitem>
<para>Security groups</para>
</listitem>
<listitem>
<para>Userdata and metadata</para>
</listitem>
<listitem>
<para>Passwords</para>
</listitem>
</orderedlist>
</section>
<section id="network-conf-dhcpv6">
<title>Guest VM Configuration for DHCPv6</title>
<para>For the guest VMs to get IPv6 address, run dhclient command manually on each of the VMs.
Use DUID-LL to set up dhclient. </para>
<note><para>The IPv6 address is lost when a VM is stopped and started. Therefore, use the same procedure
to get an IPv6 address when a VM is stopped and started.</para></note>
<orderedlist>
<listitem>
<para>Set up dhclient by using DUID-LL.</para>
<para>Perform the following for DHCP Client 4.2 and above:</para>
<orderedlist numeration="loweralpha">
<listitem>
<para>Run the following command on the selected VM to get the dhcpv6 offer from
VR:</para>
<programlisting>dhclient -6 -D LL &lt;dev&gt;</programlisting>
</listitem>
</orderedlist>
<para>Perform the following for DHCP Client 4.1:</para>
<orderedlist numeration="loweralpha">
<listitem>
<para>Open the following to the dhclient configuration file:</para>
<programlisting>vi /etc/dhcp/dhclient.conf</programlisting>
</listitem>
<listitem>
<para>Add the following to the dhclient configuration file:</para>
<programlisting>send dhcp6.client-id = concat(00:03:00, hardware);</programlisting>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Get IPv6 address from DHCP server as part of the system or network restart.</para>
<para>Based on the operating systems, perform the following:</para>
<para>On CentOS 6.2:</para>
<orderedlist numeration="loweralpha">
<listitem>
<para>Open the Ethernet interface configuration file:</para>
<programlisting>vi /etc/sysconfig/network-scripts/ifcfg-eth0</programlisting>
<para>The <code>ifcfg-eth0</code> file controls the first NIC in a system.</para>
</listitem>
<listitem>
<para>Make the necessary configuration changes, as given below:</para>
<programlisting>DEVICE=eth0
HWADDR=06:A0:F0:00:00:38
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=dhcp6
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=yes
DHCPV6C=yes</programlisting>
</listitem>
<listitem>
<para>Open the following:</para>
<programlisting>vi /etc/sysconfig/network</programlisting>
</listitem>
<listitem>
<para>Make the necessary configuration changes, as given below:</para>
<programlisting>NETWORKING=yes
HOSTNAME=centos62mgmt.lab.vmops.com
NETWORKING_IPV6=yes
IPV6_AUTOCONF=no</programlisting>
</listitem>
</orderedlist>
<para>On Ubuntu 12.10</para>
<orderedlist numeration="loweralpha">
<listitem>
<para>Open the following:</para>
<programlisting>etc/network/interfaces:</programlisting>
</listitem>
<listitem>
<para>Make the necessary configuration changes, as given below:</para>
<programlisting>iface eth0 inet6 dhcp
autoconf 0
accept_ra 1</programlisting>
</listitem>
</orderedlist>
</listitem>
</orderedlist>
</section>
</section>

View File

@ -65,8 +65,7 @@ linkend="sect-source-buildrpm"/> or <xref linkend="sect-source-builddebs"/> as
<para>Repeat these steps on each additional Management Server. </para>
</listitem>
<listitem>
<para>Be sure to configure a load balancer for the Management Servers. See Management Server
Load Balancing.</para>
<para>Be sure to configure a load balancer for the Management Servers. See <xref linkend="management-server-lb"/>.</para>
</listitem>
</orderedlist>
</section>

View File

@ -19,7 +19,7 @@
under the License.
-->
<section id="management-server-lb">
<title>Setting Zone VLAN and Running VM Maximums</title>
<title>Management Server Load Balancing</title>
<para>&PRODUCT; can use a load balancer to provide a virtual IP for multiple Management
Servers. The administrator is responsible for creating the load balancer rules for the
Management Servers. The application requires persistence or stickiness across multiple sessions.
@ -58,4 +58,9 @@
</tbody>
</tgroup>
</informaltable>
<para>In addition to above settings, the adminstrator is responsible for setting the 'host' global
config value from the management server IP to load balancer virtual IP address.
If the 'host' value is not set to the VIP for Port 8250 and one of your management servers crashes,
the UI is still available but the system VMs will not be able to contact the management server.
</para>
</section>

View File

@ -26,12 +26,13 @@
<para>After the Management Server is installed and running, you can add the compute resources for it to manage. For an overview of how a &PRODUCT; cloud infrastructure is organized, see <xref linkend="cloud-infrastructure-overview" />.</para>
<para>To provision the cloud infrastructure, or to scale it up at any time, follow these procedures:</para>
<orderedlist>
<listitem><para>Add a zone. See <xref linkend="zone-add" />.</para></listitem>
<listitem><para>Add more pods (optional). See <xref linkend="pod-add" />.</para></listitem>
<listitem><para>Add more clusters (optional). See <xref linkend="cluster-add" />.</para></listitem>
<listitem><para>Add more hosts (optional). See <xref linkend="host-add" />.</para></listitem>
<listitem><para>Add primary storage. See <xref linkend="primary-storage-add" />.</para></listitem>
<listitem><para>Add secondary storage. See <xref linkend="secondary-storage-add" />.</para></listitem>
<listitem><para>Define regions (optional). See <xref linkend="region-add"/>.</para></listitem>
<listitem><para>Add a zone to the region. See <xref linkend="zone-add" />.</para></listitem>
<listitem><para>Add more pods to the zone (optional). See <xref linkend="pod-add" />.</para></listitem>
<listitem><para>Add more clusters to the pod (optional). See <xref linkend="cluster-add" />.</para></listitem>
<listitem><para>Add more hosts to the cluster (optional). See <xref linkend="host-add" />.</para></listitem>
<listitem><para>Add primary storage to the cluster. See <xref linkend="primary-storage-add" />.</para></listitem>
<listitem><para>Add secondary storage to the zone. See <xref linkend="secondary-storage-add" />.</para></listitem>
<listitem><para>Initialize and test the new cloud. See <xref linkend="initialize-and-test" />.</para></listitem>
</orderedlist>
<para>When you have finished these steps, you will have a deployment with the following basic structure:</para>

View File

@ -23,8 +23,9 @@
-->
<chapter id="provisioning-steps">
<title>Steps to Provisioning Your Cloud Infrastructure</title>
<para>This section tells how to add zones, pods, clusters, hosts, storage, and networks to your cloud. If you are unfamiliar with these entities, please begin by looking through <xref linkend="cloud-infrastructure-concepts" />.</para>
<para>This section tells how to add regions, zones, pods, clusters, hosts, storage, and networks to your cloud. If you are unfamiliar with these entities, please begin by looking through <xref linkend="cloud-infrastructure-concepts" />.</para>
<xi:include href="provisioning-steps-overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="region-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="zone-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="pod-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="cluster-add.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />

128
docs/en-US/region-add.xml Normal file
View File

@ -0,0 +1,128 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<!-- 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.
-->
<section id="region-add">
<title>Adding Regions (optional)</title>
<para>Grouping your cloud resources into geographic regions is an optional step when provisioning the cloud.
For an overview of regions, see <xref linkend="about-regions"/>.</para>
<section id="region-first">
<title>The First Region: The Default Region</title>
<para>If you do not take action to define regions, then all the zones in your cloud will be
automatically grouped into a single default region. This region is assigned the region
ID of 1.</para>
<para>You can change the name or URL of the default region by using the API command updateRegion. For example:</para>
<programlisting>http://&lt;IP_of_Management_Server&gt;:8080/client/api?command=updateRegion&amp;id=1&amp;name=Northern&amp;endpoint=http://&lt;region_1_IP_address_here&gt;:8080/client&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D</programlisting>
</section>
<section id="region-add-2">
<title>Adding a Region</title>
<para>Use these steps to add a second region in addition to the default region.</para>
<orderedlist>
<listitem><para>Each region has its own &PRODUCT; instance. Therefore, the first step of creating a new region
is to install the Management Server software, on one or more nodes, in the
geographic area where you want to set up the new region. Use the steps in the
Installation guide. When you come to the step where you set up the database, use
the additional command-line flag <code>-r &lt;region_id&gt;</code> to set a
region ID for the new region. The default region is automatically assigned a
region ID of 1, so your first additional region might be region 2.</para>
<programlisting>cloud-setup-databases cloud:&lt;dbpassword&gt;@localhost --deploy-as=root:&lt;password&gt; -e &lt;encryption_type&gt; -m &lt;management_server_key&gt; -k &lt;database_key&gt; -r &lt;region_id&gt;</programlisting>
</listitem>
<listitem><para>By the end of the installation procedure, the Management Server should have been started. Be sure that the Management Server installation was successful and complete.</para></listitem>
<listitem><para>Add region 2 to region 1. Use the API command addRegion. (For information about how to make an API call, see the Developer's Guide.)</para>
<programlisting>http://&lt;IP_of_region_1_Management_Server&gt;:8080/client/api?command=addRegion&amp;id=2&amp;name=Western&amp;endpoint=http://&lt;region_2_IP_address_here&gt;:8080/client&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D</programlisting>
</listitem>
<listitem><para>Now perform the same command in reverse, adding region 1 to region 2.</para>
<programlisting>http://&lt;IP_of_region_2_Management_Server&gt;:8080/client/api?command=addRegion&amp;id=1&amp;name=Northern&amp;endpoint=http://&lt;region_1_IP_address_here&gt;:8080/client&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D</programlisting>
</listitem>
<listitem><para>Copy the account, user, and domain tables from the region 1 database to the region 2 database.</para>
<para>In the following commands, it is assumed that you have set the root password on the
database, which is a &PRODUCT; recommended best practice. Substitute your own MySQL
root password.</para>
<orderedlist numeration="loweralpha">
<listitem><para>First, run this command to copy the contents of the database:</para>
<programlisting># mysqldump -u root -p&lt;mysql_password&gt; -h &lt;region1_db_host&gt; cloud account user domain &gt; region1.sql</programlisting>
</listitem>
<listitem><para>Then run this command to put the data onto the region 2 database:</para>
<programlisting># mysql -u root -p&lt;mysql_password&gt; -h &lt;region2_db_host&gt; cloud &lt; region1.sql</programlisting>
</listitem>
</orderedlist>
</listitem>
<listitem><para>Remove project accounts. Run these commands on the region 2 database:</para>
<programlisting>mysql&gt; delete from account where type = 5;</programlisting>
</listitem>
<listitem><para>Set the default zone as null:</para>
<programlisting>mysql&gt; update account set default_zone_id = null;</programlisting>
</listitem>
<listitem><para>Restart the Management Servers in region 2.</para></listitem>
</orderedlist>
</section>
<section id="region-add-n">
<title>Adding Third and Subsequent Regions</title>
<para>To add the third region, and subsequent additional regions, the steps are similar to those for adding the second region.
However, you must repeat certain steps additional times for each additional region:</para>
<orderedlist>
<listitem><para>Install &PRODUCT; in each additional region. Set the region ID for each region during the database setup step.</para>
<programlisting>cloud-setup-databases cloud:&lt;dbpassword&gt;@localhost --deploy-as=root:&lt;password&gt; -e &lt;encryption_type&gt; -m &lt;management_server_key&gt; -k &lt;database_key&gt; -r &lt;region_id&gt;</programlisting></listitem>
<listitem><para>Once the Management Server is running, add your new region to all existing regions by
repeatedly calling the API command addRegion. For example, if you were adding
region 3:</para>
<programlisting>http://&lt;IP_of_region_1_Management_Server&gt;:8080/client/api?command=addRegion&amp;id=3&amp;name=Eastern&amp;endpoint=http://&lt;region_3_IP_address_here&gt;:8080/client&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D
http://&lt;IP_of_region_2_Management_Server&gt;:8080/client/api?command=addRegion&amp;id=3&amp;name=Eastern&amp;endpoint=http://&lt;region_3_IP_address_here&gt;:8080/client&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D</programlisting></listitem>
<listitem><para>Repeat the procedure in reverse to add all existing regions to the new region. For example,
for the third region, add the other two existing regions:</para>
<programlisting>http://&lt;IP_of_region_3_Management_Server&gt;:8080/client/api?command=addRegion&amp;id=1&amp;name=Northern&amp;endpoint=http://&lt;region_1_IP_address_here&gt;:8080/client&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D
http://&lt;IP_of_region_3_Management_Server&gt;:8080/client/api?command=addRegion&amp;id=2&amp;name=Western&amp;endpoint=http://&lt;region_2_IP_address_here&gt;:8080/client&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D</programlisting></listitem>
<listitem><para>Copy the account, user, and domain tables from any existing region's database to the new
region's database.</para>
<para>In the following commands, it is assumed that you have set the root password on the
database, which is a &PRODUCT; recommended best practice. Substitute your own MySQL
root password.</para>
<orderedlist numeration="loweralpha">
<listitem><para>First, run this command to copy the contents of the database:</para>
<programlisting># mysqldump -u root -p&lt;mysql_password&gt; -h &lt;region1_db_host&gt; cloud account user domain &gt; region1.sql</programlisting>
</listitem>
<listitem><para>Then run this command to put the data onto the new region's database. For example, for region
3:</para>
<programlisting># mysql -u root -p&lt;mysql_password&gt; -h &lt;region3_db_host&gt; cloud &lt; region1.sql</programlisting>
</listitem>
</orderedlist>
</listitem>
<listitem><para>Remove project accounts. Run these commands on the region 2 database:</para>
<programlisting>mysql&gt; delete from account where type = 5;</programlisting>
</listitem>
<listitem><para>Set the default zone as null:</para>
<programlisting>mysql&gt; update account set default_zone_id = null;</programlisting>
</listitem>
<listitem><para>Restart the Management Servers in the new region.</para></listitem>
</orderedlist>
</section>
<section id="region-delete">
<title>Deleting a Region</title>
<para>To delete a region, use the API command removeRegion. Repeat the call to remove the region from all other regions. For example, to remove the 3rd region in a three-region cloud:</para>
<programlisting>http://&lt;IP_of_region_1_Management_Server&gt;:8080/client/api?command=removeRegion&amp;id=3&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D
http://&lt;IP_of_region_2_Management_Server&gt;:8080/client/api?command=removeRegion&amp;id=3&amp;apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&amp;signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D</programlisting>
</section>
</section>

View File

@ -25,6 +25,8 @@
<section id="response-formats">
<title>Response Formats: XML and JSON</title>
<para>CloudStack supports two formats as the response to an API call. The default response is XML. If you would like the response to be in JSON, add &amp;response=json to the Command String.</para>
<para>The two response formats differ in how they handle blank fields. In JSON, if there is no value for a response field, it will not appear in the response. If all the fields were empty, there might be no response at all.
In XML, even if there is no value to be returned, an empty field will be returned as a placeholder XML element.</para>
<para>Sample XML Response:</para>
<programlisting>
&lt;listipaddressesresponse&gt;

View File

@ -25,8 +25,10 @@
<chapter id="sys-reliability-and-ha">
<title>System Reliability and High Availability</title>
<xi:include href="ha-management-server.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="management-server-lb.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="ha-enabled-vm.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="ha-for-hosts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="primary-storage-outage-and-data-loss.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="secondary-storage-outage-and-data-loss.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="secondary-storage-outage-and-data-loss.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="api-throttling.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
@ -25,6 +25,7 @@
<section id="whats-new-in-api-4.1">
<title>What's New in the API for 4.1</title>
<xi:include href="add-remove-nic.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="ipv6-support.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="vmx-settings-dev.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="reset-ssh-key-dev.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="changed-apicommands-4.1.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>

View File

@ -21,4 +21,5 @@ package org.apache.cloudstack.engine.datacenter.entity.api;
import com.cloud.storage.StoragePool;
public interface StorageEntity extends DataCenterResourceEntity, StoragePool {
}

View File

@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.engine.subsystem.api.storage;
public abstract class AbstractScope implements Scope {
@Override
public boolean isSameScope(Scope scope) {
if (this.getScopeType() == scope.getScopeType() && this.getScopeId() == scope.getScopeId()) {
return true;
} else {
return false;
}
}
}

View File

@ -19,7 +19,7 @@
package org.apache.cloudstack.engine.subsystem.api.storage;
public class ClusterScope implements Scope {
public class ClusterScope extends AbstractScope {
private ScopeType type = ScopeType.CLUSTER;
private Long clusterId;
private Long podId;

View File

@ -34,9 +34,9 @@ public interface DataStoreLifeCycle {
public boolean unmanaged();
public boolean maintain(long storeId);
public boolean maintain(DataStore store);
public boolean cancelMaintain(long storeId);
public boolean cancelMaintain(DataStore store);
public boolean deleteDataStore(long storeId);
public boolean deleteDataStore(DataStore store);
}

View File

@ -19,12 +19,19 @@
package org.apache.cloudstack.engine.subsystem.api.storage;
import java.util.Map;
import java.util.Set;
public interface DataStoreProvider {
public DataStoreLifeCycle getLifeCycle();
public static enum DataStoreProviderType {
PRIMARY,
IMAGE
}
public DataStoreLifeCycle getDataStoreLifeCycle();
public DataStoreDriver getDataStoreDriver();
public HypervisorHostListener getHostListener();
public String getName();
public String getUuid();
public long getId();
public boolean configure(Map<String, Object> params);
public Set<DataStoreProviderType> getTypes();
}

View File

@ -20,12 +20,12 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
import java.util.List;
import com.cloud.storage.DataStoreProviderApiService;
import com.cloud.utils.component.Manager;
public interface DataStoreProviderManager extends Manager {
public DataStoreProvider getDataStoreProviderByUuid(String uuid);
public DataStoreProvider getDataStoreProviderById(long id);
public interface DataStoreProviderManager extends Manager, DataStoreProviderApiService {
public DataStoreProvider getDataStoreProvider(String name);
public DataStoreProvider getDefaultPrimaryDataStoreProvider();
public List<DataStoreProvider> getDataStoreProviders();
}

View File

@ -19,7 +19,7 @@
package org.apache.cloudstack.engine.subsystem.api.storage;
public class HostScope implements Scope {
public class HostScope extends AbstractScope {
private ScopeType type = ScopeType.HOST;
private Long hostId;
public HostScope(Long hostId) {

View File

@ -16,9 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.storage.datastore.provider;
package org.apache.cloudstack.engine.subsystem.api.storage;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
public interface ImageDataStoreProvider extends DataStoreProvider {

View File

@ -0,0 +1,220 @@
/*
* 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.engine.subsystem.api.storage;
import java.util.Map;
import com.cloud.storage.Storage.StoragePoolType;
public class PrimaryDataStoreParameters {
private Long zoneId;
private Long podId;
private Long clusterId;
private String providerName;
private Map<String, String> details;
private String tags;
private StoragePoolType type;
private String host;
private String path;
private int port;
private String uuid;
private String name;
private String userInfo;
/**
* @return the userInfo
*/
public String getUserInfo() {
return userInfo;
}
/**
* @param userInfo the userInfo to set
*/
public void setUserInfo(String userInfo) {
this.userInfo = userInfo;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the uuid
*/
public String getUuid() {
return uuid;
}
/**
* @param uuid the uuid to set
*/
public void setUuid(String uuid) {
this.uuid = uuid;
}
/**
* @return the port
*/
public int getPort() {
return port;
}
/**
* @param port the port to set
*/
public void setPort(int port) {
this.port = port;
}
/**
* @return the path
*/
public String getPath() {
return path;
}
/**
* @param path the path to set
*/
public void setPath(String path) {
this.path = path;
}
/**
* @return the host
*/
public String getHost() {
return host;
}
/**
* @param host the host to set
*/
public void setHost(String host) {
this.host = host;
}
/**
* @return the type
*/
public StoragePoolType getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(StoragePoolType type) {
this.type = type;
}
/**
* @return the tags
*/
public String getTags() {
return tags;
}
/**
* @param tags the tags to set
*/
public void setTags(String tags) {
this.tags = tags;
}
/**
* @return the details
*/
public Map<String, String> getDetails() {
return details;
}
/**
* @param details the details to set
*/
public void setDetails(Map<String, String> details) {
this.details = details;
}
/**
* @return the providerName
*/
public String getProviderName() {
return providerName;
}
/**
* @param providerName the providerName to set
*/
public void setProviderName(String providerName) {
this.providerName = providerName;
}
/**
* @return the clusterId
*/
public Long getClusterId() {
return clusterId;
}
/**
* @param clusterId the clusterId to set
*/
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
/**
* @return the podId
*/
public Long getPodId() {
return podId;
}
/**
* @param podId the podId to set
*/
public void setPodId(Long podId) {
this.podId = podId;
}
/**
* @return the zoneId
*/
public Long getZoneId() {
return zoneId;
}
/**
* @param zoneId the zoneId to set
*/
public void setZoneId(Long zoneId) {
this.zoneId = zoneId;
}
}

View File

@ -14,3 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.engine.subsystem.api.storage;
public interface PrimaryDataStoreProvider extends DataStoreProvider {
}

View File

@ -20,5 +20,6 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
public interface Scope {
public ScopeType getScopeType();
public boolean isSameScope(Scope scope);
public Long getScopeId();
}

View File

@ -19,7 +19,7 @@
package org.apache.cloudstack.engine.subsystem.api.storage;
public class ZoneScope implements Scope {
public class ZoneScope extends AbstractScope {
private ScopeType type = ScopeType.ZONE;
private Long zoneId;

View File

@ -80,8 +80,8 @@ public class StoragePoolVO implements StoragePool{
@Enumerated(value = EnumType.STRING)
private StoragePoolStatus status;
@Column(name = "storage_provider_id", updatable = true, nullable = false)
private Long storageProviderId;
@Column(name = "storage_provider_name", updatable = true, nullable = false)
private String storageProviderName;
@Column(name = "host_address")
private String hostAddress;
@ -180,12 +180,12 @@ public class StoragePoolVO implements StoragePool{
return availableBytes;
}
public Long getStorageProviderId() {
return storageProviderId;
public String getStorageProviderName() {
return storageProviderName;
}
public void setStorageProviderId(Long provider) {
storageProviderId = provider;
public void setStorageProviderName(String providerName) {
storageProviderName = providerName;
}
public long getCapacityBytes() {

View File

@ -0,0 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.engine.subsystem.api.storage;
import static org.junit.Assert.*;
import junit.framework.Assert;
import org.junit.Test;
public class ScopeTest {
@Test
public void testZoneScope() {
ZoneScope zoneScope = new ZoneScope(1L);
ZoneScope zoneScope2 = new ZoneScope(1L);
Assert.assertTrue(zoneScope.isSameScope(zoneScope2));
ZoneScope zoneScope3 = new ZoneScope(2L);
Assert.assertFalse(zoneScope.isSameScope(zoneScope3));
}
@Test
public void testClusterScope() {
ClusterScope clusterScope = new ClusterScope(1L, 1L, 1L);
ClusterScope clusterScope2 = new ClusterScope(1L, 1L, 1L);
Assert.assertTrue(clusterScope.isSameScope(clusterScope2));
ClusterScope clusterScope3 = new ClusterScope(2L, 2L, 1L);
Assert.assertFalse(clusterScope.isSameScope(clusterScope3));
}
@Test
public void testHostScope() {
HostScope hostScope = new HostScope(1L);
HostScope hostScope2 = new HostScope(1L);
HostScope hostScope3 = new HostScope(2L);
Assert.assertTrue(hostScope.isSameScope(hostScope2));
Assert.assertFalse(hostScope.isSameScope(hostScope3));
}
}

View File

@ -28,7 +28,7 @@ import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
import org.apache.cloudstack.storage.datastore.provider.ImageDataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
import org.apache.cloudstack.storage.image.datastore.ImageDataStore;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
@ -57,21 +57,21 @@ public class ImageDataStoreManagerImpl implements ImageDataStoreManager {
@Override
public ImageDataStore getImageDataStore(long dataStoreId) {
ImageDataStoreVO dataStore = dataStoreDao.findById(dataStoreId);
long providerId = dataStore.getProvider();
ImageDataStoreProvider provider = (ImageDataStoreProvider)providerManager.getDataStoreProviderById(providerId);
String providerName = dataStore.getProviderName();
ImageDataStoreProvider provider = (ImageDataStoreProvider)providerManager.getDataStoreProvider(providerName);
ImageDataStore imgStore = DefaultImageDataStoreImpl.getDataStore(dataStore,
driverMaps.get(provider.getUuid()), provider
driverMaps.get(provider.getName()), provider
);
// TODO Auto-generated method stub
return imgStore;
}
@Override
public boolean registerDriver(String uuid, ImageDataStoreDriver driver) {
if (driverMaps.containsKey(uuid)) {
public boolean registerDriver(String providerName, ImageDataStoreDriver driver) {
if (driverMaps.containsKey(providerName)) {
return false;
}
driverMaps.put(uuid, driver);
driverMaps.put(providerName, driver);
return true;
}

View File

@ -19,14 +19,18 @@
package org.apache.cloudstack.storage.image.store;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
import org.apache.cloudstack.storage.datastore.provider.ImageDataStoreProvider;
import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreHelper;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
@ -47,10 +51,9 @@ public class AncientImageDataStoreProvider implements ImageDataStoreProvider {
ImageDataStoreManager storeMgr;
@Inject
ImageDataStoreHelper helper;
long id;
String uuid;
@Override
public DataStoreLifeCycle getLifeCycle() {
public DataStoreLifeCycle getDataStoreLifeCycle() {
return lifeCycle;
}
@ -59,23 +62,12 @@ public class AncientImageDataStoreProvider implements ImageDataStoreProvider {
return this.name;
}
@Override
public String getUuid() {
return this.uuid;
}
@Override
public long getId() {
return this.id;
}
@Override
public boolean configure(Map<String, Object> params) {
lifeCycle = ComponentContext.inject(DefaultImageDataStoreLifeCycle.class);
driver = ComponentContext.inject(AncientImageDataStoreDriverImpl.class);
uuid = (String)params.get("uuid");
id = (Long)params.get("id");
storeMgr.registerDriver(uuid, driver);
storeMgr.registerDriver(this.getName(), driver);
Map<String, Object> infos = new HashMap<String, Object>();
String dataStoreName = UUID.nameUUIDFromBytes(this.name.getBytes()).toString();
@ -83,10 +75,27 @@ public class AncientImageDataStoreProvider implements ImageDataStoreProvider {
infos.put("uuid", dataStoreName);
infos.put("protocol", "http");
infos.put("scope", ScopeType.GLOBAL);
infos.put("provider", this.getId());
DataStoreLifeCycle lifeCycle = this.getLifeCycle();
infos.put("providerName", this.getName());
DataStoreLifeCycle lifeCycle = this.getDataStoreLifeCycle();
lifeCycle.initialize(infos);
return true;
}
@Override
public DataStoreDriver getDataStoreDriver() {
return this.driver;
}
@Override
public HypervisorHostListener getHostListener() {
return null;
}
@Override
public Set<DataStoreProviderType> getTypes() {
Set<DataStoreProviderType> types = new HashSet<DataStoreProviderType>();
types.add(DataStoreProviderType.IMAGE);
return types;
}
}

View File

@ -25,13 +25,13 @@ import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.Scope;
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
import org.apache.cloudstack.storage.datastore.provider.ImageDataStoreProvider;
import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
import org.apache.cloudstack.storage.image.datastore.ImageDataStore;
import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;

View File

@ -18,12 +18,16 @@
*/
package org.apache.cloudstack.storage.image.store;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
import org.apache.cloudstack.storage.datastore.provider.ImageDataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
import org.apache.cloudstack.storage.image.driver.DefaultImageDataStoreDriverImpl;
@ -41,7 +45,7 @@ public class DefaultImageDataStoreProvider implements ImageDataStoreProvider {
long id;
String uuid;
@Override
public DataStoreLifeCycle getLifeCycle() {
public DataStoreLifeCycle getDataStoreLifeCycle() {
return lifeCycle;
}
@ -50,24 +54,29 @@ public class DefaultImageDataStoreProvider implements ImageDataStoreProvider {
return this.name;
}
@Override
public String getUuid() {
return this.uuid;
}
@Override
public long getId() {
return this.id;
}
@Override
public boolean configure(Map<String, Object> params) {
lifeCycle = ComponentContext.inject(DefaultImageDataStoreLifeCycle.class);
driver = ComponentContext.inject(DefaultImageDataStoreDriverImpl.class);
uuid = (String)params.get("uuid");
id = (Long)params.get("id");
storeMgr.registerDriver(uuid, driver);
storeMgr.registerDriver(this.getName(), driver);
return true;
}
@Override
public Set<DataStoreProviderType> getTypes() {
Set<DataStoreProviderType> types = new HashSet<DataStoreProviderType>();
types.add(DataStoreProviderType.IMAGE);
return types;
}
@Override
public DataStoreDriver getDataStoreDriver() {
return this.driver;
}
@Override
public HypervisorHostListener getHostListener() {
return null;
}
}

View File

@ -86,27 +86,22 @@ public class DefaultImageDataStoreLifeCycle implements ImageDataStoreLifeCycle {
@Override
public boolean maintain(long storeId) {
public boolean maintain(DataStore store) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean cancelMaintain(long storeId) {
public boolean cancelMaintain(DataStore store) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean deleteDataStore(long storeId) {
public boolean deleteDataStore(DataStore store) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -133,7 +133,7 @@ public class StorageAllocatorTest {
storage.setCapacityBytes(20000);
storage.setHostAddress(UUID.randomUUID().toString());
storage.setPath(UUID.randomUUID().toString());
storage.setStorageProviderId(provider.getId());
storage.setStorageProviderName(provider.getName());
storage = storagePoolDao.persist(storage);
storagePoolId = storage.getId();
@ -176,7 +176,7 @@ public class StorageAllocatorTest {
storage.setCapacityBytes(20000);
storage.setHostAddress(UUID.randomUUID().toString());
storage.setPath(UUID.randomUUID().toString());
storage.setStorageProviderId(provider.getId());
storage.setStorageProviderName(provider.getName());
StoragePoolVO newStorage = storagePoolDao.persist(storage);
newStorageId = newStorage.getId();

Some files were not shown because too many files have changed in this diff Show More