merge to master

This commit is contained in:
Edison Su 2013-06-14 19:06:33 -07:00
commit f41c800d88
128 changed files with 3514 additions and 2998 deletions

View File

@ -272,4 +272,6 @@ public interface NetworkModel {
Map<Detail, String> getNtwkOffDetails(long offId);
Networks.IsolationType[] listNetworkIsolationMethods();
Nic getNicInNetworkIncludingRemoved(long vmId, long networkId);
}

View File

@ -74,9 +74,6 @@ public class ListHostsCmd extends BaseListCmd {
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
description="the Zone ID for the host")
private Long zoneId;
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
private String zoneType;
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
required=false, description="lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM")
@ -126,10 +123,6 @@ public class ListHostsCmd extends BaseListCmd {
public Long getZoneId() {
return zoneId;
}
public String getZoneType() {
return zoneType;
}
public Long getVirtualMachineId() {
return virtualMachineId;

View File

@ -59,9 +59,6 @@ public class ListStoragePoolsCmd extends BaseListCmd {
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
description="the Zone ID for the storage pool")
private Long zoneId;
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
private String zoneType;
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = StoragePoolResponse.class,
description="the ID of the storage pool")
@ -95,10 +92,6 @@ public class ListStoragePoolsCmd extends BaseListCmd {
return zoneId;
}
public String getZoneType() {
return zoneType;
}
public Long getId() {
return id;
}

View File

@ -26,6 +26,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.SnapshotResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
import com.cloud.async.AsyncJob;
@ -62,6 +63,9 @@ public class ListSnapshotsCmd extends BaseListTaggedResourcesCmd {
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
private String zoneType;
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "list snapshots by zone id")
private Long zoneId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -89,6 +93,10 @@ public class ListSnapshotsCmd extends BaseListTaggedResourcesCmd {
public String getZoneType() {
return zoneType;
}
public Long getZoneId() {
return zoneId;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////

View File

@ -78,9 +78,6 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class, description="the availability zone ID")
private Long zoneId;
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
private String zoneType;
@Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN,
description="list by network type; true if need to list vms using Virtual Network, false otherwise")
private Boolean forVirtualNetwork;
@ -149,10 +146,6 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
return zoneId;
}
public String getZoneType() {
return zoneType;
}
public Boolean getForVirtualNetwork() {
return forVirtualNetwork;
}

View File

@ -67,8 +67,6 @@ public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
description="the ID of the availability zone")
private Long zoneId;
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
private String zoneType;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
@ -103,9 +101,6 @@ public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
return zoneId;
}
public String getZoneType() {
return zoneType;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////

View File

@ -39,10 +39,10 @@ public class FirewallResponse extends BaseResponse {
private String endPort;
@SerializedName(ApiConstants.IP_ADDRESS_ID) @Param(description="the public ip address id for the firewall rule")
private Long publicIpAddressId;
private String publicIpAddressId;
@SerializedName(ApiConstants.NETWORK_ID) @Param(description="the network id of the firewall rule")
private Long networkId;
private String networkId;
@SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the public ip address for the firewall rule")
private String publicIpAddress;
@ -78,7 +78,7 @@ public class FirewallResponse extends BaseResponse {
this.endPort = endPort;
}
public void setPublicIpAddressId(Long publicIpAddressId) {
public void setPublicIpAddressId(String publicIpAddressId) {
this.publicIpAddressId = publicIpAddressId;
}
@ -86,7 +86,7 @@ public class FirewallResponse extends BaseResponse {
this.publicIpAddress = publicIpAddress;
}
public void setNetworkId(Long networkId) {
public void setNetworkId(String networkId) {
this.networkId = networkId;
}

View File

@ -93,6 +93,10 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
@Param(description = "the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage")
private Snapshot.State state;
@SerializedName(ApiConstants.ZONE_ID)
@Param(description = "id of the availability zone")
private String zoneId;
@SerializedName(ApiConstants.ZONE_NAME)
@Param(description = "name of the availability zone")
private String zoneName;
@ -181,6 +185,9 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
this.projectName = projectName;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}

View File

@ -91,8 +91,6 @@ public class ServiceProvider extends ManagerBase {
// register service implementation object
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
txn.close();
serviceMap.put(AmazonS3SkeletonInterface.class, new S3SerializableServiceImplementation(engine));
serviceMap.put(AmazonEC2SkeletonInterface.class, new EC2SoapServiceImpl(EC2_engine));
}
public synchronized static ServiceProvider getInstance() {
@ -101,7 +99,9 @@ public class ServiceProvider extends ManagerBase {
@PostConstruct
void initComponent() {
instance = this;
serviceMap.put(AmazonS3SkeletonInterface.class, new S3SerializableServiceImplementation(engine));
serviceMap.put(AmazonEC2SkeletonInterface.class, new EC2SoapServiceImpl(EC2_engine));
instance = this;
}
public boolean configure(String name, Map<String, Object> params)

View File

@ -370,6 +370,7 @@
<property name="Adapters">
<list>
<ref bean="HostAntiAffinityProcessor" />
<ref bean="ExplicitDedicationProcessor"/>
</list>
</property>
</bean>

View File

@ -23,7 +23,8 @@ public class ScaleVmCommand extends Command {
VirtualMachineTO vm;
String vmName;
int cpus;
Integer speed;
Integer minSpeed;
Integer maxSpeed;
long minRam;
long maxRam;
@ -40,14 +41,15 @@ public class ScaleVmCommand extends Command {
}
public ScaleVmCommand(String vmName, int cpus,
Integer speed, long minRam, long maxRam, boolean limitCpuUse) {
Integer minSpeed, Integer maxSpeed, long minRam, long maxRam, boolean limitCpuUse) {
super();
this.vmName = vmName;
this.cpus = cpus;
this.speed = speed;
this.minSpeed = minSpeed;
this.maxSpeed = maxSpeed;
this.minRam = minRam;
this.maxRam = maxRam;
this.vm = new VirtualMachineTO(1L, vmName, null, cpus, speed, minRam, maxRam, null, null, false, false, null);
this.vm = new VirtualMachineTO(1L, vmName, null, cpus, minSpeed, maxSpeed, minRam, maxRam, null, null, false, limitCpuUse, null);
/*vm.setName(vmName);
vm.setCpus(cpus);
vm.setRam(minRam, maxRam);*/
@ -57,14 +59,22 @@ public class ScaleVmCommand extends Command {
this.cpus = cpus;
}
public Integer getSpeed() {
return speed;
public Integer getMinSpeed() {
return minSpeed;
}
public void setSpeed(Integer speed) {
this.speed = speed;
public void setMinSpeed(Integer minSpeed) {
this.minSpeed = minSpeed;
}
public Integer getMaxSpeed() {
return minSpeed;
}
public void setMaxSpeed(Integer maxSpeed) {
this.maxSpeed = maxSpeed;
}
public long getMinRam() {
return minRam;
}

View File

@ -111,7 +111,7 @@ public class VirtualRoutingResource implements Manager {
private String _routerProxyPath;
private String _createIpAliasPath;
private String _deleteIpAliasPath;
private String _configDhcpPath;
private String _callDnsMasqPath;
private int _timeout;
private int _startTimeout;
@ -625,7 +625,8 @@ public class VirtualRoutingResource implements Manager {
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
final Script command = new Script(_createIpAliasPath, _timeout, s_logger);
List<IpAliasTO> ipAliasTOs = cmd.getIpAliasList();
String args=routerIp+" ";
String args = "";
command.add(routerIp);
for (IpAliasTO ipaliasto : ipAliasTOs) {
args = args + ipaliasto.getAlias_count()+":"+ipaliasto.getRouterip()+":"+ipaliasto.getNetmask()+"-";
}
@ -637,7 +638,8 @@ public class VirtualRoutingResource implements Manager {
protected Answer execute(final DeleteIpAliasCommand cmd) {
final Script command = new Script(_deleteIpAliasPath, _timeout, s_logger);
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
String args = "";
String args ="";
command.add(routerIp);
List<IpAliasTO> revokedIpAliasTOs = cmd.getDeleteIpAliasTos();
for (IpAliasTO ipAliasTO : revokedIpAliasTOs) {
args = args + ipAliasTO.getAlias_count()+":"+ipAliasTO.getRouterip()+":"+ipAliasTO.getNetmask()+"-";
@ -653,32 +655,26 @@ public class VirtualRoutingResource implements Manager {
}
protected Answer execute(final DnsMasqConfigCommand cmd) {
final Script command = new Script(_configDhcpPath, _timeout, s_logger);
final Script command = new Script(_callDnsMasqPath, _timeout, s_logger);
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
DnsMasqConfigurator configurator = new DnsMasqConfigurator();
String [] config = configurator.generateConfiguration(cmd);
File tmpCfgFile = null;
String cfgFileName = routerIp.replace(".","-")+"dns.cgf";
String tmpCfgFileContents = "";
for (int i = 0; i < config.length; i++) {
tmpCfgFileContents += config[i];
tmpCfgFileContents += "\n";
}
File permKey = new File("/root/.ssh/id_rsa.cloud");
String cfgFilePath = "/tmp/"+cfgFileName;
try {
String cfgFilePath = "";
if (routerIp != null) {
tmpCfgFile = File.createTempFile(routerIp.replace('.', '_'), "cfg");
final PrintWriter out
= new PrintWriter(new BufferedWriter(new FileWriter(tmpCfgFile)));
for (int i=0; i < config.length; i++) {
out.println(config[i]);
}
out.close();
cfgFilePath = tmpCfgFile.getAbsolutePath();
}
SshHelper.scpTo(routerIp, 3922, "root", permKey, null, "/tmp/", tmpCfgFileContents.getBytes(), cfgFileName, null);
command.add(routerIp);
command.add(cfgFilePath);
final String result = command.execute();
return new Answer(cmd, result == null, result);
} catch (final IOException e) {
} catch (Exception e) {
return new Answer(cmd, false, e.getMessage());
} finally {
if (tmpCfgFile != null) {
tmpCfgFile.delete();
}
}
}
@ -1209,6 +1205,18 @@ public class VirtualRoutingResource implements Manager {
if (_routerProxyPath == null) {
throw new ConfigurationException("Unable to find router_proxy.sh");
}
_createIpAliasPath = findScript("createipAlias.sh");
if (_createIpAliasPath == null) {
throw new ConfigurationException("unable to find createipAlias.sh");
}
_deleteIpAliasPath = findScript("deleteipAlias.sh");
if (_deleteIpAliasPath == null) {
throw new ConfigurationException("unable to find deleteipAlias.sh");
}
_callDnsMasqPath = findScript("call_dnsmasq.sh");
if (_callDnsMasqPath == null) {
throw new ConfigurationException("unable to find call_dnsmasq.sh");
}
return true;
}

View File

@ -49,6 +49,6 @@
<xi:include href="gsoc-tuna.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="gsoc-imduffy15.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="gsoc-dharmesh.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="gsoc-meng.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>

View File

@ -0,0 +1,147 @@
<?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="add-remove-nic-ui">
<title>Reconfiguring Physical Networks in VMs</title>
<para>&PRODUCT; provides you the ability to move VMs between networks and reconfigure a VM's
network. You can remove a VM from a physical network and add to a new physical network. You can
also change the default physical network of a virtual machine. With this functionality, hybrid
or traditional server loads can be accommodated with ease. </para>
<para>This feature is supported on XenServer and KVM hypervisors.</para>
<section id="add-nic">
<title>Adding a Physical Network</title>
<orderedlist>
<listitem>
<para>Log in to the CloudPlatform UI as an administrator or end user.</para>
</listitem>
<listitem>
<para>In the left navigation, click Instances.</para>
</listitem>
<listitem>
<para>Choose the VM that you want to work with.</para>
</listitem>
<listitem>
<para>Click the NICs tab.</para>
</listitem>
<listitem>
<para>Click Add network to VM.</para>
<para>The Add network to VM dialog is displayed.</para>
</listitem>
<listitem>
<para>In the drop-down list, select the network that you would like to add this VM
to.</para>
<para> A new NIC is added for this network. You can view the following details in the NICs
page:</para>
<itemizedlist>
<listitem>
<para>ID</para>
</listitem>
<listitem>
<para>Network Name</para>
</listitem>
<listitem>
<para>Type</para>
</listitem>
<listitem>
<para>IP Address</para>
</listitem>
<listitem>
<para>Gateway</para>
</listitem>
<listitem>
<para>Netmask</para>
</listitem>
<listitem>
<para>Is default</para>
</listitem>
<listitem>
<para>CIDR (for IPv6)</para>
</listitem>
</itemizedlist>
</listitem>
</orderedlist>
</section>
<section id="remove-nic">
<title>Removing a Physical Network</title>
<orderedlist>
<listitem>
<para>Log in to the CloudPlatform UI as an administrator or end user.</para>
</listitem>
<listitem>
<para>In the left navigation, click Instances.</para>
</listitem>
<listitem>
<para>Choose the VM that you want to work with.</para>
</listitem>
<listitem>
<para>Click the NICs tab.</para>
</listitem>
<listitem>
<para>Locate the NIC you want to remove.</para>
</listitem>
<listitem>
<para>Click Remove NIC button.<inlinemediaobject>
<imageobject>
<imagedata fileref="./images/remove-nic.png"/>
</imageobject>
<textobject>
<phrase>remove-nic.png: button to remove a NIC</phrase>
</textobject>
</inlinemediaobject></para>
</listitem>
<listitem>
<para>Click Yes to confirm.</para>
</listitem>
</orderedlist>
</section>
<section id="default-nic">
<title>Selecting the Default Physical Network</title>
<orderedlist>
<listitem>
<para>Log in to the CloudPlatform UI as an administrator or end user.</para>
</listitem>
<listitem>
<para>In the left navigation, click Instances.</para>
</listitem>
<listitem>
<para>Choose the VM that you want to work with.</para>
</listitem>
<listitem>
<para>Click the NICs tab.</para>
</listitem>
<listitem>
<para>Locate the NIC you want to work with.</para>
</listitem>
<listitem>
<para>Click the Set default NIC button.<inlinemediaobject>
<imageobject>
<imagedata fileref="./images/set-default-nic.png"/>
</imageobject>
<textobject>
<phrase>set-default-nic.png: button to set a NIC as default one.</phrase>
</textobject>
</inlinemediaobject></para>
</listitem>
<listitem>
<para>Click Yes to confirm.</para>
</listitem>
</orderedlist>
</section>
</section>

View File

@ -48,6 +48,7 @@ under the License.
<section id="generating-rpms">
<title>Generating RPMS</title>
<para>Now that we have the prerequisites and source, you will cd to the <filename>packaging/centos63/</filename> directory.</para>
<programlisting><prompt>$</prompt> cd packaging/centos63</programlisting>
<para>Generating RPMs is done using the <filename>package.sh</filename> script:
<programlisting><prompt>$</prompt>./package.sh</programlisting>
</para>

235
docs/en-US/gsoc-meng.xml Normal file
View File

@ -0,0 +1,235 @@
<?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_GSoC_Guide.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="gsoc-meng">
<title>Meng's 2013 GSoC Proposal</title>
<para>This chapter describes Meng's 2013 Google Summer of Code project within the &PRODUCT; ASF project. It is a copy paste of the submitted proposal.</para>
<section id="Project-Description">
<title>Project Description</title>
<para>
Getting a hadoop cluster going can be challenging and painful due to the tedious configuration phase and the diverse idiosyncrasies of each cloud provider. Apache Whirr<ulink url="http://whirr.apache.org/ "><citetitle>[1]</citetitle></ulink> and Provisionr is a set of libraries for running cloud services in an automatic or semi-automatic fashion. They take advantage of a cloud-neutral library called jclouds<ulink url=" http://www.jclouds.org/documentation/gettingstarted/what-is-jclouds/"><citetitle>[2]</citetitle></ulink> to create one-click, auto-configuring hadoop clusters on multiple clouds. Since jclouds supports CloudStack API, most of the services provided by Whirr and Provisionr should work out of the box on CloudStack. My first task is to test that assumption, make sure everything is well documented, and correct all issues with the latest version of CloudStack (4.0 and 4.1).
</para>
<para>
The biggest challenge for hadoop provisioning is automatically configuring each instance at launch time based on what it is supposed to do, a process known as contextualization<ulink url="http://dl.acm.org/citation.cfm?id=1488934"><citetitle>[3]</citetitle></ulink><ulink url="http://www.nimbusproject.org/docs/current/clouds/clusters2.html "><citetitle>[4]</citetitle></ulink>. It causes last minute changes inside an instance to adapt to a cluster environment. Many automated cloud services are enabled by contextualization. For example in one-click hadoop clusters, contextualization basically amounts to generating and distributing ssh key pairs among instances, telling an instance where the master node is and what other slave nodes it should be aware of, etc. On EC2 contextualization is done via passing information through the EC2_USER_DATA entry<ulink url="http://aws.amazon.com/amazon-linux-ami/ "><citetitle>[5]</citetitle></ulink><ulink url="https://svn.apache.org/repos/asf/whirr/branches/contrib-python/src/py/hadoop/cloud/data/hadoop-ec2-init-remote.sh"><citetitle>[6]</citetitle></ulink>. Whirr and Provisionr embrace this feature to provision hadoop instances on EC2. My second task is to test and extend Whirr and Provisionrs one-click solution on EC2 to CloudStack and also improve CloudStacks support for Whirr and Provisionr to enable hadoop provisioning on CloudStack based clouds.
</para>
<para>
My third task is to add a Query API that is compatible with Amazon Elastic MapReduce (EMR) to CloudStack. Through this API, all hadoop provisioning functionality will be exposed and users can reuse cloud clients that are written for EMR to create and manage hadoop clusters on CloudStack based clouds.
</para>
</section>
<section id="Project-Details">
<title>Project Details</title>
<para>
Whirr defines four roles for the hadoop provisioning service: Namenode, JobTracker, Datanode and TaskTraker. With the help of CloudInit<ulink url="https://help.ubuntu.com/community/CloudInit "><citetitle>[7]</citetitle></ulink> (a popular package for cloud instance initialization), each VM instance is configured based on its role and a compressed file that is passed in the EC2_USER_DATA entry. Since CloudStack also supports EC2_USER_DATA, I think the most feasible way to have hadoop provisioning on CloudStack is to extend Whirrs solution on EC2 to CloudStack platform and to make necessary adjustment based on CloudStacks
</para>
<para>
Whirr and Provisionr deal with two critical issues in their role configuration scripts (configure-hadoop-role_list): SSH key authentication and hostname configuration.
</para>
<orderedlist>
<listitem><para>
SSH Key Authentication. The need for SSH Key based authentication is required so that the master node can login to slave nodes to start/stop hadoop daemons. Also each node needs to login to itself to start its own hadoop daemons. Traditionally this is done by generating a key pair on the master node and distributing the public key to all slave nodes. This can be only done with human intervention. Whirr works around this problem on EC2 by having a common key pair for all nodes in a hadoop cluster. Thus every node is able to login to one another. The key pair is provided by users and obtained by CloudInit inside an instance from metadata service. As far as I know, Cloudstack does not support user-provided ssh key authentication. Although CloudStack has the createSSHKeyPair API<ulink url="http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/Installation_Guide/using-sshkeys.html "><citetitle>[8]</citetitle></ulink> to generate SSH keys and users can create an instance template that supports SSH keys, there is no easy way to have a unified SSH key on all cluster instances. Besides Whirr prefers minimal image management, so having a customized template doesnt seem quite fit here.
</para></listitem>
<listitem><para>
Hostname configuration. The hostname of each instance has to be properly set and injected into the set of hadoop config files (core-site.xml, hdfs-site.xml, mapred-site.xml ). For an EC2 instance, its host name is converted from a combination of its public IP and an EC2-specific pre/suffix (e.g. an instance with IP 54.224.206.71 will have its hostname set to ec2-54-224-206-71.compute-1.amazonaws.com). This hostname amounts to the Fully Qualified Domain Name that uniquely identifies this node on the network. As for the case of CloudStack, if users do not specify a name the hostname that identifies a VM on a network will be a unique UUID generated by CloudStack<ulink url="https://cwiki.apache.org/CLOUDSTACK/allow-user-provided-hostname-internal-vm-name-on-hypervisor-instead-of-cloud-platform-auto-generated-name-for-guest-vms.html"><citetitle>[9]</citetitle></ulink>.
</para></listitem>
</orderedlist>
<para>
These two are the main issues that need support improvement on the CloudStack side. Other things like preparing disks, installing hadoop tarballs and starting hadoop daemons can be easily done as they are relatively role/instance-independent and static. Runurl can be used to simplify user-data scripts.
</para>
<para>
After we achieve hadoop provisioning on CloudStack using Whirr we can go further to add a Query API to CloudStack to expose this functionality. I will write an API that is compatible with Amazon Elastic MapReduce Service (EMR)<ulink url="http://docs.aws.amazon.com/ElasticMapReduce/latest/API/Welcome.html "><citetitle>[10]</citetitle></ulink> so that users can reuse clients that are written for EMR to submit jobs to existing hadoop clusters, poll job status, terminate a hadoop instance and do other things on CloudStack based clouds. There are eight actions<ulink url="http://docs.aws.amazon.com/ElasticMapReduce/latest/API/API_Operations.html "><citetitle>[11]</citetitle></ulink> now supported in EMR API. I will try to implement as many as I can during the period of GSoC. The following statements give some examples of the API that I will write.
</para>
<programlisting><![CDATA[
https://elasticmapreduce.cloudstack.com?Action=RunJobFlow &Name=MyJobFlowName &Instances.MasterInstanceType=m1.small &Instances.SlaveInstanceType=m1.small &Instances.InstanceCount=4
]]></programlisting>
<para>
This will launch a new hadoop cluster with four instances using specified instance types and add a job flow to it.
</para>
<programlisting><![CDATA[
https://elasticmapreduce.cloudstack.com?Action=AddJobFlowSteps &JobFlowId=j-3UN6WX5RRO2AG &Steps.member.1.Name=MyStep2 &Steps.member.1.HadoopJarStep.Jar=MyJar
]]></programlisting>
<para>
This will add a step to the existing job flow with ID j-3UN6WX5RRO2AG. This step will run the specified jar file.
</para>
<programlisting><![CDATA[
https://elasticmapreduce.cloudstack.com?Action=DescribeJobFlows &JobFlowIds.member.1=j-3UN6WX5RRO2AG
]]></programlisting>
<para>
This will return the status of the given job flow.
</para>
</section>
<section id="Roadmap">
<title>Roadmap</title>
<para><emphasis role="bold">Jun. 17 Jun. 30</emphasis> </para>
<orderedlist>
<listitem><para>
Learn CloudStack and Apache Whirr/Provisionr APIs; Deploy a CloudStack cluster.
</para></listitem>
<listitem><para>
Identify how EC2_USER_DATA is passed and executed on each CloudStack instance.
</para></listitem>
<listitem><para>
Figure out how the files passed in EC2_USER_DATA are acted upon by CloudInit.
</para></listitem>
<listitem><para>
Identify files in /etc/init/ that are used or modified by Whirr and Provisionr for hadoop related configuration.
</para></listitem>
<listitem><para>
Deploy a hadoop cluster on CloudStack via Whirr/Provisionr. This is to test what are missing in CloudStack or Whirr/Provisionr in terms of their support for each other.
</para></listitem>
</orderedlist>
<para><emphasis role="bold">Jul. 1 Aug. 1</emphasis> </para>
<orderedlist>
<listitem><para>
Write scripts to configure VM hostname on CloudStack with the help of CloudInit;
</para></listitem>
<listitem><para>
Write scripts to distribute SSH keys among CloudStack instances. Add the capability of using user-provided ssh key for authentication to CloudStack.
</para></listitem>
<listitem><para>
Take care of the other things left for hadoop provisioning, such as mounting disks, installing hadoop tarballs, etc.
</para></listitem>
<listitem><para>
Compose files that need to be passed in EC2_USER_DATA to each CloudStack instance . Test these files and write patches to make sure that Whirr/Provisionr can succefully deploy one-click hadoop clusters on CloudStack.
</para></listitem>
</orderedlist>
<para><emphasis role="bold">Aug. 3 Sep. 8</emphasis> </para>
<orderedlist>
<listitem><para>
Design and build an Elastic Mapreduce API for CloudStack that takes control of hadoop cluster creation and management.
</para></listitem>
<listitem><para>
Implement the eight actions defined in EMR API. This task might take a while.
</para></listitem>
</orderedlist>
<para><emphasis role="bold">Sep. 10 Sep. 23</emphasis> </para>
<orderedlist>
<listitem><para>
Code cleaning and documentation wrap up.
</para></listitem>
</orderedlist>
</section>
<section id="Deliverables-meng">
<title>Deliverables</title>
<orderedlist>
<listitem><para>
Whirr has limited support for CloudStack. Check whats missing and make sure all steps are properly documented on the Whirr and CloudStack websites.
</para></listitem>
<listitem><para>
Contribute code to CloudStack and and send patches to Whirr/Provisionr if necessary to enable hadoop provisioning on CloudStack via Whirr/Provisionr.
</para></listitem>
<listitem><para>
Build an EMR-compatible API for CloudStack.
</para></listitem>
</orderedlist>
</section>
<section id="Nice-to-have">
<title>Nice to have</title>
<para>In addition to the required deliverables, its nice to have the following:</para>
<orderedlist>
<listitem><para>
The capability to add and remove hadoop nodes dynamically to enable elastic hadoop clusters on CloudStack.
</para></listitem>
<listitem><para>
A review of the existing tools that offer one-click provisioning and make sure that they support CloudStack based clouds.
</para></listitem>
</orderedlist>
</section>
<section id="References">
<title>References</title>
<orderedlist>
<listitem><para>
http://whirr.apache.org/
</para></listitem>
<listitem><para>
http://www.jclouds.org/documentation/gettingstarted/what-is-jclouds/
</para></listitem>
<listitem><para>
Katarzyna Keahey, Tim Freeman, Contextualization: Providing One-Click Virtual Clusters
</para></listitem>
<listitem><para>
http://www.nimbusproject.org/docs/current/clouds/clusters2.html
</para></listitem>
<listitem><para>
http://aws.amazon.com/amazon-linux-ami/
</para></listitem>
<listitem><para>
https://svn.apache.org/repos/asf/whirr/branches/contrib-python/src/py/hadoop/cloud/data/hadoop-ec2-init-remote.sh
</para></listitem>
<listitem><para>
https://help.ubuntu.com/community/CloudInit
</para></listitem>
<listitem><para>
http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/Installation_Guide/using-sshkeys.html
</para></listitem>
<listitem><para>
https://cwiki.apache.org/CLOUDSTACK/allow-user-provided-hostname-internal-vm-name-on-hypervisor-instead-of-cloud-platform-auto-generated-name-for-guest-vms.html
</para></listitem>
<listitem><para>
http://docs.aws.amazon.com/ElasticMapReduce/latest/API/Welcome.html
</para></listitem>
<listitem><para>
http://docs.aws.amazon.com/ElasticMapReduce/latest/API/API_Operations.html
</para></listitem>
<listitem><para>
http://buildacloud.org/blog/235-puppet-and-cloudstack.html
</para></listitem>
<listitem><para>
http://chriskleban-internet.blogspot.com/2012/03/build-cloud-cloudstack-instance.html
</para></listitem>
<listitem><para>
http://gehrcke.de/2009/06/aws-about-api/
</para></listitem>
<listitem><para>
Apache_CloudStack-4.0.0-incubating-API_Developers_Guide-en-US.pdf
</para></listitem>
</orderedlist>
</section>
</chapter>

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

View File

@ -48,6 +48,7 @@
<xi:include href="dns-dhcp.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="vpn.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="elastic-ip.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="pvlan.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="inter-vlan-routing.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="configure-vpc.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="persistent-network.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>

View File

@ -21,18 +21,65 @@
-->
<section id="pvlan">
<title>Isolation in Advanced Zone Using Private VLAN</title>
<para/>
<para>Isolation of guest traffic in shared networks can be achieved by using Private VLANs
(PVLAN). PVLANs provide Layer 2 isolation between ports within the same VLAN. In a PVLAN-enabled
shared network, a user VM cannot reach other user VM though they can reach the DHCP server and
gateway, this would in turn allow users to control traffic within a network and help them deploy
multiple applications without communication between application as well as prevent communication
with other users VMs.</para>
<itemizedlist>
<listitem>
<para>Isolate VMs in a shared networks by using Private VLANs.</para>
</listitem>
<listitem>
<para>Supported on KVM, XenServer, and VMware hypervisors</para>
</listitem>
<listitem>
<para>PVLAN-enabled shared network can be a part of multiple networks of a guest VM.</para>
</listitem>
</itemizedlist>
<section id="about-pvlan">
<title>About Private VLAN</title>
<para>In an Ethernet switch, a VLAN is a broadcast domain in which hosts can establish direct
<para>In an Ethernet switch, a VLAN is a broadcast domain where hosts can establish direct
communication with each another at Layer 2. Private VLAN is designed as an extension of VLAN
standard to add further segmentation of the logical broadcast domain. A regular VLAN is a
single broadcast domain, whereas a private VLAN partitions a larger VLAN broadcast domain into
smaller sub-domains. A sub-domain is represented by a pair of VLANs: a Primary VLAN and a
Secondary VLAN. The original VLAN that is being divided into smaller groups is called
Primary, That implies all VLAN pairs in a private VLAN share the same Primary VLAN. All the
Secondary VLAN. The original VLAN that is being divided into smaller groups is called Primary,
which implies that all VLAN pairs in a private VLAN share the same Primary VLAN. All the
secondary VLANs exist only inside the Primary. Each Secondary VLAN has a specific VLAN ID
associated to it, which differentiates one sub-domain from another.</para>
associated to it, which differentiates one sub-domain from another. </para>
<para>Three types of ports exist in a private VLAN domain, which essentially determine the
behaviour of the participating hosts. Each ports will have its own unique set of rules, which
regulate a connected host's ability to communicate with other connected host within the same
private VLAN domain. Configure each host that is part of a PVLAN pair can be by using one of
these three port designation:</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">Promiscuous</emphasis>: A promiscuous port can communicate with
all the interfaces, including the community and isolated host ports that belong to the
secondary VLANs. In Promiscuous mode, hosts are connected to promiscuous ports and are
able to communicate directly with resources on both primary and secondary VLAN. Routers,
DHCP servers, and other trusted devices are typically attached to promiscuous
ports.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Isolated VLANs</emphasis>: The ports within an isolated VLAN
cannot communicate with each other at the layer-2 level. The hosts that are connected to
Isolated ports can directly communicate only with the Promiscuous resources. If your
customer device needs to have access only to a gateway router, attach it to an isolated
port.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Community VLANs</emphasis>: The ports within a community VLAN
can communicate with each other and with the promiscuous ports, but they cannot
communicate with the ports in other communities at the layer-2 level. In a Community mode,
direct communication is permitted only with the hosts in the same community and those that
are connected to the Primary PVLAN in promiscuous mode. If your customer has two devices
that need to be isolated from other customers' devices, but to be able to communicate
among themselves, deploy them in community ports.</para>
</listitem>
</itemizedlist>
<para>For further reading:</para>
<itemizedlist>
<listitem>
@ -52,6 +99,149 @@
</section>
<section id="prereq-pvlan">
<title>Prerequisites</title>
<para>Ensure that you configure private VLAN on your physical switches out-of-band.</para>
<itemizedlist>
<listitem>
<para>Use a PVLAN supported switch.</para>
<para>See <ulink
url="http://www.cisco.com/en/US/products/hw/switches/ps708/products_tech_note09186a0080094830.shtml"
>Private VLAN Catalyst Switch Support Matrix</ulink>for more information.</para>
</listitem>
<listitem>
<para>All the layer 2 switches, which are PVLAN-aware, are connected to each other, and one
of them is connected to a router. All the ports connected to the host would be configured
in trunk mode. Open Management VLAN, Primary VLAN (public) and Secondary Isolated VLAN
ports. Configure the switch port connected to the router in PVLAN promiscuous trunk mode,
which would translate an isolated VLAN to primary VLAN for the PVLAN-unaware router. </para>
<para>Note that only Cisco Catalyst 4500 has the PVLAN promiscuous trunk mode to connect
both normal VLAN and PVLAN to a PVLAN-unaware switch. For other Catalyst PVLAN support
switch, connect the switch to upper switch by using cables. The number of cables should be
greater than the number of PVLANs used.</para>
</listitem>
<listitem>
<para>Configure private VLAN on your physical switches out-of-band.</para>
</listitem>
<listitem>
<para>Before you use PVLAN on XenServer and KVM, enable Open vSwitch (OVS) .</para>
<note>
<para>OVS on XenServer and KVM does not support PVLAN. Therefore, simulate PVLAN on OVS
for XenServer and KVM by modifying the flow table and tagging every traffic leaving
guest VMs with the secondary VLAN ID.</para>
</note>
</listitem>
</itemizedlist>
</section>
<section id="ability-pvlan">
<title>Creating a PVLAN-Enabled Guest Network</title>
<orderedlist>
<listitem>
<para>Log in to the CloudPlatform UI as administrator.</para>
</listitem>
<listitem>
<para>In the left navigation, choose Infrastructure.</para>
</listitem>
<listitem>
<para>On Zones, click View More.</para>
</listitem>
<listitem>
<para>Click the zone to which you want to add a guest network.</para>
</listitem>
<listitem>
<para>Click the Physical Network tab.</para>
</listitem>
<listitem>
<para>Click the physical network you want to work with.</para>
</listitem>
<listitem>
<para>On the Guest node of the diagram, click Configure.</para>
</listitem>
<listitem>
<para>Click the Network tab.</para>
</listitem>
<listitem>
<para>Click Add guest network.</para>
<para>The Add guest network window is displayed.</para>
</listitem>
<listitem>
<para>Specify the following:</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">Name</emphasis>: The name of the network. This will be
visible to the user.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Description</emphasis>: The short description of the network
that can be displayed to users.</para>
</listitem>
<listitem>
<para><emphasis role="bold">VLAN ID</emphasis>: The unique ID of the VLAN.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Isolated VLAN ID</emphasis>: The unique ID of the Secondary
Isolated VLAN. </para>
<para>For the description on Secondary Isolated VLAN, see <xref linkend="about-pvlan"
/>.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Scope</emphasis>: The available scopes are Domain, Account,
Project, and All.</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">Domain</emphasis>: Selecting Domain limits the scope of
this guest network to the domain you specify. The network will not be available
for other domains. If you select Subdomain Access, the guest network is available
to all the sub domains within the selected domain.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Account</emphasis>: The account for which the guest
network is being created for. You must specify the domain the account belongs
to.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Project</emphasis>: The project for which the guest
network is being created for. You must specify the domain the project belongs
to.</para>
</listitem>
<listitem>
<para><emphasis role="bold">All</emphasis>: The guest network is available for all
the domains, account, projects within the selected zone. </para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para><emphasis role="bold">Network Offering</emphasis>: If the administrator has
configured multiple network offerings, select the one you want to use for this
network.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Gateway</emphasis>: The gateway that the guests should
use.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Netmask</emphasis>: The netmask in use on the subnet the
guests will use.</para>
</listitem>
<listitem>
<para><emphasis role="bold">IP Range</emphasis>: A range of IP addresses that are
accessible from the Internet and are assigned to the guest VMs.</para>
<para>If one NIC is used, these IPs should be in the same CIDR in the case of
IPv6.</para>
</listitem>
<listitem>
<para><emphasis role="bold">IPv6 CIDR</emphasis>: The network prefix that defines the
guest network subnet. This is the CIDR that describes the IPv6 addresses in use in the
guest networks in this zone. To allot IP addresses from within a particular address
block, enter a CIDR.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Network Domain</emphasis>: A custom DNS suffix at the level
of a network. If you want to assign a special domain name to the guest VM network,
specify a DNS suffix.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>Click OK to confirm.</para>
</listitem>
</orderedlist>
</section>
</section>

View File

@ -28,5 +28,6 @@
<para>Each VM has just one default network. The virtual router's DHCP reply will set the guest's default gateway as that for the default network. Multiple non-default networks may be added to a guest in addition to the single, required default network. The administrator can control which networks are available as the default network.</para>
<para>Additional networks can either be available to all accounts or be assigned to a specific account. Networks that are available to all accounts are zone-wide. Any user with access to the zone can create a VM with access to that network. These zone-wide networks provide little or no isolation between guests.Networks that are assigned to a specific account provide strong isolation.</para>
<xi:include href="add-additional-guest-network.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="add-remove-nic-ui.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="change-network-offering-on-guest-network.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</section>

View File

@ -25,6 +25,7 @@ import java.util.Map;
import javax.inject.Inject;
import com.cloud.storage.VolumeManager;
import org.apache.cloudstack.engine.cloud.entity.api.NetworkEntity;
import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
import org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntity;
@ -87,6 +88,9 @@ public class CloudOrchestrator implements OrchestrationService {
@Inject
protected AccountDao _accountDao = null;
@Inject
VolumeManager _volumeMgr;
public CloudOrchestrator() {
}
@ -200,6 +204,7 @@ public class CloudOrchestrator implements OrchestrationService {
"Disk offering " + diskOffering
+ " requires size parameter.");
}
_volumeMgr.validateVolumeSizeRange(size * 1024 * 1024 * 1024);
}
dataDiskOfferings.add(new Pair<DiskOfferingVO, Long>(diskOffering, size));
}
@ -246,7 +251,8 @@ public class CloudOrchestrator implements OrchestrationService {
throw new InvalidParameterValueException("Disk offering "
+ diskOffering + " requires size parameter.");
}
}
_volumeMgr.validateVolumeSizeRange(size * 1024 * 1024 * 1024);
}
rootDiskOffering.first(diskOffering);
rootDiskOffering.second(size);

View File

@ -116,11 +116,27 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
private static final String LIST_CAPACITY_GROUP_BY_CLUSTER_TYPE_PART2 = " GROUP BY cluster_id, capacity_type order by percent desc limit ";
private static final String UPDATE_CAPACITY_STATE = "UPDATE `cloud`.`op_host_capacity` SET capacity_state = ? WHERE ";
/* In the below query"LIST_CLUSTERS_CROSSING_THRESHOLD" the threshold value is getting from the cluster_details table if not present then it gets from the global configuration
*
* CASE statement works like
* if (cluster_details table has thershold value)
* then
* if (value from the cluster_details table is not null)
* then
* query from the cluster_details table
* else
* query from the configuration table
* else
* query from the configuration table
*
* */
private static final String LIST_CLUSTERS_CROSSING_THRESHOLD = "SELECT clusterList.cluster_id " +
"FROM ( SELECT cluster.cluster_id cluster_id, ( (sum(cluster.used) + sum(cluster.reserved) + ?)/sum(cluster.total) ) ratio, cluster.configValue value " +
"FROM ( SELECT capacity.cluster_id cluster_id, capacity.used_capacity used, capacity.reserved_capacity reserved, capacity.total_capacity total, " +
"CASE (SELECT count(*) FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) " +
"WHEN 1 THEN ( SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) " +
"WHEN 1 THEN ( CASE WHEN (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ?) is NULL " +
"THEN (SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?)" +
"ELSE (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) END )" +
"ELSE ( SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?) " +
"END configValue " +
"FROM `cloud`.`op_host_capacity` capacity " +
@ -168,8 +184,10 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
pstmt.setString(2, configName);
pstmt.setString(3, configName);
pstmt.setString(4, configName);
pstmt.setLong(5,zoneId);
pstmt.setShort(6,capacityType);
pstmt.setString(5, configName);
pstmt.setString(6, configName);
pstmt.setLong(7,zoneId);
pstmt.setShort(8,capacityType);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {

View File

@ -155,6 +155,7 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
address.setAssociatedWithNetworkId(null);
address.setVpcId(null);
address.setSystem(false);
address.setVmIp(null);
update(ipAddressId, address);
}

View File

@ -43,5 +43,5 @@ public interface PortForwardingRulesDao extends GenericDao<PortForwardingRuleVO,
List<PortForwardingRuleVO> listByAccount(long accountId);
List<PortForwardingRuleVO> listByDestIpAddr(String ip4Address);
PortForwardingRuleVO findByIdAndIp(long id, String secondaryIp);
}

View File

@ -158,5 +158,12 @@ public class PortForwardingRulesDaoImpl extends GenericDaoBase<PortForwardingRul
sc.setParameters("dstIp", ip4Address);
return listBy(sc);
}
@Override
public PortForwardingRuleVO findByIdAndIp(long id, String secondaryIp) {
SearchCriteria<PortForwardingRuleVO> sc = AllFieldsSearch.create();
sc.setParameters("id", id);
sc.setParameters("dstIp", secondaryIp);
return findOneBy(sc);
}
}

View File

@ -62,7 +62,6 @@ public class SnapshotPolicyDaoImpl extends GenericDaoBase<SnapshotPolicyVO, Long
public List<SnapshotPolicyVO> listByVolumeId(long volumeId, Filter filter) {
SearchCriteria<SnapshotPolicyVO> sc = VolumeIdSearch.create();
sc.setParameters("volumeId", volumeId);
sc.setParameters("active", true);
return listBy(sc, filter);
}

View File

@ -105,6 +105,7 @@ public class Upgrade410to420 implements DbUpgrade {
//First drop if it exists. (Due to patches shipped to customers some will have the index and some wont.)
List<String> indexList = new ArrayList<String>();
s_logger.debug("Dropping index i_alert__last_sent if it exists");
indexList.add("last_sent"); // in 4.1, we created this index that is not in convention.
indexList.add("i_alert__last_sent");
DbUpgradeUtils.dropKeysIfExist(conn, "alert", indexList, false);

View File

@ -38,6 +38,7 @@ public interface UsageDao extends GenericDao<UsageVO, Long> {
Long getLastUserStatsId();
List<Long> listPublicTemplatesByAccount(long accountId);
Long getLastVmDiskStatsId();
void updateVmDiskStats(List<VmDiskStatisticsVO> vmNetStats);
void saveVmDiskStats(List<VmDiskStatisticsVO> vmNetStats);
void updateVmDiskStats(List<VmDiskStatisticsVO> vmDiskStats);
void saveVmDiskStats(List<VmDiskStatisticsVO> vmDiskStats);
void saveUsageRecords(List<UsageVO> usageRecords);
}

View File

@ -18,6 +18,7 @@ package com.cloud.usage.dao;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Date;
@ -63,6 +64,8 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
" VALUES (?,?,?,?,?,?,?,?,?,?, ?, ?, ?, ?,?, ?, ?)";
private static final String UPDATE_VM_DISK_STATS = "UPDATE cloud_usage.vm_disk_statistics SET net_io_read=?, net_io_write=?, current_io_read=?, current_io_write=?, agg_io_read=?, agg_io_write=?, " +
"net_bytes_read=?, net_bytes_write=?, current_bytes_read=?, current_bytes_write=?, agg_bytes_read=?, agg_bytes_write=? WHERE id=?";
private static final String INSERT_USGAE_RECORDS = "INSERT INTO cloud_usage.cloud_usage (zone_id, account_id, domain_id, description, usage_display, usage_type, raw_usage, vm_instance_id, vm_name, offering_id, template_id, " +
"usage_id, type, size, network_id, start_date, end_date) VALUES (?,?,?,?,?,?,?,?,?, ?, ?, ?,?,?,?,?,?)";
protected final static TimeZone s_gmtTimeZone = TimeZone.getTimeZone("GMT");
@ -375,4 +378,65 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
}
}
@Override
public void saveUsageRecords(List<UsageVO> usageRecords) {
Transaction txn = Transaction.currentTxn();
try {
txn.start();
String sql = INSERT_USGAE_RECORDS;
PreparedStatement pstmt = null;
pstmt = txn.prepareAutoCloseStatement(sql); // in reality I just want CLOUD_USAGE dataSource connection
for (UsageVO usageRecord : usageRecords) {
pstmt.setLong(1, usageRecord.getZoneId());
pstmt.setLong(2, usageRecord.getAccountId());
pstmt.setLong(3, usageRecord.getDomainId());
pstmt.setString(4, usageRecord.getDescription());
pstmt.setString(5, usageRecord.getUsageDisplay());
pstmt.setInt(6, usageRecord.getUsageType());
pstmt.setDouble(7, usageRecord.getRawUsage());
if(usageRecord.getVmInstanceId() != null){
pstmt.setLong(8, usageRecord.getVmInstanceId());
} else {
pstmt.setNull(8, Types.BIGINT);
}
pstmt.setString(9, usageRecord.getVmName());
if(usageRecord.getOfferingId() != null){
pstmt.setLong(10, usageRecord.getOfferingId());
} else {
pstmt.setNull(10, Types.BIGINT);
}
if(usageRecord.getTemplateId() != null){
pstmt.setLong(11, usageRecord.getTemplateId());
} else {
pstmt.setNull(11, Types.BIGINT);
}
if(usageRecord.getUsageId() != null){
pstmt.setLong(12, usageRecord.getUsageId());
} else {
pstmt.setNull(12, Types.BIGINT);
}
pstmt.setString(13, usageRecord.getType());
if(usageRecord.getSize() != null){
pstmt.setLong(14, usageRecord.getSize());
} else {
pstmt.setNull(14, Types.BIGINT);
}
if(usageRecord.getNetworkId() != null){
pstmt.setLong(15, usageRecord.getNetworkId());
} else {
pstmt.setNull(15, Types.BIGINT);
}
pstmt.setTimestamp(16, new Timestamp(usageRecord.getStartDate().getTime()));
pstmt.setTimestamp(17, new Timestamp(usageRecord.getEndDate().getTime()));
pstmt.addBatch();
}
pstmt.executeBatch();
txn.commit();
} catch (Exception ex) {
txn.rollback();
s_logger.error("error saving usage records to cloud_usage db", ex);
throw new CloudRuntimeException(ex.getMessage());
}
}
}

View File

@ -3231,7 +3231,9 @@ ServerResource {
ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0);
devices.addDevice(console);
GraphicDef grap = new GraphicDef("vnc", (short) 0, true, null, null,
//add the VNC port passwd here, get the passwd from the vmInstance.
String passwd = vmTO.getVncPassword();
GraphicDef grap = new GraphicDef("vnc", (short) 0, true, null, passwd,
null);
devices.addDevice(grap);

View File

@ -73,7 +73,7 @@ public class LibvirtStorageVolumeDef {
storageVolBuilder.append("<name>" + _volName + "</name>\n");
if (_volSize != null) {
storageVolBuilder
.append("<capacity >" + _volSize + "</capacity>\n");
.append("<capacity>" + _volSize + "</capacity>\n");
}
storageVolBuilder.append("<target>\n");
storageVolBuilder.append("<format type='" + _volFormat + "'/>\n");

View File

@ -951,7 +951,7 @@ public class LibvirtVMDef {
if (_listenAddr != null) {
graphicBuilder.append(" listen='" + _listenAddr + "'");
} else {
graphicBuilder.append(" listen='' ");
graphicBuilder.append(" listen=''");
}
if (_passwd != null) {
graphicBuilder.append(" passwd='" + _passwd + "'");

View File

@ -80,7 +80,7 @@ public class LibvirtComputingResourceTest {
vmStr += "<serial type='pty'>\n";
vmStr += "<target port='0'/>\n";
vmStr += "</serial>\n";
vmStr += "<graphics type='vnc' autoport='yes' listen='" + vncAddr + "' />\n";
vmStr += "<graphics type='vnc' autoport='yes' listen='" + vncAddr + "' passwd='" + vncPassword + "'/>\n";
vmStr += "<console type='pty'>\n";
vmStr += "<target port='0'/>\n";
vmStr += "</console>\n";
@ -156,7 +156,7 @@ public class LibvirtComputingResourceTest {
vmStr += "<serial type='pty'>\n";
vmStr += "<target port='0'/>\n";
vmStr += "</serial>\n";
vmStr += "<graphics type='vnc' autoport='yes' listen='" + vncAddr + "' />\n";
vmStr += "<graphics type='vnc' autoport='yes' listen='" + vncAddr + "' passwd='" + vncPassword + "'/>\n";
vmStr += "<console type='pty'>\n";
vmStr += "<target port='0'/>\n";
vmStr += "</console>\n";

View File

@ -832,7 +832,53 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
return new SetFirewallRulesAnswer(cmd, true, results);
}
protected SetStaticNatRulesAnswer SetVPCStaticNatRules(SetStaticNatRulesCommand cmd) {
if (s_logger.isInfoEnabled()) {
s_logger.info("Executing resource SetVPCStaticNatRulesCommand: " + _gson.toJson(cmd));
}
String[] results = new String[cmd.getRules().length];
VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
String controlIp = getRouterSshControlIp(cmd);
int i = 0;
boolean endResult = true;
for (StaticNatRuleTO rule : cmd.getRules()) {
// Prepare command to be send to VPC VR
String args = "";
args += rule.revoked() ? " -D" : " -A";
args += " -l " + rule.getSrcIp();
args += " -r " + rule.getDstIp();
// Invoke command on VPC VR.
try {
Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, "/opt/cloud/bin/vpc_staticnat.sh " + args);
if (s_logger.isDebugEnabled())
s_logger.debug("Executing script on domain router " + controlIp + ": /opt/cloud/bin/vpc_staticnat.sh " + args);
if (!result.first()) {
s_logger.error("SetVPCStaticNatRulesCommand failure on setting one rule. args: " + args);
results[i++] = "Failed";
endResult = false;
} else {
results[i++] = null;
}
} catch (Throwable e) {
s_logger.error("SetVPCStaticNatRulesCommand (args: " + args + ") failed on setting one rule due to " + VmwareHelper.getExceptionMessage(e), e);
results[i++] = "Failed";
endResult = false;
}
}
return new SetStaticNatRulesAnswer(cmd, results, endResult);
}
protected Answer execute(SetStaticNatRulesCommand cmd) {
if (cmd.getVpcId() != null) {
return SetVPCStaticNatRules(cmd);
}
if (s_logger.isInfoEnabled()) {
s_logger.info("Executing resource SetFirewallRuleCommand: " + _gson.toJson(cmd));
}
@ -1236,9 +1282,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
if (!result.first()) {
String msg = "SetNetworkACLAnswer on domain router " + routerIp + " failed. message: " + result.second();
s_logger.error(msg);
return new SetNetworkACLAnswer(cmd, false, results);
}
return new SetNetworkACLAnswer(cmd, false, results);
} else {
args="";
args += " -d " + "eth" + ethDeviceNum;
@ -1283,7 +1328,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
args += rule.revoked() ? " -D" : " -A";
args += " -P " + rule.getProtocol().toLowerCase();
args += " -l " + rule.getSrcIp();
args += " -p " + rule.getStringSrcPortRange().replace(":", "-");
args += " -p " + rule.getStringSrcPortRange();
args += " -r " + rule.getDstIp();
args += " -d " + rule.getStringDstPortRange().replace(":", "-");
@ -2313,9 +2358,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
VmwareHypervisorHost hyperHost = getHyperHost(context);
VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName());
VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
int ramMb = (int) (vmSpec.getMinRam());
int ramMb = (int) (vmSpec.getMinRam()/(1024 * 1024));
VmwareHelper.setVmScaleUpConfig(vmConfigSpec, vmSpec.getCpus(), vmSpec.getSpeed(), vmSpec.getSpeed(),(int) (vmSpec.getMaxRam()), ramMb, vmSpec.getLimitCpuUse());
VmwareHelper.setVmScaleUpConfig(vmConfigSpec, vmSpec.getCpus(), vmSpec.getMaxSpeed(), vmSpec.getMinSpeed(),(int) (vmSpec.getMaxRam()/(1024 * 1024)), ramMb, vmSpec.getLimitCpuUse());
if(!vmMo.configureVm(vmConfigSpec)) {
throw new Exception("Unable to execute ScaleVmCommand");
@ -3486,7 +3531,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
tgtHyperHost = new HostMO(getServiceContext(), morTgtHost);
morDc = srcHyperHost.getHyperHostDatacenter();
morDcOfTargetHost = tgtHyperHost.getHyperHostDatacenter();
if (morDc != morDcOfTargetHost) {
if (!morDc.getValue().equalsIgnoreCase(morDcOfTargetHost.getValue())) {
String msg = "Source host & target host are in different datacentesr";
throw new CloudRuntimeException(msg);
}

View File

@ -68,10 +68,11 @@ public class VmwareResourceTest {
when(_resource.getHyperHost(context, null)).thenReturn(hyperHost);
doReturn("i-2-3-VM").when(cmd).getVmName();
when(hyperHost.findVmOnHyperHost("i-2-3-VM")).thenReturn(vmMo);
doReturn(1024L).when(vmSpec).getMinRam();
doReturn(536870912L).when(vmSpec).getMinRam();
doReturn(1).when(vmSpec).getCpus();
doReturn(1000).when(vmSpec).getSpeed();
doReturn(1024L).when(vmSpec).getMaxRam();
doReturn(1000).when(vmSpec).getMinSpeed();
doReturn(1000).when(vmSpec).getMaxSpeed();
doReturn(536870912L).when(vmSpec).getMaxRam();
doReturn(false).when(vmSpec).getLimitCpuUse();
when(vmMo.configureVm(vmConfigSpec)).thenReturn(true);

View File

@ -445,6 +445,10 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
return new XenServer602Resource();
else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.0"))
return new XenServer610Resource();
else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.83"))
return new XenServer610Resource();
else if (prodBrand.equals("XenServer") && prodVersion.equals("6.2.0"))
return new XenServer610Resource();
else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) {
String prodVersionTextShort = record.softwareVersion.get("product_version_text_short").trim();
if ("5.6 SP2".equals(prodVersionTextShort)) {
@ -453,11 +457,11 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
return new XenServer56FP1Resource();
}
} else if (prodBrand.equals("XCP_Kronos")) {
return new XcpOssResource();
}
String msg = "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6, XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2, 6.1.0 but this one is " + prodBrand + " " + prodVersion;
_alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, msg, msg);
return new XcpOssResource();
}
String msg = "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6, XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2, 6.1.0, 6.1.83, 6.2.0 but this one is " + prodBrand + " " + prodVersion;
_alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, msg, msg);
s_logger.debug(msg);
throw new RuntimeException(msg);
@ -596,6 +600,10 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
resource = XenServer602Resource.class.getName();
} else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.0")) {
resource = XenServer610Resource.class.getName();
} else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.83")) {
resource = XenServer610Resource.class.getName();
} else if (prodBrand.equals("XenServer") && prodVersion.equals("6.2.0")) {
resource = XenServer610Resource.class.getName();
} else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) {
String prodVersionTextShort = details.get("product_version_text_short").trim();
if ("5.6 SP2".equals(prodVersionTextShort)) {
@ -608,7 +616,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
}
if( resource == null ){
String msg = "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6, 5.6 FP1, 5.6 SP2 and Xenserver 6.0 , 6.0.2, 6.1.0 but this one is " + prodBrand + " " + prodVersion;
String msg = "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6, 5.6 FP1, 5.6 SP2 and Xenserver 6.0 , 6.0.2, 6.1.0, 6.1.83, 6.2.0 but this one is " + prodBrand + " " + prodVersion;
s_logger.debug(msg);
throw new RuntimeException(msg);
}

View File

@ -687,16 +687,16 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
Long staticMemoryMax = vm.getMemoryStaticMax(conn);
Long staticMemoryMin = vm.getMemoryStaticMin(conn);
Long newDynamicMemoryMin = vmSpec.getMinRam() * 1024 * 1024;
Long newDynamicMemoryMax = vmSpec.getMaxRam() * 1024 * 1024;
Long newDynamicMemoryMin = vmSpec.getMinRam();
Long newDynamicMemoryMax = vmSpec.getMaxRam();
if (staticMemoryMin > newDynamicMemoryMin || newDynamicMemoryMax > staticMemoryMax) {
throw new CloudRuntimeException("Cannot scale up the vm because of memory constraint violation: 0 <= memory-static-min <= memory-dynamic-min <= memory-dynamic-max <= memory-static-max ");
}
vm.setMemoryDynamicRange(conn, vmSpec.getMinRam() * 1024 * 1024, vmSpec.getMaxRam() * 1024 * 1024);
vm.setMemoryDynamicRange(conn, newDynamicMemoryMin, newDynamicMemoryMax);
vm.setVCPUsNumberLive(conn, (long)vmSpec.getCpus());
Integer speed = vmSpec.getSpeed();
Integer speed = vmSpec.getMinSpeed();
if (speed != null) {
int cpuWeight = _maxWeight; //cpu_weight

View File

@ -113,10 +113,14 @@ public class CitrixResourceBaseTest {
@Test
public void testScaleVMF2() throws Types.XenAPIException, XmlRpcException {
when(vm.getMemoryStaticMax(conn)).thenReturn(1073741824L);
when(vm.getMemoryStaticMin(conn)).thenReturn(268435456L);
doReturn(536870912L).when(vmSpec).getMinRam();
doReturn(536870912L).when(vmSpec).getMaxRam();
doNothing().when(vm).setMemoryDynamicRange(conn, 536870912L, 536870912L);
doReturn(1).when(vmSpec).getCpus();
doNothing().when(vm).setVCPUsNumberLive(conn, 1L);
doReturn(500).when(vmSpec).getSpeed();
doReturn(500).when(vmSpec).getMinSpeed();
doReturn(false).when(vmSpec).getLimitCpuUse();
Map<String, String> args = (Map<String, String>)mock(HashMap.class);
when(host.callPlugin(conn, "vmops", "add_to_VCPUs_params_live", args)).thenReturn("Success");
@ -132,10 +136,14 @@ public class CitrixResourceBaseTest {
@Test
public void testScaleVMF3() throws Types.XenAPIException, XmlRpcException {
when(vm.getMemoryStaticMax(conn)).thenReturn(1073741824L);
when(vm.getMemoryStaticMin(conn)).thenReturn(268435456L);
doReturn(536870912L).when(vmSpec).getMinRam();
doReturn(536870912L).when(vmSpec).getMaxRam();
doNothing().when(vm).setMemoryDynamicRange(conn, 536870912L, 536870912L);
doReturn(1).when(vmSpec).getCpus();
doNothing().when(vm).setVCPUsNumberLive(conn, 1L);
doReturn(500).when(vmSpec).getSpeed();
doReturn(500).when(vmSpec).getMinSpeed();
doReturn(true).when(vmSpec).getLimitCpuUse();
doReturn(null).when(_resource).callHostPlugin(conn, "vmops", "add_to_VCPUs_params_live", "key", "cap", "value", "100", "vmname", "i-2-3-VM");
Map<String, String> args = (Map<String, String>)mock(HashMap.class);

View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# 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.
usage() {
printf "Usage: %s: <domR eth1 ip> <path_to_new_config_file>\n" $(basename $0) >&2
}
set -x
cert="/root/.ssh/id_rsa.cloud"
ssh -p 3922 -q -o StrictHostKeyChecking=no -i $cert root@$1 "/root/dnsmasq.sh $2"
exit $?

View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# 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.
usage() {
printf " %s routerip <alias_count:ip:netmask;alias_count2:ip2:netmask2;....> \n" $(basename $0) >&2
}
set -x
cert="/root/.ssh/id_rsa.cloud"
ssh -p 3922 -q -o StrictHostKeyChecking=no -i $cert root@$1 "/root/createIpAlias.sh $2"

View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# 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.
usage() {
printf " %s routerip <alias_count:ip:netmask;alias_count2:ip2:netmask2;....> \n" $(basename $0) >&2
}
set -x
cert="/root/.ssh/id_rsa.cloud"
ssh -p 3922 -q -o StrictHostKeyChecking=no -i $cert root@$1 "/root/deleteIpAlias.sh $2 $3"

View File

@ -438,6 +438,7 @@ public class ApiResponseHelper implements ResponseGenerator {
if (zone != null) {
snapshotResponse.setZoneName(zone.getName());
snapshotResponse.setZoneType(zone.getNetworkType().toString());
snapshotResponse.setZoneId(zone.getUuid());
}
}
snapshotResponse.setCreated(snapshot.getCreated());
@ -2361,11 +2362,12 @@ public class ApiResponseHelper implements ResponseGenerator {
if (fwRule.getTrafficType() == FirewallRule.TrafficType.Ingress) {
IpAddress ip = ApiDBUtils.findIpAddressById(fwRule.getSourceIpAddressId());
response.setPublicIpAddressId(ip.getId());
response.setPublicIpAddressId(ip.getUuid());
response.setPublicIpAddress(ip.getAddress().addr());
} else if (fwRule.getTrafficType() == FirewallRule.TrafficType.Egress) {
response.setPublicIpAddress(null);
response.setNetworkId(fwRule.getNetworkId());
Network network = ApiDBUtils.findNetworkById(fwRule.getNetworkId());
response.setNetworkId(network.getUuid());
}
FirewallRule.State state = fwRule.getState();
@ -3352,8 +3354,8 @@ public class ApiResponseHelper implements ResponseGenerator {
//Device Type
usageRecResponse.setType(usageRecord.getType());
//VM Instance Id
VMInstanceVO vm = _entityMgr.findByIdIncludingRemoved(VMInstanceVO.class, usageRecord.getUsageId().toString());
usageRecResponse.setUsageId(vm.getUuid());
VMInstanceVO vm = _entityMgr.findByIdIncludingRemoved(VMInstanceVO.class, usageRecord.getVmInstanceId().toString());
usageRecResponse.setVirtualMachineId(vm.getUuid());
//Volume ID
VolumeVO volume = _entityMgr.findByIdIncludingRemoved(VolumeVO.class, usageRecord.getUsageId().toString());
usageRecResponse.setUsageId(volume.getUuid());

File diff suppressed because it is too large Load Diff

View File

@ -28,27 +28,27 @@ import org.springframework.stereotype.Component;
import com.cloud.api.ApiDBUtils;
import com.cloud.api.query.vo.StoragePoolJoinVO;
import com.cloud.capacity.Capacity;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.storage.ScopeType;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StorageStats;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
@Component
@Local(value={StoragePoolJoinDao.class})
@Local(value = { StoragePoolJoinDao.class })
public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Long> implements StoragePoolJoinDao {
public static final Logger s_logger = Logger.getLogger(StoragePoolJoinDaoImpl.class);
@Inject
private ConfigurationDao _configDao;
private ConfigurationDao _configDao;
private final SearchBuilder<StoragePoolJoinVO> spSearch;
private final SearchBuilder<StoragePoolJoinVO> spIdSearch;
protected StoragePoolJoinDaoImpl() {
spSearch = createSearchBuilder();
@ -62,10 +62,6 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
this._count = "select count(distinct id) from storage_pool_view WHERE ";
}
@Override
public StoragePoolResponse newStoragePoolResponse(StoragePoolJoinVO pool) {
StoragePoolResponse poolResponse = new StoragePoolResponse();
@ -88,12 +84,11 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
poolResponse.setHypervisor(pool.getHypervisor().toString());
}
long allocatedSize = pool.getUsedCapacity() + pool.getReservedCapacity();
long allocatedSize = pool.getUsedCapacity() + pool.getReservedCapacity();
poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
poolResponse.setDiskSizeAllocated(allocatedSize);
//TODO: StatsCollector does not persist data
// TODO: StatsCollector does not persist data
StorageStats stats = ApiDBUtils.getStoragePoolStatistics(pool.getId());
if (stats != null) {
Long used = stats.getByteUsed();
@ -118,10 +113,9 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
public StoragePoolResponse setStoragePoolResponse(StoragePoolResponse response, StoragePoolJoinVO sp) {
String tag = sp.getTag();
if (tag != null) {
if ( response.getTags() != null && response.getTags().length() > 0){
if (response.getTags() != null && response.getTags().length() > 0) {
response.setTags(response.getTags() + "," + tag);
}
else{
} else {
response.setTags(tag);
}
}
@ -149,12 +143,13 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
poolResponse.setHypervisor(pool.getHypervisor().toString());
}
long allocatedSize = pool.getUsedCapacity() + pool.getReservedCapacity();
short capacityType = pool.getScope() == ScopeType.HOST ? Capacity.CAPACITY_TYPE_LOCAL_STORAGE
: Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED;
long allocatedSize = ApiDBUtils.getStorageCapacitybyPool(pool.getId(), capacityType);
poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
poolResponse.setDiskSizeAllocated(allocatedSize);
//TODO: StatsCollector does not persist data
// TODO: StatsCollector does not persist data
StorageStats stats = ApiDBUtils.getStoragePoolStatistics(pool.getId());
if (stats != null) {
Long used = stats.getByteUsed();
@ -174,11 +169,10 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
}
@Override
public StoragePoolResponse setStoragePoolForMigrationResponse(StoragePoolResponse response,
StoragePoolJoinVO sp) {
public StoragePoolResponse setStoragePoolForMigrationResponse(StoragePoolResponse response, StoragePoolJoinVO sp) {
String tag = sp.getTag();
if (tag != null) {
if ( response.getTags() != null && response.getTags().length() > 0){
if (response.getTags() != null && response.getTags().length() > 0) {
response.setTags(response.getTags() + "," + tag);
} else {
response.setTags(tag);
@ -195,22 +189,20 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
}
@Override
public List<StoragePoolJoinVO> searchByIds(Long... spIds) {
// set detail batch query size
int DETAILS_BATCH_SIZE = 2000;
String batchCfg = _configDao.getValue("detail.batch.query.size");
if ( batchCfg != null ){
if (batchCfg != null) {
DETAILS_BATCH_SIZE = Integer.parseInt(batchCfg);
}
// query details by batches
List<StoragePoolJoinVO> uvList = new ArrayList<StoragePoolJoinVO>();
// query details by batches
int curr_index = 0;
if ( spIds.length > DETAILS_BATCH_SIZE ){
while ( (curr_index + DETAILS_BATCH_SIZE ) <= spIds.length ) {
if (spIds.length > DETAILS_BATCH_SIZE) {
while ((curr_index + DETAILS_BATCH_SIZE) <= spIds.length) {
Long[] ids = new Long[DETAILS_BATCH_SIZE];
for (int k = 0, j = curr_index; j < curr_index + DETAILS_BATCH_SIZE; j++, k++) {
ids[k] = spIds[j];
@ -241,7 +233,4 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
return uvList;
}
}

View File

@ -88,7 +88,7 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
}
protected <T extends VirtualMachine> VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile<T> vmProfile) {
protected <T extends VirtualMachine> VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile<T> vmProfile) {
ServiceOffering offering = vmProfile.getServiceOffering();
VirtualMachine vm = vmProfile.getVirtualMachine();

View File

@ -770,7 +770,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
@Override
public Nic getNicInNetwork(long vmId, long networkId) {
return _nicDao.findByInstanceIdAndNetworkIdIncludingRemoved(networkId, vmId);
return _nicDao.findByNtwkIdAndInstanceId(networkId, vmId);
}
@Override
@ -1761,7 +1761,8 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
return true;
}
Nic getNicInNetworkIncludingRemoved(long vmId, long networkId) {
@Override
public Nic getNicInNetworkIncludingRemoved(long vmId, long networkId) {
return _nicDao.findByInstanceIdAndNetworkIdIncludingRemoved(networkId, vmId);
}

View File

@ -670,8 +670,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
if (network == null) {
throw new InvalidParameterValueException("Invalid network id is given");
}
accountId = network.getAccountId();
domainId = network.getDomainId();
accountId = ipOwner.getAccountId();
domainId = ipOwner.getDomainId();
// Validate network offering
NetworkOfferingVO ntwkOff = _networkOfferingDao.findById(network.getNetworkOfferingId());
@ -789,10 +789,15 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
if (dc.getNetworkType() == NetworkType.Advanced && network.getGuestType() == Network.GuestType.Isolated) {
//check PF or static NAT is configured on this ip address
String secondaryIp = secIpVO.getIp4Address();
List<PortForwardingRuleVO> pfRuleList = _portForwardingDao.listByDestIpAddr(secondaryIp);
if (pfRuleList.size() != 0) {
s_logger.debug("VM nic IP " + secondaryIp + " is associated with the port forwarding rule");
throw new InvalidParameterValueException("Can't remove the secondary ip " + secondaryIp + " is associate with the port forwarding rule");
List<FirewallRuleVO> fwRulesList = _firewallDao.listByNetworkAndPurpose(network.getId(), Purpose.PortForwarding);
if (fwRulesList.size() != 0) {
for (FirewallRuleVO rule: fwRulesList) {
if (_portForwardingDao.findByIdAndIp(rule.getId(), secondaryIp) != null) {
s_logger.debug("VM nic IP " + secondaryIp + " is associated with the port forwarding rule");
throw new InvalidParameterValueException("Can't remove the secondary ip " + secondaryIp + " is associate with the port forwarding rule");
}
}
}
//check if the secondary ip associated with any static nat rule
IPAddressVO publicIpVO = _ipAddressDao.findByVmIp(secondaryIp);
@ -1197,9 +1202,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
+ Network.GuestType.Isolated + " with a service " + Service.SourceNat.getName() + " enabled");
}
// Don't allow to specify vlan if the caller is a regular user
if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL && (ntwkOff.getSpecifyVlan() || vlanId != null)) {
throw new InvalidParameterValueException("Regular user is not allowed to specify vlanId");
// Don't allow to specify vlan if the caller is not ROOT admin
if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN && (ntwkOff.getSpecifyVlan() || vlanId != null)) {
throw new InvalidParameterValueException("Only ROOT admin is allowed to specify vlanId");
}
if (ipv4) {
@ -2658,7 +2663,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
existingRanges.get(i).second(-1);
}
value = vnetMap.get((existingRanges.get(i).second()));
if (value != null) {
if (value != null && ( (existingRanges.get(i).second()) != (existingRanges.get(i).first()) )) {
vnetMap.remove((existingRanges.get(i).second()));
vnetMap.remove(existingRanges.get(i).first());
vnetMap.put(existingRanges.get(i).first(),value);
@ -2680,9 +2685,10 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
vnetString = vnetString+vnetRange.first().toString()+"-"+value.toString()+";";
}
}
vnetString = vnetString+"*";
vnetString = vnetString.replace(";*","");
network.setVnet(vnetString);
if (vnetString.length() > 0 && vnetString.charAt(vnetString.length()-1)==';') {
vnetString = vnetString.substring(0, vnetString.length()-1);
}
network.setVnet(vnetString);
}
for (Pair<Integer, Integer> vnetToAdd : vnetsToAdd) {
@ -2788,12 +2794,15 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
_datacneter_vnet.deleteRange(txn, network.getDataCenterId(), network.getId(), start, end);
String vnetString="";
for (Pair<Integer,Integer> vnetRange : existingRanges ){
vnetString=vnetString+vnetRange.first().toString()+"-"+vnetRange.second().toString()+";";
if (existingRanges.isEmpty()) {
network.setVnet(null);
} else {
for (Pair<Integer,Integer> vnetRange : existingRanges ) {
vnetString=vnetString+vnetRange.first().toString()+"-"+vnetRange.second().toString()+";";
}
vnetString = vnetString.substring(0, vnetString.length()-1);
network.setVnet(vnetString);
}
vnetString = vnetString+"*";
vnetString = vnetString.replace(";*","");
network.setVnet(vnetString);
_physicalNetworkDao.update(network.getId(), network);
txn.commit();
_physicalNetworkDao.releaseFromLockTable(network.getId());

View File

@ -3145,6 +3145,16 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
vlanIpMap.put(vlanTag, ipList);
}
List<NicVO> nics = _nicDao.listByVmId(router.getId());
String baseMac = null;
for (NicVO nic : nics) {
NetworkVO nw = _networkDao.findById(nic.getNetworkId());
if (nw.getTrafficType() == TrafficType.Public) {
baseMac = nic.getMacAddress();
break;
}
}
for (Map.Entry<String, ArrayList<PublicIpAddress>> vlanAndIp : vlanIpMap.entrySet()) {
List<PublicIpAddress> ipAddrList = vlanAndIp.getValue();
// Source nat ip address should always be sent first
@ -3176,7 +3186,14 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
String vlanId = ipAddr.getVlanTag();
String vlanGateway = ipAddr.getGateway();
String vlanNetmask = ipAddr.getNetmask();
String vifMacAddress = ipAddr.getMacAddress();
String vifMacAddress = null;
// For non-source nat IP, set the mac to be something based on first public nic's MAC
// We cannot depends on first ip because we need to deal with first ip of other nics
if (!ipAddr.isSourceNat() && ipAddr.getVlanId() != 0) {
vifMacAddress = NetUtils.generateMacOnIncrease(baseMac, ipAddr.getVlanId());
} else {
vifMacAddress = ipAddr.getMacAddress();
}
IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, firstIP,
sourceNat, vlanId, vlanGateway, vlanNetmask, vifMacAddress, networkRate, ipAddr.isOneToOneNat());
@ -3337,7 +3354,12 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
// password should be set only on default network element
if (password != null && nic.isDefaultNic()) {
final String encodedPassword = PasswordGenerator.rot13(password);
String encodedPassword = PasswordGenerator.rot13(password);
// We would unset password for BACKUP router in the RvR, to prevent user from accidently reset the
// password again after BACKUP become MASTER
if (router.getIsRedundantRouter() && router.getRedundantState() != RedundantState.MASTER) {
encodedPassword = PasswordGenerator.rot13("saved_password");
}
SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), profile.getVirtualMachine().getHostName());
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId()));
cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(nic.getNetworkId(), router.getId()));

View File

@ -1371,7 +1371,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
// create new static nat rule
// Get nic IP4 address
Nic guestNic = _networkModel.getNicInNetwork(vm.getId(), networkId);
Nic guestNic = _networkModel.getNicInNetworkIncludingRemoved(vm.getId(), networkId);
if (guestNic == null) {
throw new InvalidParameterValueException("Vm doesn't belong to the network with specified id");
}

View File

@ -294,6 +294,10 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
throw new InvalidParameterValueException("Start port can't be bigger than end port");
}
// start port and end port must be null for protocol = 'all'
if ((portStart != null || portEnd != null ) && protocol != null && protocol.equalsIgnoreCase("all"))
throw new InvalidParameterValueException("start port and end port must be null if protocol = 'all'");
if (sourceCidrList != null) {
for (String cidr: sourceCidrList){
if (!NetUtils.isValidCIDR(cidr)){

View File

@ -118,4 +118,6 @@ public interface VolumeManager extends VolumeApiService {
String getVmNameFromVolumeId(long volumeId);
String getStoragePoolOfVolume(long volumeId);
boolean validateVolumeSizeRange(long size);
}

View File

@ -1328,7 +1328,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
return true;
}
private boolean validateVolumeSizeRange(long size) {
@Override
public boolean validateVolumeSizeRange(long size) {
if (size < 0 || (size > 0 && size < (1024 * 1024 * 1024))) {
throw new InvalidParameterValueException(
"Please specify a size of at least 1 Gb.");

View File

@ -187,7 +187,6 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor
dl.setCurrState(vmTemplateStore.getDownloadState());
}
DownloadListener old = null;
synchronized (_listenerTemplateMap) {
old = _listenerTemplateMap.put(vmTemplateStore, dl);

View File

@ -537,7 +537,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
String intervalTypeStr = cmd.getIntervalType();
String zoneType = cmd.getZoneType();
Map<String, String> tags = cmd.getTags();
Long zoneId = cmd.getZoneId();
Account caller = UserContext.current().getCaller();
List<Long> permittedAccounts = new ArrayList<Long>();
@ -565,7 +565,8 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
sb.and("snapshotTypeEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.IN);
sb.and("snapshotTypeNEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.NEQ);
sb.and("dataCenterId", sb.entity().getDataCenterId(), SearchCriteria.Op.EQ);
if (tags != null && !tags.isEmpty()) {
SearchBuilder<ResourceTagVO> tagSearch = _resourceTagDao.createSearchBuilder();
for (int count=0; count < tags.size(); count++) {
@ -607,6 +608,10 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
sc.setJoinParameters("zoneSb", "zoneNetworkType", zoneType);
}
if (zoneId != null) {
sc.setParameters("dataCenterId", zoneId);
}
if (name != null) {
sc.setParameters("name", "%" + name + "%");
}

View File

@ -208,10 +208,6 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu
List<SnapshotScheduleVO> snapshotsToBeExecuted = _snapshotScheduleDao.getSchedulesToExecute(_currentTimestamp);
s_logger.debug("Got " + snapshotsToBeExecuted.size() + " snapshots to be executed at " + displayTime);
// This is done for recurring snapshots, which are executed by the system automatically
// Hence set user id to that of system
long userId = 1;
for (SnapshotScheduleVO snapshotToBeExecuted : snapshotsToBeExecuted) {
SnapshotScheduleVO tmpSnapshotScheduleVO = null;
long snapshotScheId = snapshotToBeExecuted.getId();
@ -236,7 +232,7 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu
tmpSnapshotScheduleVO = _snapshotScheduleDao.acquireInLockTable(snapshotScheId);
Long eventId = ActionEventUtils.onScheduledActionEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM,
Long eventId = ActionEventUtils.onScheduledActionEvent(User.UID_SYSTEM, volume.getAccountId(),
EventTypes.EVENT_SNAPSHOT_CREATE, "creating snapshot for volume Id:" + volumeId, 0);
Map<String, String> params = new HashMap<String, String>();

View File

@ -111,6 +111,7 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
private String _name;
private Boolean _sslCopy = new Boolean(false);
private String _ssvmUrlDomain;
private ScheduledExecutorService _executor = null;
Timer _timer;
@ -330,8 +331,14 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
String scheme = "http";
if (_sslCopy) {
hostname = ipAddress.replace(".", "-");
hostname = hostname + ".realhostip.com";
scheme = "https";
// Code for putting in custom certificates.
if(_ssvmUrlDomain != null && _ssvmUrlDomain.length() > 0){
hostname = hostname + "." + _ssvmUrlDomain;
}else{
hostname = hostname + ".realhostip.com";
}
}
return scheme + "://" + hostname + "/userdata/" + uuid;
}
@ -350,6 +357,8 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
s_logger.warn("Only realhostip.com ssl cert is supported, ignoring self-signed and other certs");
}
_ssvmUrlDomain = configs.get("secstorage.ssl.cert.domain");
_agentMgr.registerForHostEvents(new UploadListener(this), true, false, false);
String cleanupInterval = configs.get("extract.url.cleanup.interval");
_cleanupInterval = NumbersUtil.parseInt(cleanupInterval, 7200);

View File

@ -3398,6 +3398,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
@Override
public void collectVmDiskStatistics (UserVmVO userVm) {
// support KVM and XenServer only
if (!userVm.getHypervisorType().equals(HypervisorType.XenServer)
&& !userVm.getHypervisorType().equals(HypervisorType.KVM))
return;
// Collect vm disk statistics from host before stopping Vm
long hostId = userVm.getHostId();
List<String> vmNames = new ArrayList<String>();

View File

@ -129,6 +129,7 @@ import com.cloud.network.rules.RulesManager;
import com.cloud.offering.ServiceOffering;
import com.cloud.org.Cluster;
import com.cloud.resource.ResourceManager;
import com.cloud.server.ConfigurationServer;
import com.cloud.service.ServiceOfferingVO;
import com.cloud.service.dao.ServiceOfferingDao;
import com.cloud.storage.DiskOfferingVO;
@ -256,6 +257,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
protected RulesManager rulesMgr;
@Inject
protected AffinityGroupVMMapDao _affinityGroupVMMapDao;
@Inject
protected ConfigurationServer _configServer;
protected List<DeploymentPlanner> _planners;
public List<DeploymentPlanner> getPlanners() {
@ -3226,8 +3229,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
long newServiceofferingId = vm.getServiceOfferingId();
ServiceOffering newServiceOffering = _configMgr.getServiceOffering(newServiceofferingId);
HostVO hostVo = _hostDao.findById(vm.hostId);
Float memoryOvercommitRatio = Float.parseFloat(_configServer.getConfigValue(Config.MemOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(), hostVo.getClusterId()));
Float cpuOvercommitRatio = Float.parseFloat(_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(), hostVo.getClusterId()));
long minMemory = (long) (newServiceOffering.getRamSize()/memoryOvercommitRatio);
ScaleVmCommand reconfigureCmd = new ScaleVmCommand(vm.getInstanceName(), newServiceOffering.getCpu(),
newServiceOffering.getSpeed(), newServiceOffering.getRamSize(), newServiceOffering.getRamSize(), newServiceOffering.getLimitCpuUse());
(int) (newServiceOffering.getSpeed()/cpuOvercommitRatio), newServiceOffering.getSpeed(), minMemory * 1024 * 1024, newServiceOffering.getRamSize() * 1024 * 1024, newServiceOffering.getLimitCpuUse());
Long dstHostId = vm.getHostId();
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());

View File

@ -19,6 +19,7 @@ package com.cloud.configuration;
import com.cloud.dc.VlanVO;
import com.cloud.network.Network;
import com.cloud.network.NetworkModel;
import com.cloud.utils.Pair;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@ -49,20 +50,20 @@ public class ValidateIpRangeTest {
@Test
public void SameSubnetTest() {
boolean sameSubnet=configurationMgr.validateIpRange("10.147.33.104", "10.147.33.105", "10.147.33.1", "255.255.255.128", vlanVOList, true, false, null, null, null, null,network);
Assert.assertTrue(sameSubnet);
Pair<Boolean,Pair<String,String>> sameSubnet = configurationMgr.validateIpRange("10.147.33.104", "10.147.33.105", "10.147.33.1", "255.255.255.128", vlanVOList, true, false, null, null, null, null,network);
Assert.assertTrue(sameSubnet.first());
}
@Test
public void NewSubnetTest() {
boolean sameSubnet= configurationMgr.validateIpRange("10.147.33.140", "10.147.33.145", "10.147.33.129", "255.255.255.191", vlanVOList, true, false, null, null, null, null,network);
Assert.assertTrue(!sameSubnet);
Pair<Boolean,Pair<String,String>> sameSubnet = configurationMgr.validateIpRange("10.147.33.140", "10.147.33.145", "10.147.33.130", "255.255.255.192", vlanVOList, true, false, null, null, null, null,network);
Assert.assertTrue(!sameSubnet.first());
}
@Test
public void SuperSetTest() {
try {
configurationMgr.validateIpRange("10.147.33.140", "10.147.33.143", "10.147.33.140", "255.255.255.191", vlanVOList, true, false, null, null, null, null,network);
configurationMgr.validateIpRange("10.147.33.10", "10.147.33.20", "10.147.33.21", "255.255.255.0", vlanVOList, true, false, null, null, null, null,network);
} catch (Exception e) {
junit.framework.Assert.assertTrue(e.getMessage().contains("superset"));
}

View File

@ -874,4 +874,9 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
// TODO Auto-generated method stub
return null;
}
@Override
public Nic getNicInNetworkIncludingRemoved(long vmId, long networkId) {
return null;
}
}

View File

@ -22,11 +22,13 @@ import com.cloud.agent.api.Answer;
import com.cloud.agent.api.ScaleVmAnswer;
import com.cloud.agent.api.ScaleVmCommand;
import com.cloud.capacity.CapacityManager;
import com.cloud.configuration.Config;
import com.cloud.configuration.ConfigurationManager;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.deploy.DeployDestination;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.server.ConfigurationServer;
import com.cloud.service.ServiceOfferingVO;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.VolumeManager;
@ -154,6 +156,10 @@ public class VirtualMachineManagerImplTest {
List<VolumeVO> _rootVols;
@Mock
ItWorkVO _work;
@Mock
ConfigurationServer _configServer;
@Mock
HostVO hostVO;
@Mock ClusterDao _clusterDao;
@Mock HostPodDao _podDao;
@ -199,6 +205,7 @@ public class VirtualMachineManagerImplTest {
_vmMgr._hvGuruMgr = _hvGuruMgr;
_vmMgr._vmSnapshotMgr = _vmSnapshotMgr;
_vmMgr._vmDao = _vmInstanceDao;
_vmMgr._configServer = _configServer;
when(_vmMock.getId()).thenReturn(314l);
when(_vmInstance.getId()).thenReturn(1L);
@ -239,8 +246,12 @@ public class VirtualMachineManagerImplTest {
when(_vmInstanceDao.findById(anyLong())).thenReturn(_vmInstance);
ServiceOfferingVO newServiceOffering = getSvcoffering(512);
when(_hostDao.findById(_vmInstance.hostId)).thenReturn(hostVO);
doReturn(1L).when(hostVO).getClusterId();
when(_configServer.getConfigValue(Config.MemOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(), 1L)).thenReturn("1.0");
when(_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(), 1L)).thenReturn("1.0");
ScaleVmCommand reconfigureCmd = new ScaleVmCommand("myVmName", newServiceOffering.getCpu(),
newServiceOffering.getSpeed(), newServiceOffering.getRamSize(), newServiceOffering.getRamSize(), newServiceOffering.getLimitCpuUse());
newServiceOffering.getSpeed(), newServiceOffering.getSpeed(), newServiceOffering.getRamSize(), newServiceOffering.getRamSize(), newServiceOffering.getLimitCpuUse());
Answer answer = new ScaleVmAnswer(reconfigureCmd, true, "details");
when(_agentMgr.send(2l, reconfigureCmd)).thenReturn(null);
_vmMgr.reConfigureVm(_vmInstance, getSvcoffering(256), false);

View File

@ -887,4 +887,9 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
return null;
}
@Override
public Nic getNicInNetworkIncludingRemoved(long vmId, long networkId) {
return null;
}
}

View File

@ -146,6 +146,17 @@ X11_KEY_TILDE = 0x7e; // ~
X11_KEY_CIRCUMFLEX_ACCENT = 0x5e; // ^
X11_KEY_YEN_MARK = 0xa5; // Japanese YEN mark
X11_KEY_ASTERISK = 0x2a;
X11_KEY_KP_0 = 0xFFB0;
X11_KEY_KP_1 = 0xFFB1;
X11_KEY_KP_2 = 0xFFB2;
X11_KEY_KP_3 = 0xFFB3;
X11_KEY_KP_4 = 0xFFB4;
X11_KEY_KP_5 = 0xFFB5;
X11_KEY_KP_6 = 0xFFB6;
X11_KEY_KP_7 = 0xFFB7;
X11_KEY_KP_8 = 0xFFB8;
X11_KEY_KP_9 = 0xFFB9;
X11_KEY_KP_Decimal = 0xFFAE;
KEY_DOWN = 5;
KEY_UP = 6;
@ -248,17 +259,17 @@ var keyboardTables = [
{keycode: JS_KEY_FORWARD_SLASH, entry : X11_KEY_FORWARD_SLASH},
{keycode: JS_KEY_DASH, entry : X11_KEY_DASH},
{keycode: JS_KEY_SEMI_COLON, entry : X11_KEY_SEMI_COLON},
{keycode: JS_KEY_NUMPAD0, entry : X11_KEY_NUMPAD0},
{keycode: JS_KEY_NUMPAD1, entry : X11_KEY_NUMPAD1},
{keycode: JS_KEY_NUMPAD2, entry : X11_KEY_NUMPAD2},
{keycode: JS_KEY_NUMPAD3, entry : X11_KEY_NUMPAD3},
{keycode: JS_KEY_NUMPAD4, entry : X11_KEY_NUMPAD4},
{keycode: JS_KEY_NUMPAD5, entry : X11_KEY_NUMPAD5},
{keycode: JS_KEY_NUMPAD6, entry : X11_KEY_NUMPAD6},
{keycode: JS_KEY_NUMPAD7, entry : X11_KEY_NUMPAD7},
{keycode: JS_KEY_NUMPAD8, entry : X11_KEY_NUMPAD8},
{keycode: JS_KEY_NUMPAD9, entry : X11_KEY_NUMPAD9},
{keycode: JS_KEY_DECIMAL_POINT, entry : X11_KEY_DECIMAL_POINT},
{keycode: JS_KEY_NUMPAD0, entry : X11_KEY_KP_0},
{keycode: JS_KEY_NUMPAD1, entry : X11_KEY_KP_1},
{keycode: JS_KEY_NUMPAD2, entry : X11_KEY_KP_2},
{keycode: JS_KEY_NUMPAD3, entry : X11_KEY_KP_3},
{keycode: JS_KEY_NUMPAD4, entry : X11_KEY_KP_4},
{keycode: JS_KEY_NUMPAD5, entry : X11_KEY_KP_5},
{keycode: JS_KEY_NUMPAD6, entry : X11_KEY_KP_6},
{keycode: JS_KEY_NUMPAD7, entry : X11_KEY_KP_7},
{keycode: JS_KEY_NUMPAD8, entry : X11_KEY_KP_8},
{keycode: JS_KEY_NUMPAD9, entry : X11_KEY_KP_9},
{keycode: JS_KEY_DECIMAL_POINT, entry : X11_KEY_KP_Decimal},
{keycode: JS_KEY_DIVIDE, entry : 0xffaf},
{keycode: JS_KEY_MULTIPLY, entry : 0xffaa},
{keycode: JS_KEY_ADD, entry : 0xffab},
@ -289,9 +300,12 @@ var keyboardTables = [
]
}
}, {tindex: 2, keyboardType: KEYBOARD_TYPE_UK, mappingTable:
{X11: [],
keyPress: [
//[34 = "]
{X11: [
//[223 = `¬¦]
{keycode: 223, entry : 0x60, browser: "IE"},
],
keyPress: [
//[34 = "]
{keycode: 34, entry:
[{type : KEY_DOWN, code : 0x40, modifiers : 64, shift : true}]
},

View File

@ -253,7 +253,8 @@ public abstract class ConsoleProxyClientBase implements ConsoleProxyClient, Cons
if(s_logger.isTraceEnabled())
s_logger.trace("Ajax client start, frame buffer w: " + width + ", " + height);
/*
int retry = 0;
tracker.initCoverageTest();
while(!tracker.hasFullCoverage() && retry < 10) {
@ -263,6 +264,7 @@ public abstract class ConsoleProxyClientBase implements ConsoleProxyClient, Cons
}
retry++;
}
*/
List<TileInfo> tiles = tracker.scan(true);
String imgUrl = prepareAjaxImage(tiles, true);

View File

@ -64,6 +64,7 @@ public class ConsoleProxyGCThread extends Thread {
public void run() {
boolean bReportLoad = false;
long lastReportTick = System.currentTimeMillis();
while (true) {
cleanupLogging();
bReportLoad = false;
@ -95,10 +96,12 @@ public class ConsoleProxyGCThread extends Thread {
client.closeClient();
}
if(bReportLoad) {
if(bReportLoad || System.currentTimeMillis() - lastReportTick > 5000) {
// report load changes
String loadInfo = new ConsoleProxyClientStatsCollector(connMap).getStatsReport();
ConsoleProxy.reportLoadInfo(loadInfo);
lastReportTick = System.currentTimeMillis();
if(s_logger.isDebugEnabled())
s_logger.debug("Report load change : " + loadInfo);
}

View File

@ -46,7 +46,7 @@ public class ConsoleProxyVncClient extends ConsoleProxyClientBase {
private VncClient client;
private Thread worker;
private boolean workerDone = false;
private volatile boolean workerDone = false;
private int lastModifierStates = 0;
private int lastPointerMask = 0;
@ -80,7 +80,7 @@ public class ConsoleProxyVncClient extends ConsoleProxyClientBase {
String tunnelUrl = getClientParam().getClientTunnelUrl();
String tunnelSession = getClientParam().getClientTunnelSession();
for(int i = 0; i < 15; i++) {
for(int i = 0; i < 15 && !workerDone; i++) {
try {
if(tunnelUrl != null && !tunnelUrl.isEmpty() && tunnelSession != null && !tunnelSession.isEmpty()) {
URI uri = new URI(tunnelUrl);
@ -136,6 +136,7 @@ public class ConsoleProxyVncClient extends ConsoleProxyClientBase {
@Override
public void closeClient() {
workerDone = true;
if(client != null)
client.shutdown();
}

View File

@ -77,8 +77,10 @@ public class VncClientPacketSender implements Runnable, PaintNotificationListene
s_logger.error("Unexpected exception: ", e);
if (connectionAlive) {
closeConnection();
vncConnection.shutdown();
}
} finally {
s_logger.info("Sending thread exit processing, shutdown connection");
vncConnection.shutdown();
}
}

View File

@ -90,8 +90,10 @@ public class VncServerPacketReceiver implements Runnable {
s_logger.error("Unexpected exception: ", e);
if (connectionAlive) {
closeConnection();
vncConnection.shutdown();
}
} finally {
s_logger.info("Receiving thread exit processing, shutdown connection");
vncConnection.shutdown();
}
}

View File

@ -665,6 +665,7 @@ ALTER TABLE `cloud`.`dc_storage_network_ip_range` ADD COLUMN `gateway` varchar(1
ALTER TABLE `cloud`.`volumes` ADD COLUMN `last_pool_id` bigint unsigned;
UPDATE `cloud`.`volumes` SET `last_pool_id` = `pool_id`;
UPDATE `cloud`.`volumes` SET `path` = SUBSTRING_INDEX(`path`, '/', -1);
UPDATE `cloud`.`template_spool_ref` SET `local_path` = SUBSTRING_INDEX(`local_path`, '/', -1);
ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `is_system` int(1) unsigned NOT NULL default '0';
ALTER TABLE `cloud`.`volumes` ADD COLUMN `update_count` bigint unsigned NOT NULL DEFAULT 0;

View File

@ -99,6 +99,24 @@
"name": "PS1"
}
]
},
{
"clustername": "C1",
"hypervisor": "simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/c1/h0",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://10.147.28.6:/export/home/sandbox/primary2",
"name": "PS2"
}
]
}
],
"gateway": "172.16.15.1"

View File

@ -385,7 +385,6 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
)
return
@unittest.skip("Open Questions")
@attr(tags=["advanced", "basic", "eip", "advancedns", "sg"])
def test_02_remove_all_users(self):
"""Test Remove both users from the account
@ -712,7 +711,6 @@ class TestServiceOfferingSiblings(cloudstackTestCase):
return
@unittest.skip("Open Questions")
class TestServiceOfferingHierarchy(cloudstackTestCase):
@classmethod
@ -841,7 +839,6 @@ class TestServiceOfferingHierarchy(cloudstackTestCase):
return
@unittest.skip("Open Questions")
class TesttemplateHierarchy(cloudstackTestCase):
@classmethod
@ -1441,7 +1438,6 @@ class TestUserDetails(cloudstackTestCase):
)
return
@unittest.skip("Login API response returns nothing")
class TestUserLogin(cloudstackTestCase):
@classmethod

View File

@ -274,7 +274,7 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -308,7 +308,7 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.user_account.account.id,
id=self.user_account.id,
listall=True
)
self.assertEqual(
@ -452,7 +452,7 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -471,7 +471,7 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Domain admin account created: %s" % self.admin_account.account.id)
self.debug("Domain admin account created: %s" % self.admin_account.id)
#Verify that there should be at least one physical network present in zone.
list_physical_networks_response = PhysicalNetwork.list(
@ -599,7 +599,7 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
liistall=True
)
self.assertEqual(
@ -693,7 +693,7 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
self.shared_network_sg = Network.create(
self.api_client,
self.services["shared_network_sg"],
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkofferingid=self.shared_network_offering_sg.id,
zoneid=self.zone.id
)
@ -726,10 +726,11 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.shared_network_sg.id,
serviceofferingid=self.service_offering.id
)
self.cleanup_vms.append(self.shared_network_admin_account_virtual_machine)
vms = VirtualMachine.list(
self.api_client,
id=self.shared_network_admin_account_virtual_machine.id,

View File

@ -169,13 +169,13 @@ class TestInstanceNameFlagTrue(cloudstackTestCase):
# 2. Give the user provided user name. Internal name should be
# i-<userid>-<vmid>-display name
self.debug("Deploying VM in account: %s" % self.account.account.name)
self.debug("Deploying VM in account: %s" % self.account.name)
# Spawn an instance in that network
virtual_machine = VirtualMachine.create(
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.account.name,
domainid=self.account.account.domainid,
accountid=self.account.name,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
)
self.debug(
@ -208,11 +208,11 @@ class TestInstanceNameFlagTrue(cloudstackTestCase):
# Fetch account ID and VMID from database to check internal name
self.debug("select id from account where uuid = '%s';" \
% self.account.account.id)
% self.account.id)
qresultset = self.dbclient.execute(
"select id from account where uuid = '%s';" \
% self.account.account.id
% self.account.id
)
self.assertEqual(
isinstance(qresultset, list),
@ -273,12 +273,12 @@ class TestInstanceNameFlagTrue(cloudstackTestCase):
# Removing display name from config
del self.services["virtual_machine"]["displayname"]
self.debug("Deploying VM in account: %s" % self.account.account.name)
self.debug("Deploying VM in account: %s" % self.account.name)
virtual_machine = VirtualMachine.create(
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.account.name,
domainid=self.account.account.domainid,
accountid=self.account.name,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
)
self.debug(
@ -307,11 +307,11 @@ class TestInstanceNameFlagTrue(cloudstackTestCase):
)
# Fetch account ID and VMID from database to check internal name
self.debug("select id from account where uuid = '%s';" \
% self.account.account.id)
% self.account.id)
qresultset = self.dbclient.execute(
"select id from account where uuid = '%s';" \
% self.account.account.id
% self.account.id
)
self.assertEqual(
isinstance(qresultset, list),

View File

@ -1966,7 +1966,6 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
return
@unittest.skip("Valid bug- ID: CS-12647")
class TestInvalidParametersForEgress(cloudstackTestCase):
def setUp(self):

View File

@ -182,7 +182,6 @@ class TestEIP(cloudstackTestCase):
@attr(tags = ["eip"])
@unittest.skip("skipped - Framework DB Exception")
def test_01_eip_by_deploying_instance(self):
"""Test EIP by deploying an instance
"""
@ -350,7 +349,6 @@ class TestEIP(cloudstackTestCase):
return
@attr(tags = ["eip"])
@unittest.skip("skipped - Framework DB Exception")
def test_02_acquire_ip_enable_static_nat(self):
"""Test associate new IP and enable static NAT for new IP and the VM
"""
@ -495,7 +493,6 @@ class TestEIP(cloudstackTestCase):
return
@attr(tags = ["eip"])
@unittest.skip("skipped - Framework DB Exception")
def test_03_disable_static_nat(self):
"""Test disable static NAT and release EIP acquired
"""
@ -695,7 +692,6 @@ class TestEIP(cloudstackTestCase):
return
@attr(tags = ["eip"])
@unittest.skip("skipped - Framework DB Exception")
def test_04_disable_static_nat_system(self):
"""Test disable static NAT with system = True
"""
@ -765,7 +761,6 @@ class TestEIP(cloudstackTestCase):
return
@attr(tags = ["eip"])
@unittest.skip("skipped - Framework DB Exception")
def test_05_destroy_instance(self):
"""Test EIO after destroying instance
"""
@ -1406,7 +1401,6 @@ class TestELB(cloudstackTestCase):
return
@attr(tags = ["eip"])
@unittest.skip("valid bug : http://bugs.cloudstack.org/browse/CS-15077 : ListPublicIPAddress failing")
def test_04_delete_lb_on_eip(self):
"""Test delete LB rule generated on EIP
"""

View File

@ -2135,7 +2135,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -2145,7 +2145,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -2153,7 +2153,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -2161,7 +2161,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls.lb_rule = LoadBalancerRule.create(
@ -2658,7 +2658,7 @@ class TestServiceProvider(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -2691,7 +2691,7 @@ class TestServiceProvider(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -2721,7 +2721,7 @@ class TestServiceProvider(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -2734,7 +2734,7 @@ class TestServiceProvider(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -2766,7 +2766,7 @@ class TestServiceProvider(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug(
@ -2813,7 +2813,7 @@ class TestServiceProvider(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)

View File

@ -245,7 +245,7 @@ class TestLbSourceNat(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -258,7 +258,7 @@ class TestLbSourceNat(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -294,7 +294,7 @@ class TestLbSourceNat(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -325,7 +325,7 @@ class TestLbSourceNat(cloudstackTestCase):
self.apiclient,
associatednetworkid=self.network.id,
account=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
listall=True,
issourcenat=True,
)
@ -454,7 +454,7 @@ class TestLbOnIpWithPf(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -467,7 +467,7 @@ class TestLbOnIpWithPf(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -503,7 +503,7 @@ class TestLbOnIpWithPf(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -535,7 +535,7 @@ class TestLbOnIpWithPf(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
@ -665,7 +665,7 @@ class TestPfOnIpWithLb(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -678,7 +678,7 @@ class TestPfOnIpWithLb(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -714,7 +714,7 @@ class TestPfOnIpWithLb(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -747,7 +747,7 @@ class TestPfOnIpWithLb(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -877,7 +877,7 @@ class TestLbOnNonSourceNat(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -890,7 +890,7 @@ class TestLbOnNonSourceNat(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -926,7 +926,7 @@ class TestLbOnNonSourceNat(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -959,7 +959,7 @@ class TestLbOnNonSourceNat(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -1097,7 +1097,7 @@ class TestAddMultipleVmsLb(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -1110,7 +1110,7 @@ class TestAddMultipleVmsLb(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -1146,7 +1146,7 @@ class TestAddMultipleVmsLb(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -1179,7 +1179,7 @@ class TestAddMultipleVmsLb(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -1371,7 +1371,7 @@ class TestMultipleLbRules(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -1384,7 +1384,7 @@ class TestMultipleLbRules(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -1420,7 +1420,7 @@ class TestMultipleLbRules(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -1455,7 +1455,7 @@ class TestMultipleLbRules(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -1501,7 +1501,7 @@ class TestMultipleLbRules(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -1688,7 +1688,7 @@ class TestMultipleLbRulesSameIp(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -1701,7 +1701,7 @@ class TestMultipleLbRulesSameIp(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -1737,7 +1737,7 @@ class TestMultipleLbRulesSameIp(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -1772,7 +1772,7 @@ class TestMultipleLbRulesSameIp(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -1953,7 +1953,7 @@ class TestLoadBalancingRule(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -1963,7 +1963,7 @@ class TestLoadBalancingRule(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -1971,7 +1971,7 @@ class TestLoadBalancingRule(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls.lb_rule = LoadBalancerRule.create(
@ -2132,7 +2132,6 @@ class TestLoadBalancingRule(cloudstackTestCase):
return
@unittest.skip("Questions - How to verify after changing public/private ports?")
class TestDeleteCreateLBRule(cloudstackTestCase):
@classmethod
@ -2177,7 +2176,7 @@ class TestDeleteCreateLBRule(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -2187,7 +2186,7 @@ class TestDeleteCreateLBRule(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -2195,7 +2194,7 @@ class TestDeleteCreateLBRule(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [
@ -2316,7 +2315,7 @@ class TestVmWithLb(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -2326,7 +2325,7 @@ class TestVmWithLb(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -2334,7 +2333,7 @@ class TestVmWithLb(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -2342,7 +2341,7 @@ class TestVmWithLb(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls.lb_rule_1 = LoadBalancerRule.create(
@ -2356,7 +2355,7 @@ class TestVmWithLb(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls.lb_rule_2 = LoadBalancerRule.create(

View File

@ -212,7 +212,7 @@ class TestLbWithRoundRobin(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -225,7 +225,7 @@ class TestLbWithRoundRobin(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -259,7 +259,7 @@ class TestLbWithRoundRobin(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -425,7 +425,7 @@ class TestLbWithLeastConn(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -438,7 +438,7 @@ class TestLbWithLeastConn(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -472,14 +472,14 @@ class TestLbWithLeastConn(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
ip_with_lb_rule = PublicIPAddress.create(
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -644,7 +644,7 @@ class TestLbWithSourceIp(cloudstackTestCase):
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
@ -657,7 +657,7 @@ class TestLbWithSourceIp(cloudstackTestCase):
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(self.network.id)]
)
@ -691,7 +691,7 @@ class TestLbWithSourceIp(cloudstackTestCase):
self.apiclient,
accountid=self.account.name,
zoneid=self.zone.id,
domainid=self.account.account.domainid,
domainid=self.account.domainid,
networkid=self.network.id
)
self.debug("Associated %s with network %s" % (
@ -791,7 +791,7 @@ class TestLbAlgoRrLc(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -808,7 +808,7 @@ class TestLbAlgoRrLc(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -816,7 +816,7 @@ class TestLbAlgoRrLc(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [
@ -1003,7 +1003,7 @@ class TestLbAlgoLcRr(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -1020,7 +1020,7 @@ class TestLbAlgoLcRr(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -1028,7 +1028,7 @@ class TestLbAlgoLcRr(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [
@ -1212,7 +1212,7 @@ class TestLbAlgoRrSb(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -1229,7 +1229,7 @@ class TestLbAlgoRrSb(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -1238,7 +1238,7 @@ class TestLbAlgoRrSb(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [
@ -1425,7 +1425,7 @@ class TestLbAlgoSbRr(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -1442,7 +1442,7 @@ class TestLbAlgoSbRr(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -1451,7 +1451,7 @@ class TestLbAlgoSbRr(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [
@ -1639,7 +1639,7 @@ class TestLbAlgoSbLc(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -1656,7 +1656,7 @@ class TestLbAlgoSbLc(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -1665,7 +1665,7 @@ class TestLbAlgoSbLc(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [
@ -1853,7 +1853,7 @@ class TestLbAlgoLcSb(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -1870,7 +1870,7 @@ class TestLbAlgoLcSb(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -1878,7 +1878,7 @@ class TestLbAlgoLcSb(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [

View File

@ -156,7 +156,7 @@ class TestLbStickyPolicy(cloudstackTestCase):
cls.api_client,
cls.services["network"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkofferingid=cls.network_offering.id,
zoneid=cls.zone.id
)
@ -166,7 +166,7 @@ class TestLbStickyPolicy(cloudstackTestCase):
cls.api_client,
cls.services["virtual_machine"],
accountid=cls.account.name,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
networkids=[str(cls.network.id)]
)
@ -174,7 +174,7 @@ class TestLbStickyPolicy(cloudstackTestCase):
cls.api_client,
accountid=cls.account.name,
zoneid=cls.zone.id,
domainid=cls.account.account.domainid,
domainid=cls.account.domainid,
networkid=cls.network.id
)
cls._cleanup = [

View File

@ -1816,7 +1816,6 @@ class TestNetworkUpgrade(cloudstackTestCase):
return
@unittest.skip("Skipped since shared network requires StartIp/endIp/gateway/netmask")
class TestSharedNetworkWithoutIp(cloudstackTestCase):
@classmethod

View File

@ -343,7 +343,6 @@ class TestProjectCreationNegative(cloudstackTestCase):
@attr(configuration = "allow.user.create.projects")
@attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
@unittest.skip("Known bug-able to create project as a domain user")
def test_user_project_creation(self):
"""Test create project as a domain admin and domain user
"""
@ -1299,7 +1298,6 @@ class TestProjectInviteTimeout(cloudstackTestCase):
)
return
@unittest.skip("Requires SMPT configs")
def test_09_invite_to_project_by_email(self):
"""Test invite user to project by email"""

View File

@ -328,7 +328,6 @@ class TestProjectLimits(cloudstackTestCase):
return
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
@unittest.skip("No provision for updating resource limits from account through API")
def test_02_project_limits_normal_user(self):
""" Test project limits
"""

View File

@ -559,7 +559,6 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
return
@unittest.skip("Deleting domain doesn't cleanup account")
class TestDeleteDomainWithProject(cloudstackTestCase):
@classmethod

View File

@ -270,7 +270,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.account.account.id,
id=self.account.id,
listall=True
)
self.assertEqual(
@ -406,7 +406,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.account.account.id,
id=self.account.id,
listall=True
)
self.assertEqual(
@ -495,7 +495,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.account.account.id,
id=self.account.id,
listall=True
)
self.assertEqual(
@ -597,7 +597,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -631,7 +631,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.user_account.account.id,
id=self.user_account.id,
listall=True
)
self.assertEqual(
@ -807,7 +807,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.user_account.name,
domainid=self.user_account.account.domainid,
domainid=self.user_account.domainid,
serviceofferingid=self.service_offering.id,
networkids=self.network.id
)
@ -880,7 +880,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -914,7 +914,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.user_account.account.id,
id=self.user_account.id,
listall=True
)
self.assertEqual(
@ -1027,7 +1027,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["network"],
accountid=self.user_account.name,
domainid=self.user_account.account.domainid,
domainid=self.user_account.domainid,
networkofferingid=self.shared_network_offering.id,
zoneid=self.zone.id
)
@ -1061,7 +1061,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.network.id,
serviceofferingid=self.service_offering.id
)
@ -1073,7 +1073,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.user_account.name,
domainid=self.user_account.account.domainid,
domainid=self.user_account.domainid,
networkids=self.network.id,
serviceofferingid=self.service_offering.id
)
@ -1146,7 +1146,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -1165,7 +1165,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Admin type account created: %s" % self.admin_account.account.id)
self.debug("Admin type account created: %s" % self.admin_account.id)
#create domain
self.dom_domain = Domain.create(
@ -1206,7 +1206,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.domain_admin_account.account.id,
id=self.domain_admin_account.id,
listall=True
)
self.assertEqual(
@ -1225,7 +1225,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The domain admin account created is not enabled."
)
self.debug("Domain admin account created: %s" % self.domain_admin_account.account.id)
self.debug("Domain admin account created: %s" % self.domain_admin_account.id)
#Create an user account
self.domain_user_account = Account.create(
@ -1240,7 +1240,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.domain_user_account.account.id,
id=self.domain_user_account.id,
listall=True
)
self.assertEqual(
@ -1259,7 +1259,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The domain user account created is not enabled."
)
self.debug("Domain user account created: %s" % self.domain_user_account.account.id)
self.debug("Domain user account created: %s" % self.domain_user_account.id)
#Verify that there should be at least one physical network present in zone.
list_physical_networks_response = PhysicalNetwork.list(
@ -1388,7 +1388,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.network.id,
serviceofferingid=self.service_offering.id
)
@ -1400,7 +1400,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.domain_user_account.name,
domainid=self.domain_user_account.account.domainid,
domainid=self.domain_user_account.domainid,
networkids=self.network.id,
serviceofferingid=self.service_offering.id
)
@ -1428,7 +1428,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.domain_admin_account.name,
domainid=self.domain_admin_account.account.domainid,
domainid=self.domain_admin_account.domainid,
networkids=self.network.id,
serviceofferingid=self.service_offering.id
)
@ -1500,7 +1500,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -1519,7 +1519,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Admin account created: %s" % self.admin_account.account.id)
self.debug("Admin account created: %s" % self.admin_account.id)
self.services["project"]["name"] = "proj-SADJKS"
self.services["project"]["displaytext"] = "proj-SADJKS"
@ -1528,7 +1528,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["project"],
account=self.admin_account.name,
domainid=self.admin_account.account.domainid
domainid=self.admin_account.domainid
)
self.cleanup_projects.append(self.project1)
@ -1558,7 +1558,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["project"],
account=self.admin_account.name,
domainid=self.admin_account.account.domainid
domainid=self.admin_account.domainid
)
self.cleanup_projects.append(self.project2)
@ -1674,7 +1674,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["network"],
projectid=self.project1.id,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkofferingid=self.shared_network_offering.id,
zoneid=self.zone.id
)
@ -1709,7 +1709,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.network.id,
projectid=self.project2.id,
serviceofferingid=self.service_offering.id
@ -1722,7 +1722,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.network.id,
projectid=self.project1.id,
serviceofferingid=self.service_offering.id
@ -1784,7 +1784,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -1803,7 +1803,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Domain admin account created: %s" % self.admin_account.account.id)
self.debug("Domain admin account created: %s" % self.admin_account.id)
#Verify that there should be at least one physical network present in zone.
list_physical_networks_response = PhysicalNetwork.list(
@ -1944,7 +1944,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -1963,7 +1963,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Admin account created: %s" % self.admin_account.account.id)
self.debug("Admin account created: %s" % self.admin_account.id)
#Verify that there should be at least one physical network present in zone.
list_physical_networks_response = PhysicalNetwork.list(
@ -2129,7 +2129,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -2148,7 +2148,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Admin account created: %s" % self.admin_account.account.id)
self.debug("Admin account created: %s" % self.admin_account.id)
#Verify that there should be at least one physical network present in zone.
list_physical_networks_response = PhysicalNetwork.list(
@ -2309,7 +2309,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.network.id,
serviceofferingid=self.service_offering.id
)
@ -2337,7 +2337,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.network1.id,
serviceofferingid=self.service_offering.id
)
@ -2392,7 +2392,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
liistall=True
)
self.assertEqual(
@ -2540,7 +2540,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.shared_network = Network.create(
self.api_client,
self.services["network"],
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkofferingid=self.shared_network_offering.id,
zoneid=self.zone.id
)
@ -2573,7 +2573,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["isolated_network"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkofferingid=self.isolated_network_offering.id,
zoneid=self.zone.id
)
@ -2601,7 +2601,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.shared_network.id,
serviceofferingid=self.service_offering.id
)
@ -2628,7 +2628,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["virtual_machine"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkids=self.isolated_network.id,
serviceofferingid=self.service_offering.id
)
@ -2657,7 +2657,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
accountid=self.admin_account.name,
zoneid=self.zone.id,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkid=self.isolated_network.id
)
@ -2730,7 +2730,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -2749,7 +2749,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Admin type account created: %s" % self.admin_account.account.id)
self.debug("Admin type account created: %s" % self.admin_account.id)
#Verify that there should be at least one physical network present in zone.
list_physical_networks_response = PhysicalNetwork.list(
@ -2845,7 +2845,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["network"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkofferingid=self.shared_network_offering.id,
zoneid=self.zone.id
)
@ -2875,7 +2875,7 @@ class TestSharedNetworks(cloudstackTestCase):
#verify that the account got created with state enabled
list_accounts_response = Account.list(
self.api_client,
id=self.admin_account.account.id,
id=self.admin_account.id,
listall=True
)
self.assertEqual(
@ -2894,7 +2894,7 @@ class TestSharedNetworks(cloudstackTestCase):
"The admin account created is not enabled."
)
self.debug("Admin type account created: %s" % self.admin_account.account.id)
self.debug("Admin type account created: %s" % self.admin_account.id)
#Verify that there should be at least one physical network present in zone.
list_physical_networks_response = PhysicalNetwork.list(
@ -2990,7 +2990,7 @@ class TestSharedNetworks(cloudstackTestCase):
self.api_client,
self.services["network"],
accountid=self.admin_account.name,
domainid=self.admin_account.account.domainid,
domainid=self.admin_account.domainid,
networkofferingid=self.shared_network_offering.id,
zoneid=self.zone.id
)

View File

@ -690,7 +690,6 @@ class TestResourceTags(cloudstackTestCase):
return
@attr(tags=["advanced"])
@unittest.skip("Not supported in 3.0.5")
def test_04_vpn_tag(self):
""" Test Create tag on vpn and remove the vpn
"""
@ -1421,7 +1420,6 @@ class TestResourceTags(cloudstackTestCase):
return
@attr(tags=["basic", "sg"])
@unittest.skip("skip")
def test_11_migrate_tagged_vm_del(self):
""" Test migration of a tagged vm and delete the tag
"""

View File

@ -99,7 +99,6 @@ class Services:
}
@unittest.skip("Open questions")
class TestCreateTemplate(cloudstackTestCase):
def setUp(self):

View File

@ -69,7 +69,6 @@ class Services:
# CentOS 5.3 (64-bit)
}
@unittest.skip("Additional test")
class TestVMPasswordEnabled(cloudstackTestCase):
@classmethod

View File

@ -2474,7 +2474,6 @@ class TestVPC(cloudstackTestCase):
"Updation of VPC display text failed.")
@unittest.skip("Skip")
class TestVPCHostMaintenance(cloudstackTestCase):
@classmethod

View File

@ -35,139 +35,144 @@ class Services:
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 128,
},
"network_offering": {
"name": 'VPC Network offering',
"displaytext": 'VPC Network off',
"guestiptype": 'Isolated',
"supportedservices": 'Vpn,Dhcp,Dns,SourceNat,PortForwarding,Lb,UserData,StaticNat,NetworkACL',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Vpn": 'VpcVirtualRouter',
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"Lb": 'VpcVirtualRouter',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
"NetworkACL": 'VpcVirtualRouter'
},
"servicecapabilitylist": {
},
},
"network_off_netscaler": {
"name": 'Network offering-netscaler',
"displaytext": 'Network offering-netscaler',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"Vpn": 'VpcVirtualRouter',
"Lb": 'Netscaler',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
},
},
"network_off_shared": {
"name": 'Shared Network offering',
"displaytext": 'Shared Network offering',
"guestiptype": 'Shared',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"specifyIpRanges": True,
"specifyVlan": True
},
"vpc_offering": {
"name": 'VPC off',
"displaytext": 'VPC off',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat',
},
"vpc": {
"name": "TestVPC",
"displaytext": "TestVPC",
"cidr": '10.0.0.1/24'
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
"netmask": '255.255.255.0'
},
"lbrule": {
"name": "SSH",
"alg": "leastconn",
# Algorithm used for load balancing
"privateport": 22,
"publicport": 2222,
"openfirewall": False,
"startport": 22,
"endport": 2222,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"natrule": {
"privateport": 22,
"publicport": 22,
"startport": 22,
"endport": 22,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"fw_rule": {
"startport": 1,
"endport": 6000,
"cidr": '0.0.0.0/0',
# Any network (For creating FW rule)
"protocol": "TCP"
},
"http_rule": {
"startport": 80,
"endport": 80,
"cidrlist": '0.0.0.0/0',
"protocol": "ICMP"
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
# Hypervisor type should be same as
# hypervisor type of cluster
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
# Cent OS 5.3 (64 bit)
"sleep": 60,
"timeout": 10,
"mode": 'advanced'
}
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 128,
},
"network_offering": {
"name": 'VPC Network offering',
"displaytext": 'VPC Network off',
"guestiptype": 'Isolated',
"supportedservices": 'Vpn,Dhcp,Dns,SourceNat,PortForwarding,Lb,UserData,StaticNat,NetworkACL',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Vpn": 'VpcVirtualRouter',
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"Lb": 'VpcVirtualRouter',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
"NetworkACL": 'VpcVirtualRouter'
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "peraccount"},
"Lb": {"lbSchemes": "public", "SupportedLbIsolation": "dedicated"}
},
},
"network_off_netscaler": {
"name": 'Network offering-netscaler',
"displaytext": 'Network offering-netscaler',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"Vpn": 'VpcVirtualRouter',
"Lb": 'Netscaler',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "peraccount"},
"Lb": {"lbSchemes": "public", "SupportedLbIsolation": "dedicated"}
},
},
"network_off_shared": {
"name": 'Shared Network offering',
"displaytext": 'Shared Network offering',
"guestiptype": 'Shared',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"specifyIpRanges": True,
"specifyVlan": True
},
"vpc_offering": {
"name": 'VPC off',
"displaytext": 'VPC off',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat',
},
"vpc": {
"name": "TestVPC",
"displaytext": "TestVPC",
"cidr": '10.0.0.1/24'
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
"netmask": '255.255.255.0'
},
"lbrule": {
"name": "SSH",
"alg": "leastconn",
# Algorithm used for load balancing
"privateport": 22,
"publicport": 2222,
"openfirewall": False,
"startport": 22,
"endport": 2222,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"natrule": {
"privateport": 22,
"publicport": 22,
"startport": 22,
"endport": 22,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"fw_rule": {
"startport": 1,
"endport": 6000,
"cidr": '0.0.0.0/0',
# Any network (For creating FW rule)
"protocol": "TCP"
},
"http_rule": {
"startport": 80,
"endport": 80,
"cidrlist": '0.0.0.0/0',
"protocol": "ICMP"
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
# Hypervisor type should be same as
# hypervisor type of cluster
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
# Cent OS 5.3 (64 bit)
"sleep": 60,
"timeout": 10,
}
class TestVPCNetwork(cloudstackTestCase):
@ -459,7 +464,6 @@ class TestVPCNetwork(cloudstackTestCase):
)
return
@unittest.skip("Skip - Requires netscaler setup")
@attr(tags=["netscaler", "intervlan"])
def test_03_create_network_netscaler(self):
""" Test create network using netscaler for LB
@ -707,7 +711,6 @@ class TestVPCNetwork(cloudstackTestCase):
return
@attr(tags=["advanced", "intervlan"])
@unittest.skip("Skipping - able to create network with RvR")
def test_06_create_network_with_rvr(self):
""" Test create network with eredundant router capability
"""
@ -1038,7 +1041,6 @@ class TestVPCNetwork(cloudstackTestCase):
"Network creation failed as VPC support nw with conserve mode OFF")
return
@unittest.skip("tested")
class TestVPCNetworkRanges(cloudstackTestCase):
@classmethod
@ -1670,7 +1672,6 @@ class TestVPCNetworkUpgrade(cloudstackTestCase):
return
@attr(tags=["advanced", "intervlan"])
@unittest.skip("Error while NW upgrade - Failed to implement network (with specified id) elements and resources as a part of network update")
def test_01_network_services_upgrade(self):
""" Test update Network that is part of a VPC to a network offering
that has more services.

View File

@ -44,138 +44,139 @@ from marvin.integration.lib.common import (get_domain,
class Services:
"""Test VPC network services - Port Forwarding Rules Test Data Class.
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"host1":None,
"host2":None,
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 1000,
"memory": 512,
},
"network_offering": {
"name": 'VPC Network offering',
"displaytext": 'VPC Network off',
"guestiptype": 'Isolated',
"supportedservices": 'Vpn,Dhcp,Dns,SourceNat,PortForwarding,Lb,UserData,StaticNat,NetworkACL',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Vpn": 'VpcVirtualRouter',
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"Lb": 'VpcVirtualRouter',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
"NetworkACL": 'VpcVirtualRouter'
},
"servicecapabilitylist": {
},
},
"network_offering_no_lb": {
"name": 'VPC Network offering',
"displaytext": 'VPC Network off',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,UserData,StaticNat,NetworkACL',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
"NetworkACL": 'VpcVirtualRouter'
},
},
"vpc_offering": {
"name": 'VPC off',
"displaytext": 'VPC off',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat',
},
"vpc": {
"name": "TestVPC",
"displaytext": "TestVPC",
"cidr": '10.0.0.1/24'
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
"netmask": '255.255.255.0'
},
"lbrule": {
"name": "SSH",
"alg": "leastconn",
# Algorithm used for load balancing
"privateport": 22,
"publicport": 2222,
"openfirewall": False,
"startport": 22,
"endport": 2222,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"lbrule_http": {
"name": "HTTP",
"alg": "leastconn",
# Algorithm used for load balancing
"privateport": 80,
"publicport": 8888,
"openfirewall": False,
"startport": 80,
"endport": 8888,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"natrule": {
"privateport": 22,
"publicport": 22,
"startport": 22,
"endport": 22,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"http_rule": {
"privateport": 80,
"publicport": 80,
"startport": 80,
"endport": 80,
"cidrlist": '0.0.0.0/0',
"protocol": "TCP"
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
# Hypervisor type should be same as
# hypervisor type of cluster
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
"sleep": 60,
"timeout": 10,
"mode": 'advanced'
}
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"host1": None,
"host2": None,
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 1000,
"memory": 512,
},
"network_offering": {
"name": 'VPC Network offering',
"displaytext": 'VPC Network off',
"guestiptype": 'Isolated',
"supportedservices": 'Vpn,Dhcp,Dns,SourceNat,PortForwarding,Lb,UserData,StaticNat,NetworkACL',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Vpn": 'VpcVirtualRouter',
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"Lb": 'VpcVirtualRouter',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
"NetworkACL": 'VpcVirtualRouter'
},
"servicecapabilitylist": {
},
},
"network_offering_no_lb": {
"name": 'VPC Network offering',
"displaytext": 'VPC Network off',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,UserData,StaticNat,NetworkACL',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
"serviceProviderList": {
"Dhcp": 'VpcVirtualRouter',
"Dns": 'VpcVirtualRouter',
"SourceNat": 'VpcVirtualRouter',
"PortForwarding": 'VpcVirtualRouter',
"UserData": 'VpcVirtualRouter',
"StaticNat": 'VpcVirtualRouter',
"NetworkACL": 'VpcVirtualRouter'
},
},
"vpc_offering": {
"name": 'VPC off',
"displaytext": 'VPC off',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat',
},
"vpc": {
"name": "TestVPC",
"displaytext": "TestVPC",
"cidr": '10.0.0.1/24'
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
"netmask": '255.255.255.0'
},
"lbrule": {
"name": "SSH",
"alg": "leastconn",
# Algorithm used for load balancing
"privateport": 22,
"publicport": 2222,
"openfirewall": False,
"startport": 22,
"endport": 2222,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"lbrule_http": {
"name": "HTTP",
"alg": "leastconn",
# Algorithm used for load balancing
"privateport": 80,
"publicport": 8888,
"openfirewall": False,
"startport": 80,
"endport": 8888,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"natrule": {
"privateport": 22,
"publicport": 22,
"startport": 22,
"endport": 22,
"protocol": "TCP",
"cidrlist": '0.0.0.0/0',
},
"http_rule": {
"privateport": 80,
"publicport": 80,
"startport": 80,
"endport": 80,
"cidrlist": '0.0.0.0/0',
"protocol": "TCP"
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
# Hypervisor type should be same as
# hypervisor type of cluster
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
"sleep": 60,
"timeout": 10,
"mode": 'advanced'
}
class TestVPCNetworkPFRules(cloudstackTestCase):
@ -251,15 +252,12 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
try:
#Clean up, terminate the created network offerings
cleanup_resources(self.apiclient, self._cleanup)
wait_for_cleanup(self.apiclient, [
"network.gc.interval",
"network.gc.wait"])
except Exception as e:
self.debug("Warning: Exception during cleanup : %s" % e)
#raise Exception("Warning: Exception during cleanup : %s" % e)
return
def get_Router_For_VPC(self):
def get_vpcrouter(self):
routers = list_routers(self.apiclient,
account=self.account.name,
domainid=self.account.domainid,
@ -276,8 +274,8 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
return router
def stop_VPC_VRouter(self):
router = self.get_Router_For_VPC()
def stop_vpcrouter(self):
router = self.get_vpcrouter()
self.debug("Stopping router ID: %s" % router.id)
cmd = stopRouter.stopRouterCmd()
cmd.id = router.id
@ -298,7 +296,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
)
return router
def start_VPC_VRouter(self, router):
def start_vpcrouter(self, router):
# Start the VPC Router
cmd = startRouter.startRouterCmd()
cmd.id = router.id
@ -348,7 +346,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
else:
self.debug("Failed to wget from VM=%s http server on public_ip=%s" % (vm.name, public_ip.ipaddress.ipaddress))
def create_StaticNatRule_For_VM(self, vm, public_ip, network):
def create_staticnat(self, vm, public_ip, network):
self.debug("Enabling static NAT for IP: %s" %
public_ip.ipaddress.ipaddress)
try:
@ -364,7 +362,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
self.fail("Failed to enable static NAT on IP: %s - %s" % (
public_ip.ipaddress.ipaddress, e))
def create_NatRule_For_VM(self, vm, public_ip, network, services=None):
def create_natrule(self, vm, public_ip, network, services=None):
self.debug("Creatinng NAT rule in network for vm with public IP")
if not services:
services = self.services["natrule"]
@ -386,7 +384,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
self.debug('nwacl_nat=%s' % nwacl_nat.__dict__)
return nat_rule
def acquire_Public_IP(self, network):
def acquire_publicip(self, network):
self.debug("Associating public IP for network: %s" % network.name)
public_ip = PublicIPAddress.create(self.apiclient,
accountid=self.account.name,
@ -400,7 +398,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
))
return public_ip
def create_VPC(self, cidr='10.1.2.1/16'):
def create_vpc(self, cidr='10.1.2.1/16'):
self.debug("Creating a VPC offering..")
self.services["vpc_offering"]["name"] = self.services["vpc_offering"]["name"] + str(cidr)
vpc_off = VpcOffering.create(
@ -424,7 +422,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
)
return vpc
def create_Network(self, net_offerring, gateway='10.1.1.1',vpc=None):
def create_network(self, net_offerring, gateway='10.1.1.1',vpc=None):
try:
self.debug('Create NetworkOffering')
net_offerring["name"] = "NET_OFF-" + str(gateway)
@ -453,7 +451,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
except:
self.fail('Unable to create a Network with offering=%s' % net_offerring)
def create_VM_in_Network(self, network, host_id=None):
def deployvm_in_network(self, network, host_id=None):
try:
self.debug('Creating VM in network=%s' % network.name)
vm = VirtualMachine.create(
@ -471,7 +469,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
except:
self.fail('Unable to create VM in a Network=%s' % network.name)
def create_LB_Rule(self, public_ip, network, vmarray, services=None):
def create_lbrule(self, public_ip, network, vmarray, services=None):
self.debug("Creating LB rule for IP address: %s" %
public_ip.ipaddress.ipaddress)
objservices = None
@ -493,7 +491,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
lb_rule.assign(self.apiclient, vmarray)
return lb_rule
def create_egress_Internet_Rule(self, network):
def open_egress_to_world(self, network):
self.debug("Adding Egress rules to network %s and %s to allow access to internet" % (network.name,self.services["http_rule"]))
nwacl_internet_1 = NetworkACL.create(
self.apiclient,
@ -507,8 +505,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
@attr(tags=["advanced", "intervlan"])
def test_01_network_services_VPC_StopCreatePF(self):
""" Test case no 204 : Create PF rules for a single virtual network of a VPC,
using a new Public IP Address available with the VPC when Virtual Router is in Stopped State
""" Test : Create VPC PF rules on acquired public ip when VpcVirtualRouter is stopped
"""
# Validate the following
@ -521,20 +518,19 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 7. Start VPC Virtual Router.
# 8. Successfully ssh into the Guest VM using the PF rule
network_1 = self.create_Network(self.services["network_offering"])
vm_1 = self.create_VM_in_Network(network_1)
public_ip_1 = self.acquire_Public_IP(network_1)
router = self.stop_VPC_VRouter()
self.create_NatRule_For_VM( vm_1, public_ip_1, network_1)
self.start_VPC_VRouter(router)
network_1 = self.create_network(self.services["network_offering"])
vm_1 = self.deployvm_in_network(network_1)
public_ip_1 = self.acquire_publicip(network_1)
router = self.stop_vpcrouter()
self.create_natrule( vm_1, public_ip_1, network_1)
self.start_vpcrouter(router)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
return
@attr(tags=["advanced", "intervlan"])
def test_02_network_services_VPC_CreatePF(self):
""" Test case no 190 : Create PF rules for a single virtual network of a VPC using a
new Public IP Address available with the VPC when Virtual Router is in Running State
""" Test Create VPC PF rules on acquired public ip when VpcVirtualRouter is Running
"""
# Validate the following
@ -545,17 +541,16 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 5. Use the Create PF rule for vm in network1.
# 6. Successfully ssh into the Guest VM using the PF rule
network_1 = self.create_Network(self.services["network_offering"])
vm_1 = self.create_VM_in_Network(network_1)
public_ip_1 = self.acquire_Public_IP(network_1)
self.create_NatRule_For_VM( vm_1, public_ip_1, network_1)
network_1 = self.create_network(self.services["network_offering"])
vm_1 = self.deployvm_in_network(network_1)
public_ip_1 = self.acquire_publicip(network_1)
self.create_natrule( vm_1, public_ip_1, network_1)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
return
@attr(tags=["advanced", "intervlan"])
def test_03_network_services_VPC_StopCreateMultiplePF(self):
""" Test case no 205 : Create PF rules for a two/multiple virtual networks of a VPC using
a new Public IP Address available with the VPC when Virtual Router is in Stopped State
""" Test Create multiple VPC PF rules on acquired public ip in diff't networks when VpcVirtualRouter is stopped
"""
# Validate the following
@ -571,24 +566,23 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 10. Start VPC Virtual Router.
# 11. Successfully ssh into the Guest VM1 and VM2 using the PF rule
network_1 = self.create_Network(self.services["network_offering_no_lb"])
network_2 = self.create_Network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.create_VM_in_Network(network_1)
vm_2 = self.create_VM_in_Network(network_2)
public_ip_1 = self.acquire_Public_IP(network_1)
public_ip_2 = self.acquire_Public_IP(network_2)
router = self.stop_VPC_VRouter()
self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
self.create_NatRule_For_VM(vm_2, public_ip_2, network_2)
self.start_VPC_VRouter(router)
network_1 = self.create_network(self.services["network_offering_no_lb"])
network_2 = self.create_network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.deployvm_in_network(network_1)
vm_2 = self.deployvm_in_network(network_2)
public_ip_1 = self.acquire_publicip(network_1)
public_ip_2 = self.acquire_publicip(network_2)
router = self.stop_vpcrouter()
self.create_natrule(vm_1, public_ip_1, network_1)
self.create_natrule(vm_2, public_ip_2, network_2)
self.start_vpcrouter(router)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_ssh_into_vm(vm_2, public_ip_2, testnegative=False)
return
@attr(tags=["advanced", "intervlan"])
def test_04_network_services_VPC_CreateMultiplePF(self):
""" Test case no 191 : Create PF rules for a two/multiple virtual networks of a VPC using a
new Public IP Address available with the VPC when Virtual Router is in Running State
""" Test Create multiple VPC PF rules on acquired public ip in diff't networks when VpcVirtualRouter is running
"""
# Validate the following
@ -603,24 +597,23 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 9. Start VPC Virtual Router.
# 10. Successfully ssh into the Guest VM1 and VM2 using the PF rule
network_1 = self.create_Network(self.services["network_offering"])
network_2 = self.create_Network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.create_VM_in_Network(network_1)
vm_2 = self.create_VM_in_Network(network_2)
public_ip_1 = self.acquire_Public_IP(network_1)
public_ip_2 = self.acquire_Public_IP(network_2)
router = self.stop_VPC_VRouter()
self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
self.create_NatRule_For_VM(vm_2, public_ip_2, network_2)
self.start_VPC_VRouter(router)
network_1 = self.create_network(self.services["network_offering"])
network_2 = self.create_network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.deployvm_in_network(network_1)
vm_2 = self.deployvm_in_network(network_2)
public_ip_1 = self.acquire_publicip(network_1)
public_ip_2 = self.acquire_publicip(network_2)
router = self.stop_vpcrouter()
self.create_natrule(vm_1, public_ip_1, network_1)
self.create_natrule(vm_2, public_ip_2, network_2)
self.start_vpcrouter(router)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_ssh_into_vm(vm_2, public_ip_2, testnegative=False)
return
@attr(tags=["advanced", "intervlan"])
def test_05_network_services_VPC_StopDeletePF(self):
""" Test case no 207 : Delete few(not all) PF rules for a single virtual network of
a VPC belonging to a single Public IP Address when Virtual Router is in Stopped State
""" Test delete a PF rule in VPC when VpcVirtualRouter is Stopped
"""
# Validate the following
@ -636,24 +629,23 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 10. Start VPC Virtual Router.
# 11. wget a file present on http server of VM1 should fail
network_1 = self.create_Network(self.services["network_offering"])
vm_1 = self.create_VM_in_Network(network_1)
public_ip_1 = self.acquire_Public_IP(network_1)
self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
http_rule = self.create_NatRule_For_VM(vm_1, public_ip_1, network_1, self.services["http_rule"])
network_1 = self.create_network(self.services["network_offering"])
vm_1 = self.deployvm_in_network(network_1)
public_ip_1 = self.acquire_publicip(network_1)
self.create_natrule(vm_1, public_ip_1, network_1)
http_rule = self.create_natrule(vm_1, public_ip_1, network_1, self.services["http_rule"])
#http_rule = self.create_egress_Internet_Rule(network_1)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_wget_from_vm(vm_1, public_ip_1, testnegative=False)
router = self.stop_VPC_VRouter()
router = self.stop_vpcrouter()
http_rule.delete()
self.start_VPC_VRouter(router)
self.start_vpcrouter(router)
self.check_wget_from_vm(vm_1, public_ip_1, testnegative=True)
return
@attr(tags=["advanced", "intervlan"])
def test_06_network_services_VPC_DeletePF(self):
""" Test case no 193 : Delete few(not all) PF rules for a single virtual network of
a VPC belonging to a single Public IP Address when Virtual Router is in Running State
""" Test delete a PF rule in VPC when VpcVirtualRouter is Running
"""
# Validate the following
@ -667,11 +659,11 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 9. Delete internet PF rule
# 10. wget a file present on http server of VM1 should fail
network_1 = self.create_Network(self.services["network_offering"])
vm_1 = self.create_VM_in_Network(network_1)
public_ip_1 = self.acquire_Public_IP(network_1)
self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
http_rule=self.create_NatRule_For_VM(vm_1, public_ip_1, network_1, self.services["http_rule"])
network_1 = self.create_network(self.services["network_offering"])
vm_1 = self.deployvm_in_network(network_1)
public_ip_1 = self.acquire_publicip(network_1)
self.create_natrule(vm_1, public_ip_1, network_1)
http_rule=self.create_natrule(vm_1, public_ip_1, network_1, self.services["http_rule"])
#http_rule = self.create_egress_Internet_Rule(network_1)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_wget_from_vm(vm_1, public_ip_1, testnegative=False)
@ -681,8 +673,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
@attr(tags=["advanced", "intervlan"])
def test_07_network_services_VPC_StopDeleteAllPF(self):
""" Test case no 208 : Delete all PF rules for a single virtual network of a
VPC belonging to a single Public IP Address when Virtual Router is in Stopped State
""" Test delete all PF rules in VPC when VpcVirtualRouter is Stopped
"""
# Validate the following
@ -699,26 +690,25 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 11. wget a file present on http server of VM1 should fail
# 12. ssh into Guest VM using the PF rule should fail
network_1 = self.create_Network(self.services["network_offering"])
vm_1 = self.create_VM_in_Network(network_1)
public_ip_1 = self.acquire_Public_IP(network_1)
nat_rule = self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
http_rule = self.create_NatRule_For_VM(vm_1, public_ip_1, network_1, self.services["http_rule"])
network_1 = self.create_network(self.services["network_offering"])
vm_1 = self.deployvm_in_network(network_1)
public_ip_1 = self.acquire_publicip(network_1)
nat_rule = self.create_natrule(vm_1, public_ip_1, network_1)
http_rule = self.create_natrule(vm_1, public_ip_1, network_1, self.services["http_rule"])
#http_rule = self.create_egress_Internet_Rule(network_1)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_wget_from_vm(vm_1, public_ip_1, testnegative=False)
router = self.stop_VPC_VRouter()
router = self.stop_vpcrouter()
http_rule.delete()
nat_rule.delete()
self.start_VPC_VRouter(router)
self.start_vpcrouter(router)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=True)
self.check_wget_from_vm(vm_1, public_ip_1, testnegative=True)
return
@attr(tags=["advanced", "intervlan"])
def test_08_network_services_VPC_DeleteAllPF(self):
""" Test case no 194 : Delete all PF rules for a single virtual network of a
VPC belonging to a single Public IP Address when Virtual Router is in Running State
""" Test delete all PF rules in VPC when VpcVirtualRouter is Running
"""
# Validate the following
@ -733,11 +723,11 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 9. wget a file present on http server of VM1 should fail
# 10. ssh into Guest VM using the PF rule should fail
network_1 = self.create_Network(self.services["network_offering"])
vm_1 = self.create_VM_in_Network(network_1)
public_ip_1 = self.acquire_Public_IP(network_1)
nat_rule = self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
http_rule = self.create_NatRule_For_VM(vm_1, public_ip_1, network_1, self.services["http_rule"])
network_1 = self.create_network(self.services["network_offering"])
vm_1 = self.deployvm_in_network(network_1)
public_ip_1 = self.acquire_publicip(network_1)
nat_rule = self.create_natrule(vm_1, public_ip_1, network_1)
http_rule = self.create_natrule(vm_1, public_ip_1, network_1, self.services["http_rule"])
#http_rule = self.create_egress_Internet_Rule(network_1)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_wget_from_vm(vm_1, public_ip_1, testnegative=False)
@ -749,8 +739,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
@attr(tags=["advanced", "intervlan"])
def test_09_network_services_VPC_StopDeleteAllMultiplePF(self):
""" Test case no 209 : Delete all PF rules for two/multiple virtual networks of a VPC.
Observe the status of the Public IP Addresses of the rules when Virtual Router is in Stopped State
""" Test delete all PF rules in VPC across multiple networks when VpcVirtualRouter is Stopped
"""
# Validate the following
@ -769,20 +758,20 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 12. Start VPC Virtual Router.
# 13. Fail to ssh and http to vm1, vm2, vm3 and vm4.
network_1 = self.create_Network(self.services["network_offering"])
network_2 = self.create_Network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.create_VM_in_Network(network_1)
vm_2 = self.create_VM_in_Network(network_1)
vm_3 = self.create_VM_in_Network(network_2)
vm_4 = self.create_VM_in_Network(network_2)
public_ip_1 = self.acquire_Public_IP(network_1)
public_ip_2 = self.acquire_Public_IP(network_1)
nat_rule1 = self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
nat_rule2 = self.create_NatRule_For_VM(vm_2, public_ip_2, network_1)
http_rule1 = self.create_egress_Internet_Rule(network_1)
nat_rule3 = self.create_NatRule_For_VM(vm_3, public_ip_1, network_2)
nat_rule4 = self.create_NatRule_For_VM(vm_4, public_ip_2, network_2)
http_rule2 = self.create_egress_Internet_Rule(network_2)
network_1 = self.create_network(self.services["network_offering"])
network_2 = self.create_network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.deployvm_in_network(network_1)
vm_2 = self.deployvm_in_network(network_1)
vm_3 = self.deployvm_in_network(network_2)
vm_4 = self.deployvm_in_network(network_2)
public_ip_1 = self.acquire_publicip(network_1)
public_ip_2 = self.acquire_publicip(network_1)
nat_rule1 = self.create_natrule(vm_1, public_ip_1, network_1)
nat_rule2 = self.create_natrule(vm_2, public_ip_2, network_1)
http_rule1 = self.open_egress_to_world(network_1)
nat_rule3 = self.create_natrule(vm_3, public_ip_1, network_2)
nat_rule4 = self.create_natrule(vm_4, public_ip_2, network_2)
http_rule2 = self.open_egress_to_world(network_2)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_ssh_into_vm(vm_2, public_ip_2, testnegative=False)
self.check_ssh_into_vm(vm_3, public_ip_1, testnegative=False)
@ -791,14 +780,14 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
self.check_wget_from_vm(vm_2, public_ip_2, testnegative=False)
self.check_wget_from_vm(vm_3, public_ip_1, testnegative=False)
self.check_wget_from_vm(vm_4, public_ip_2, testnegative=False)
router = self.stop_VPC_VRouter()
router = self.stop_vpcrouter()
nat_rule1.delete()
nat_rule2.delete()
nat_rule3.delete()
nat_rule4.delete()
http_rule1.delete()
http_rule2.delete()
self.start_VPC_VRouter(router)
self.start_vpcrouter(router)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=True)
self.check_ssh_into_vm(vm_2, public_ip_2, testnegative=True)
self.check_ssh_into_vm(vm_3, public_ip_1, testnegative=True)
@ -811,10 +800,8 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
@attr(tags=["advanced", "intervlan"])
def test_10_network_services_VPC_DeleteAllMultiplePF(self):
""" Test case no 195: Delete all PF rules for two/multiple virtual networks of a VPC.
Observe the status of the Public IP Addresses of the rules when Virtual Router is in Running State
""" Test delete all PF rules in VPC across multiple networks when VpcVirtualRouter is Running
"""
# Validate the following
# 1. Create a VPC with cidr - 10.1.1.1/16.
# 2. Create a Network offering - NO1 with all supported services.
@ -829,20 +816,20 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
# 12. Delete all PF rultes for vm1, vm2, vm3 and vm4.
# 13. Fail to ssh and http to vm1, vm2, vm3 and vm4.
network_1 = self.create_Network(self.services["network_offering"])
network_2 = self.create_Network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.create_VM_in_Network(network_1)
vm_2 = self.create_VM_in_Network(network_1)
vm_3 = self.create_VM_in_Network(network_2)
vm_4 = self.create_VM_in_Network(network_2)
public_ip_1 = self.acquire_Public_IP(network_1)
public_ip_2 = self.acquire_Public_IP(network_1)
nat_rule1 = self.create_NatRule_For_VM(vm_1, public_ip_1, network_1)
nat_rule2 = self.create_NatRule_For_VM(vm_2, public_ip_2, network_1)
http_rule1 = self.create_egress_Internet_Rule(network_1)
nat_rule3 = self.create_NatRule_For_VM(vm_3, public_ip_1, network_2)
nat_rule4 = self.create_NatRule_For_VM(vm_4, public_ip_2, network_2)
http_rule2 = self.create_egress_Internet_Rule(network_2)
network_1 = self.create_network(self.services["network_offering"])
network_2 = self.create_network(self.services["network_offering_no_lb"], '10.1.2.1')
vm_1 = self.deployvm_in_network(network_1)
vm_2 = self.deployvm_in_network(network_1)
vm_3 = self.deployvm_in_network(network_2)
vm_4 = self.deployvm_in_network(network_2)
public_ip_1 = self.acquire_publicip(network_1)
public_ip_2 = self.acquire_publicip(network_1)
nat_rule1 = self.create_natrule(vm_1, public_ip_1, network_1)
nat_rule2 = self.create_natrule(vm_2, public_ip_2, network_1)
http_rule1 = self.open_egress_to_world(network_1)
nat_rule3 = self.create_natrule(vm_3, public_ip_1, network_2)
nat_rule4 = self.create_natrule(vm_4, public_ip_2, network_2)
http_rule2 = self.open_egress_to_world(network_2)
self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
self.check_ssh_into_vm(vm_2, public_ip_2, testnegative=False)
self.check_ssh_into_vm(vm_3, public_ip_1, testnegative=False)

View File

@ -278,7 +278,6 @@ class TestVPCOffering(cloudstackTestCase):
return
@attr(tags=["advanced", "intervlan"])
@unittest.skip("Skipping - Issue: Deleting account doesn't clean VPC")
def test_02_deploy_vms_in_vpc_nw(self):
"""Test deploy virtual machines in VPC networks"""
@ -897,7 +896,6 @@ class TestVPCOffering(cloudstackTestCase):
return
@attr(tags=["advanced", "intervlan"])
@unittest.skip("Skipping - API should not allow to create VPC offering without SourceNAT, Firewall")
def test_06_vpc_off_invalid_services(self):
"""Test VPC offering with invalid services"""

View File

@ -509,7 +509,6 @@ class TestVPCRoutersBasic(cloudstackTestCase):
)
return
@unittest.skip("Needs hosts")
@attr(tags=["advanced", "intervlan"])
def test_04_migrate_router_after_creating_vpc(self):
""" Test migration of router to another host after creating VPC """
@ -531,7 +530,6 @@ class TestVPCRoutersBasic(cloudstackTestCase):
self.migrate_router(routers[0])
return
@unittest.skip("Fails")
@attr(tags=["advanced", "intervlan"])
def test_05_change_service_offerring_vpc(self):
""" Tests to change service offering of the Router after
@ -1236,7 +1234,6 @@ class TestVPCRouterOneNetwork(cloudstackTestCase):
)
return
@unittest.skip("Untested - hosts not available")
@attr(tags=["advanced", "intervlan"])
def test_04_migrate_router_after_addition_of_one_guest_network(self):
""" Test migrate of router after addition of one guest network
@ -1280,7 +1277,6 @@ class TestVPCRouterOneNetwork(cloudstackTestCase):
self.migrate_router(routers[0])
return
@unittest.skip("Fails")
@attr(tags=["advanced", "intervlan"])
def test_05_chg_srv_off_router_after_addition_of_one_guest_network(self):
""" Test to change service offering of router after addition of one guest network

File diff suppressed because it is too large Load Diff

View File

@ -1721,7 +1721,6 @@ class TestVMDeployVPC(cloudstackTestCase):
return
@attr(tags=["advanced", "intervlan"])
@unittest.skip("Not tested")
def test_07_delete_network_with_rules(self):
""" Test delete network that has PF/staticNat/LB rules/Network Acl
"""

View File

@ -16,7 +16,7 @@
# under the License.
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering
from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering, Host
from marvin.integration.lib.common import get_zone, get_domain, get_template, cleanup_resources
from nose.plugins.attrib import attr
@ -76,6 +76,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
domainid=cls.domain.id
)
cls.services["account"] = cls.account.name
cls.hosts = Host.list(cls.apiclient, type='Routing')
cls.cleanup = [
cls.account
]
@ -177,10 +178,12 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
"Running",
msg="VM is not in Running state"
)
vm1clusterid = filter(lambda c: c.id == vm1.hostid, self.hosts)[0].clusterid
vm2clusterid = filter(lambda c: c.id == vm2.hostid, self.hosts)[0].clusterid
self.assertNotEqual(
vm1.hostid,
vm2.hostid,
msg="VMs meant to be dispersed are deployed on the same host"
vm1clusterid,
vm2clusterid,
msg="VMs (%s, %s) meant to be dispersed are deployed in the same cluster %s" % (vm1.id, vm2.id, vm1clusterid)
)
@attr(tags=["simulator", "advanced", "basic", "sg"])
@ -236,10 +239,12 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
"Running",
msg="VM is not in Running state"
)
self.assertNotEqual(
vm1.hostid,
vm2.hostid,
msg="VMs meant to be concentrated are deployed on the different hosts"
vm1clusterid = filter(lambda c: c.id == vm1.hostid, self.hosts)[0].clusterid
vm2clusterid = filter(lambda c: c.id == vm2.hostid, self.hosts)[0].clusterid
self.assertEqual(
vm1clusterid,
vm2clusterid,
msg="VMs (%s, %s) meant to be concentrated are deployed on different clusters (%s, %s)" % (vm1.id, vm2.id, vm1clusterid, vm2clusterid)
)
@classmethod

View File

@ -664,6 +664,32 @@ class TestLoadBalancingRule(cloudstackTestCase):
cleanup_resources(cls.api_client, cls._cleanup)
return
def try_ssh(self, src_nat_ip_addr, hostnames):
try:
self.debug(
"SSH into VM (IPaddress: %s) & NAT Rule (Public IP: %s)" %
(self.vm_1.ipaddress, src_nat_ip_addr.ipaddress)
)
ssh_1 = remoteSSHClient(
src_nat_ip_addr.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
# If Round Robin Algorithm is chosen,
# each ssh command should alternate between VMs
# hostnames = [ssh_1.execute("hostname")[0]]
hostnames.append(ssh_1.execute("hostname")[0])
except Exception as e:
self.fail("%s: SSH failed for VM with IP Address: %s" %
(e, src_nat_ip_addr.ipaddress))
time.sleep(self.services["lb_switch_wait"])
return
@attr(tags = ["advanced", "advancedns", "smoke"])
def test_01_create_lb_rule_src_nat(self):
"""Test to create Load balancing rule with source NAT"""
@ -776,62 +802,33 @@ class TestLoadBalancingRule(cloudstackTestCase):
[self.vm_1.id, self.vm_2.id],
"Check List Load Balancer instances Rules returns valid VM ID"
)
try:
self.debug(
"SSH into VM (IPaddress: %s) & NAT Rule (Public IP: %s)" %
(self.vm_1.ipaddress, src_nat_ip_addr.ipaddress)
)
ssh_1 = remoteSSHClient(
src_nat_ip_addr.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
# If Round Robin Algorithm is chosen,
# each ssh command should alternate between VMs
hostnames = [ssh_1.execute("hostname")[0]]
except Exception as e:
self.fail("%s: SSH failed for VM with IP Address: %s" %
(e, src_nat_ip_addr.ipaddress))
hostnames = []
self.try_ssh(src_nat_ip_addr, hostnames)
self.try_ssh(src_nat_ip_addr, hostnames)
self.try_ssh(src_nat_ip_addr, hostnames)
self.try_ssh(src_nat_ip_addr, hostnames)
self.try_ssh(src_nat_ip_addr, hostnames)
time.sleep(self.services["lb_switch_wait"])
try:
self.debug("SSHing into IP address: %s after adding VMs (ID: %s , %s)" %
(
src_nat_ip_addr.ipaddress,
self.vm_1.id,
self.vm_2.id
))
ssh_2 = remoteSSHClient(
src_nat_ip_addr.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
hostnames.append(ssh_2.execute("hostname")[0])
except Exception as e:
self.fail("%s: SSH failed for VM with IP Address: %s" %
(e, src_nat_ip_addr.ipaddress))
self.debug("Hostnames: %s" % str(hostnames))
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
self.assertIn(
self.vm_2.name,
hostnames,
"Check if ssh succeeded for server2"
)
self.debug("Hostnames: %s" % str(hostnames))
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
self.assertIn(
self.vm_2.name,
hostnames,
"Check if ssh succeeded for server2"
)
#SSH should pass till there is a last VM associated with LB rule
lb_rule.remove(self.apiclient, [self.vm_2])
# making hostnames list empty
hostnames[:] = []
try:
self.debug("SSHing into IP address: %s after removing VM (ID: %s)" %
(
@ -839,25 +836,18 @@ class TestLoadBalancingRule(cloudstackTestCase):
self.vm_2.id
))
ssh_1 = remoteSSHClient(
src_nat_ip_addr.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
self.try_ssh(src_nat_ip_addr, hostnames)
hostnames.append(ssh_1.execute("hostname")[0])
except Exception as e:
self.fail("%s: SSH failed for VM with IP Address: %s" %
(e, src_nat_ip_addr.ipaddress))
self.assertIn(
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
except Exception as e:
self.fail("%s: SSH failed for VM with IP Address: %s" %
(e, src_nat_ip_addr.ipaddress))
lb_rule.remove(self.apiclient, [self.vm_1])
with self.assertRaises(Exception):
@ -967,50 +957,24 @@ class TestLoadBalancingRule(cloudstackTestCase):
"Check List Load Balancer instances Rules returns valid VM ID"
)
try:
self.debug("SSHing into IP address: %s after adding VMs (ID: %s , %s)" %
(
self.non_src_nat_ip.ipaddress.ipaddress,
self.vm_1.id,
self.vm_2.id
))
ssh_1 = remoteSSHClient(
self.non_src_nat_ip.ipaddress.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
hostnames = []
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
# If Round Robin Algorithm is chosen,
# each ssh command should alternate between VMs
hostnames = [ssh_1.execute("hostname")[0]]
time.sleep(self.services["lb_switch_wait"])
self.debug("SSHing again into IP address: %s with VMs (ID: %s , %s) added to LB rule" %
(
self.non_src_nat_ip.ipaddress.ipaddress,
self.vm_1.id,
self.vm_2.id
))
ssh_2 = remoteSSHClient(
self.non_src_nat_ip.ipaddress.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
hostnames.append(ssh_2.execute("hostname")[0])
self.debug("Hostnames after adding 2 VMs to LB rule: %s" % str(hostnames))
self.assertIn(
self.debug("Hostnames: %s" % str(hostnames))
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
self.assertIn(
)
self.assertIn(
self.vm_2.name,
hostnames,
"Check if ssh succeeded for server2"
)
)
#SSH should pass till there is a last VM associated with LB rule
lb_rule.remove(self.apiclient, [self.vm_2])
@ -1020,25 +984,23 @@ class TestLoadBalancingRule(cloudstackTestCase):
self.non_src_nat_ip.ipaddress.ipaddress,
self.vm_2.id
))
ssh_1 = remoteSSHClient(
self.non_src_nat_ip.ipaddress.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
# Making host list empty
hostnames[:] = []
self.try_ssh(self.non_src_nat_ip, hostnames)
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
hostnames.append(ssh_1.execute("hostname")[0])
self.debug("Hostnames after removing VM2: %s" % str(hostnames))
except Exception as e:
self.fail("%s: SSH failed for VM with IP Address: %s" %
(e, self.non_src_nat_ip.ipaddress.ipaddress))
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
lb_rule.remove(self.apiclient, [self.vm_1])
with self.assertRaises(Exception):
self.debug("SSHing into IP address: %s after removing VM (ID: %s) from LB rule" %
@ -1209,7 +1171,7 @@ class TestRebootRouter(cloudstackTestCase):
except Exception as e:
self.fail(
"SSH Access failed for %s: %s" % \
(self.nat_rule.ipaddress.ipaddress, e))
(self.vm_1.ipaddress, e))
return
def tearDown(self):
@ -1277,6 +1239,36 @@ class TestAssignRemoveLB(cloudstackTestCase):
]
return
def tearDown(self):
cleanup_resources(self.apiclient, self.cleanup)
return
def try_ssh(self, src_nat_ip_addr, hostnames):
try:
self.debug(
"SSH into VM (IPaddress: %s) & NAT Rule (Public IP: %s)" %
(self.vm_1.ipaddress, src_nat_ip_addr.ipaddress)
)
ssh_1 = remoteSSHClient(
src_nat_ip_addr.ipaddress,
self.services['lbrule']["publicport"],
self.vm_1.username,
self.vm_1.password
)
# If Round Robin Algorithm is chosen,
# each ssh command should alternate between VMs
# hostnames = [ssh_1.execute("hostname")[0]]
hostnames.append(ssh_1.execute("hostname")[0])
except Exception as e:
self.fail("%s: SSH failed for VM with IP Address: %s" %
(e, src_nat_ip_addr.ipaddress))
time.sleep(self.services["lb_switch_wait"])
return
@attr(tags = ["advanced", "advancedns", "smoke"])
def test_assign_and_removal_lb(self):
"""Test for assign & removing load balancing rule"""
@ -1344,137 +1336,74 @@ class TestAssignRemoveLB(cloudstackTestCase):
)
lb_rule.assign(self.apiclient, [self.vm_1, self.vm_2])
try:
self.debug("SSHing into IP address: %s with VMs (ID: %s , %s) added to LB rule" %
(
self.non_src_nat_ip.ipaddress,
self.vm_1.id,
self.vm_2.id
))
#Create SSH client for each VM
ssh_1 = remoteSSHClient(
self.non_src_nat_ip.ipaddress,
self.services["lbrule"]["publicport"],
self.vm_1.username,
self.vm_1.password
)
except Exception as e:
self.fail("SSH failed for VM with IP: %s" %
self.non_src_nat_ip.ipaddress)
hostnames = []
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
try:
self.debug("SSHing again into IP address: %s with VMs (ID: %s , %s) added to LB rule" %
(
self.non_src_nat_ip.ipaddress,
self.vm_1.id,
self.vm_2.id
))
ssh_2 = remoteSSHClient(
self.non_src_nat_ip.ipaddress,
self.services["lbrule"]["publicport"],
self.vm_2.username,
self.vm_2.password
)
self.debug("Hostnames: %s" % str(hostnames))
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
self.assertIn(
self.vm_2.name,
hostnames,
"Check if ssh succeeded for server2"
)
# If Round Robin Algorithm is chosen,
# each ssh command should alternate between VMs
res_1 = ssh_1.execute("hostname")[0]
self.debug(res_1)
time.sleep(self.services["lb_switch_wait"])
res_2 = ssh_2.execute("hostname")[0]
self.debug(res_2)
except Exception as e:
self.fail("SSH failed for VM with IP: %s" %
self.non_src_nat_ip.ipaddress)
self.assertIn(
self.vm_1.name,
res_1,
"Check if ssh succeeded for server1"
)
self.assertIn(
self.vm_2.name,
res_2,
"Check if ssh succeeded for server2"
)
#Removing VM and assigning another VM to LB rule
lb_rule.remove(self.apiclient, [self.vm_2])
# making hostnames list empty
hostnames[:] = []
try:
self.debug("SSHing again into IP address: %s with VM (ID: %s) added to LB rule" %
(
self.non_src_nat_ip.ipaddress,
self.vm_1.id,
))
# Again make a SSH connection, as previous is not used after LB remove
ssh_1 = remoteSSHClient(
self.non_src_nat_ip.ipaddress,
self.services["lbrule"]["publicport"],
self.vm_1.username,
self.vm_1.password
)
res_1 = ssh_1.execute("hostname")[0]
self.debug(res_1)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
except Exception as e:
self.fail("SSH failed for VM with IP: %s" %
self.non_src_nat_ip.ipaddress)
self.assertIn(
self.vm_1.name,
res_1,
"Check if ssh succeeded for server1"
)
lb_rule.assign(self.apiclient, [self.vm_3])
try:
ssh_1 = remoteSSHClient(
self.non_src_nat_ip.ipaddress,
self.services["lbrule"]["publicport"],
self.vm_1.username,
self.vm_1.password
)
ssh_3 = remoteSSHClient(
self.non_src_nat_ip.ipaddress,
self.services["lbrule"]["publicport"],
self.vm_3.username,
self.vm_3.password
)
# Making hostnames list empty
hostnames[:] = []
res_1 = ssh_1.execute("hostname")[0]
self.debug(res_1)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
self.try_ssh(self.non_src_nat_ip, hostnames)
time.sleep(self.services["lb_switch_wait"])
res_3 = ssh_3.execute("hostname")[0]
self.debug(res_3)
except Exception as e:
self.fail("SSH failed for VM with IP: %s" %
self.non_src_nat_ip.ipaddress)
self.assertIn(
self.vm_1.name,
res_1,
"Check if ssh succeeded for server1"
)
self.assertIn(
self.vm_3.name,
res_3,
"Check if ssh succeeded for server3"
)
self.debug("Hostnames: %s" % str(hostnames))
self.assertIn(
self.vm_1.name,
hostnames,
"Check if ssh succeeded for server1"
)
self.assertIn(
self.vm_3.name,
hostnames,
"Check if ssh succeeded for server3"
)
return
def tearDown(self):
cleanup_resources(self.apiclient, self.cleanup)
return
class TestReleaseIP(cloudstackTestCase):
def setUp(self):
@ -1734,6 +1663,9 @@ class TestDeleteAccount(cloudstackTestCase):
None,
"Check routers are properly deleted."
)
except cloudstackAPIException:
self.debug("Router is deleted")
except Exception as e:
raise Exception(
"Encountered %s raised while fetching routers for account: %s" % (e,

View File

@ -687,10 +687,12 @@ class TestVMLifeCycle(cloudstackTestCase):
else:
break
self.debug("listVirtualMachines response: %s" % list_vm_response)
self.assertEqual(
list_vm_response,
None,
"Check Expunged virtual machine is listVirtualMachines"
"Check Expunged virtual machine is in listVirtualMachines response"
)
return

View File

@ -150,10 +150,10 @@ version="1.0">
</div>
<div id="footer_mainmaster">
<p>Copyright © 2012 The Apache Software Foundation, Licensed under the
<p>Copyright © 2013 The Apache Software Foundation, Licensed under the
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a> <br />
Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
</div>
Apache, CloudStack, Apache CloudStack, the Apache CloudStack logo, the CloudMonkey logo and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
</div>
</div>
</div>
</div>

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