mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' into ui-multiple-nics
This commit is contained in:
commit
2f03e55bbb
|
|
@ -553,6 +553,9 @@ public class AgentShell implements IAgentShell {
|
|||
|
||||
public void start() {
|
||||
try {
|
||||
/* By default we only search for log4j.xml */
|
||||
LogUtils.initLog4j("log4j-cloud.xml");
|
||||
|
||||
System.setProperty("java.net.preferIPv4Stack", "true");
|
||||
|
||||
String instance = getProperty(null, "instance");
|
||||
|
|
@ -612,8 +615,6 @@ public class AgentShell implements IAgentShell {
|
|||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
LogUtils.initLog4j("log4j-cloud.xml");
|
||||
|
||||
AgentShell shell = new AgentShell();
|
||||
shell.init(args);
|
||||
shell.start();
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
|
|
@ -77,7 +78,7 @@ import com.google.gson.Gson;
|
|||
* server.
|
||||
*
|
||||
*/
|
||||
public abstract class ConsoleProxyResource extends ServerResourceBase implements
|
||||
public class ConsoleProxyResource extends ServerResourceBase implements
|
||||
ServerResource {
|
||||
static final Logger s_logger = Logger.getLogger(ConsoleProxyResource.class);
|
||||
|
||||
|
|
@ -489,4 +490,26 @@ public abstract class ConsoleProxyResource extends ServerResourceBase implements
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigParams(Map<String, Object> params) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getConfigParams() {
|
||||
return new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunLevel() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunLevel(int level) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -37,7 +37,7 @@
|
|||
<!--
|
||||
@DB support
|
||||
-->
|
||||
<aop:config proxy-target-class="true">
|
||||
<aop:config>
|
||||
<aop:aspect id="dbContextBuilder" ref="transactionContextBuilder">
|
||||
<aop:pointcut id="captureAnyMethod"
|
||||
expression="execution(* *(..))"
|
||||
|
|
@ -50,15 +50,14 @@
|
|||
<aop:pointcut id="captureEventMethod"
|
||||
expression="execution(* *(..)) and @annotation(com.cloud.event.ActionEvent)"
|
||||
/>
|
||||
|
||||
<aop:around pointcut-ref="captureEventMethod" method="AroundAnyMethod"/>
|
||||
</aop:aspect>
|
||||
|
||||
</aop:config>
|
||||
|
||||
|
||||
<bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
|
||||
<bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
|
||||
|
||||
|
||||
<!--
|
||||
RPC/Async/EventBus
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<bookinfo id="cloudstack_developers">
|
||||
<title>&PRODUCT; Developer's Guide</title>
|
||||
<productname>Apache CloudStack</productname>
|
||||
<productnumber>4.0.0-incubating</productnumber>
|
||||
<productnumber>4.1.0-incubating</productnumber>
|
||||
<edition></edition>
|
||||
<pubsnumber></pubsnumber>
|
||||
<abstract>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,127 @@
|
|||
<?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">
|
||||
<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>
|
||||
<para>The following APIs have been added to support this feature. These API calls can function
|
||||
only while the VM is in running or stopped state.</para>
|
||||
<section id="addnic">
|
||||
<title>addNicToVirtualMachine</title>
|
||||
<para>The addNicToVirtualMachine API adds a new NIC to the specified VM on a selected
|
||||
network.</para>
|
||||
<informaltable>
|
||||
<tgroup cols="3" align="left" colsep="1" rowsep="1">
|
||||
<thead>
|
||||
<row>
|
||||
<entry><para>parameter</para></entry>
|
||||
<entry><para>description</para></entry>
|
||||
<entry><para>Value</para></entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><para>virtualmachineid</para></entry>
|
||||
<entry><para>The unique ID of the VM to which the NIC is to be added. </para></entry>
|
||||
<entry><para>true</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><para>networkid</para></entry>
|
||||
<entry><para>The unique ID of the network the NIC that you add should apply
|
||||
to.</para></entry>
|
||||
<entry><para>true</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><para>ipaddress</para></entry>
|
||||
<entry><para>The IP address of the VM on the network.</para></entry>
|
||||
<entry><para>false</para></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>The network and VM must reside in the same zone. Two VMs with the same name cannot reside
|
||||
in the same network. Therefore, adding a second VM that duplicates a name on a network will
|
||||
fail.</para>
|
||||
</section>
|
||||
<section id="removenic">
|
||||
<title>removeNicFromVirtualMachine</title>
|
||||
<para>The removeNicFromVirtualMachine API removes a NIC from the specified VM on a selected
|
||||
network.</para>
|
||||
<informaltable>
|
||||
<tgroup cols="3" align="left" colsep="1" rowsep="1">
|
||||
<thead>
|
||||
<row>
|
||||
<entry><para>parameter</para></entry>
|
||||
<entry><para>description</para></entry>
|
||||
<entry><para>Value</para></entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><para>virtualmachineid</para></entry>
|
||||
<entry><para>The unique ID of the VM from which the NIC is to be removed.
|
||||
</para></entry>
|
||||
<entry><para>true</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><para>nicid</para></entry>
|
||||
<entry><para>The unique ID of the NIC that you want to remove.</para></entry>
|
||||
<entry><para>true</para></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>Removing the default NIC is not allowed.</para>
|
||||
</section>
|
||||
<section id="defaultnic">
|
||||
<title>updateDefaultNicForVirtualMachine</title>
|
||||
<para>The updateDefaultNicForVirtualMachine API updates the specified NIC to be the default one
|
||||
for a selected VM.</para>
|
||||
<informaltable>
|
||||
<tgroup cols="3" align="left" colsep="1" rowsep="1">
|
||||
<thead>
|
||||
<row>
|
||||
<entry><para>parameter</para></entry>
|
||||
<entry><para>description</para></entry>
|
||||
<entry><para>Value</para></entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><para>virtualmachineid</para></entry>
|
||||
<entry><para>The unique ID of the VM for which you want to specify the default NIC.
|
||||
</para></entry>
|
||||
<entry><para>true</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><para>nicid</para></entry>
|
||||
<entry><para>The unique ID of the NIC that you want to set as the default
|
||||
one.</para></entry>
|
||||
<entry><para>true</para></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
</section>
|
||||
|
|
@ -37,5 +37,33 @@
|
|||
<listitem>
|
||||
<para>addBaremetalHost (Adds a new host.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>addNicToVirtualMachine (Adds a new NIC to the specified VM on a selected
|
||||
network.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>removeNicFromVirtualMachine (Removes the specified NIC from a selected VM.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>updateDefaultNicForVirtualMachine (Updates the specified NIC to be the default one for a
|
||||
selected VM.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>addRegion (Registers a Region into another Region.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>updateRegion (Updates Region details: ID, Name, Endpoint, User API Key, and User Secret
|
||||
Key.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>removeRegion (Removes a Region from current Region.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>listRegions (Get all the Regions. They can be filtered by using the ID or Name.)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>getUser (This API can only be used by the Admin. Get user details by using the API Key.)
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,224 @@
|
|||
<?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="cloudmonkey">
|
||||
<title>CloudMonkey</title>
|
||||
<para>CloudMonkey is the &PRODUCT; Command Line Interface (CLI). It is written in Python and leverages Marvin. CloudMonkey can be used both as an interactive shell and as a command line tool which simplifies &PRODUCT; configuration and management.</para>
|
||||
<warning>
|
||||
<para>CloudMonkey is still under development and should be considered a Work In Progress (WIP), the wiki is the most up to date documentation:</para>
|
||||
<para><ulink url="https://cwiki.apache.org/CLOUDSTACK/cloudstack-cloudmonkey-cli.html">https://cwiki.apache.org/CLOUDSTACK/cloudstack-cloudmonkey-cli.html</ulink></para>
|
||||
</warning>
|
||||
|
||||
<section id="gettingcloudmonkey">
|
||||
<title>Installing CloudMonkey</title>
|
||||
<para>There are two ways to get CloudMonkey:</para>
|
||||
<para><itemizedlist>
|
||||
<listitem>
|
||||
<para>Via the official Apache &PRODUCT; releases (starting with 4.1).</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
$ git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git
|
||||
$ mvn clean install -P developer
|
||||
$ cd tools/cli # cloudmonkey-x.x.x.tar.gz will be built in dist
|
||||
$ python setup.py build
|
||||
$ python setup.py install
|
||||
]]>
|
||||
</programlisting>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Via a community maintained package on Cheese Shop</para>
|
||||
<para><programlisting>pip install cloudmonkey</programlisting></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="configuringcloudmonkey">
|
||||
<title>Configuration</title>
|
||||
<para>To configure CloudMonkey you can edit the .cloudmonkey_config file in the user's home directory as shown below. The values can also be set interactively at the cloudmonkey prompt</para>
|
||||
<programlisting>
|
||||
$ cat .cloudmonkey_config
|
||||
[CLI]
|
||||
protocol = http
|
||||
asyncblock = true
|
||||
color = true
|
||||
prompt = cloudmonkey>
|
||||
history_file = /Users/sebastiengoasguen/.cloudmonkey_history
|
||||
host = localhost
|
||||
path = /client/api
|
||||
port = 8080
|
||||
apikey = plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg
|
||||
secretkey = VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ
|
||||
timeout = 600
|
||||
log_file = /Users/sebastiengoasguen/.cloudmonkey_log
|
||||
</programlisting>
|
||||
<para>The values can also be set at the cloudmonkey prompt. The API and secret keys are obtained via the &PRODUCT; UI or via a raw api call.</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
$ cloudmonkey
|
||||
☁ Apache CloudStack cloudmonkey 4.0.0. Type help or ? to list commands.
|
||||
cloudmonkey> set prompt myprompt>
|
||||
myprompt> set host localhost
|
||||
myprompt> set port 8080
|
||||
myprompt> set apikey <your api key>
|
||||
myprompt> set secretkey <your secret key>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>You can use cloudmonkey to interact with a local cloud, and even with a remote public cloud. You just need to set the host value properly and obtain the keys from the cloud administrator.</para>
|
||||
</section>
|
||||
|
||||
<section id="interactivecli">
|
||||
<title>Interactive Shell Usage</title>
|
||||
<para>To start learning cloudmonkey, the best is to use the interactive shell. Simply type cloudmonkey at the prompt and you should get the interactive shell.</para>
|
||||
<para>At the cloudmonkey prompt press the tab key twice, you will see all potential verbs available. Pick on, enter a space and then press tab twice. You will see all actions available for that verb</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
cloudmonkey>
|
||||
EOF assign cancel create detach extract ldap prepare reconnect restart shell update
|
||||
activate associate change delete disable generate list query register restore start upload
|
||||
add attach configure deploy enable get mark quit remove revoke stop
|
||||
api authorize copy destroy exit help migrate reboot reset set suspend
|
||||
cloudmonkey>create
|
||||
account diskoffering loadbalancerrule portforwardingrule snapshot tags vpc
|
||||
autoscalepolicy domain network privategateway snapshotpolicy template vpcoffering
|
||||
autoscalevmgroup firewallrule networkacl project sshkeypair user vpnconnection
|
||||
autoscalevmprofile instancegroup networkoffering remoteaccessvpn staticroute virtualrouterelement vpncustomergateway
|
||||
condition ipforwardingrule physicalnetwork securitygroup storagenetworkiprange vlaniprange vpngateway
|
||||
counter lbstickinesspolicy pod serviceoffering storagepool volume zone
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>Picking one action and entering a space plus the tab key, you will obtain the list of parameters for that specific api call.</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
cloudmonkey>create network
|
||||
account= domainid= isAsync= networkdomain= projectid= vlan=
|
||||
acltype= endip= name= networkofferingid= startip= vpcid=
|
||||
displaytext= gateway= netmask= physicalnetworkid= subdomainaccess= zoneid=
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>To get additional help on that specific api call you can use the following:</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
cloudmonkey>create network -h
|
||||
Creates a network
|
||||
Required args: displaytext name networkofferingid zoneid
|
||||
Args: account acltype displaytext domainid endip gateway isAsync name netmask networkdomain networkofferingid physicalnetworkid projectid startip subdomainaccess vlan vpcid zoneid
|
||||
|
||||
cloudmonkey>create network -help
|
||||
Creates a network
|
||||
Required args: displaytext name networkofferingid zoneid
|
||||
Args: account acltype displaytext domainid endip gateway isAsync name netmask networkdomain networkofferingid physicalnetworkid projectid startip subdomainaccess vlan vpcid zoneid
|
||||
|
||||
cloudmonkey>create network --help
|
||||
Creates a network
|
||||
Required args: displaytext name networkofferingid zoneid
|
||||
Args: account acltype displaytext domainid endip gateway isAsync name netmask networkdomain networkofferingid physicalnetworkid projectid startip subdomainaccess vlan vpcid zoneid
|
||||
cloudmonkey>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>Note the required arguments necessary for the calls.</para>
|
||||
<note><para>To find out the required parameters value, using a debugger console on the &PRODUCT; UI might be very useful. For instance using Firebug on Firefox, you can navigate the UI and check the parameters values for each call you are making as you navigate the UI.</para></note>
|
||||
</section>
|
||||
|
||||
<section id="startingavmexample">
|
||||
<title>Starting a Virtual Machine instance with CloudMonkey</title>
|
||||
<para>To start a virtual machine instance we will use the <emphasis>deploy virtualmachine</emphasis> call.</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
cloudmonkey>deploy virtualmachine -h
|
||||
Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.
|
||||
Required args: serviceofferingid templateid zoneid
|
||||
Args: account diskofferingid displayname domainid group hostid hypervisor ipaddress iptonetworklist isAsync keyboard keypair name networkids projectid securitygroupids securitygroupnames serviceofferingid size startvm templateid userdata zoneid
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>The required arguments are <emphasis>serviceofferingid, templateid and zoneid</emphasis></para>
|
||||
<para>In order to specify the template that we want to use, we can list all available templates with the following call:</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
cloudmonkey>list templates templatefilter=all
|
||||
count = 2
|
||||
template:
|
||||
========
|
||||
domain = ROOT
|
||||
domainid = 8a111e58-e155-4482-93ce-84efff3c7c77
|
||||
zoneid = e1bfdfaf-3d9b-43d4-9aea-2c9f173a1ae7
|
||||
displaytext = SystemVM Template (XenServer)
|
||||
ostypeid = 849d7d0a-9fbe-452a-85aa-70e0a0cbc688
|
||||
passwordenabled = False
|
||||
id = 6d360f79-4de9-468c-82f8-a348135d298e
|
||||
size = 2101252608
|
||||
isready = True
|
||||
templatetype = SYSTEM
|
||||
zonename = devcloud
|
||||
...<snipped>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>In this snippet, I used DevCloud and only showed the beginning output of the first template, the SystemVM template</para>
|
||||
<para>Similarly to get the <emphasis>serviceofferingid</emphasis> you would do:</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
cloudmonkey>list serviceofferings | grep id
|
||||
id = ef2537ad-c70f-11e1-821b-0800277e749c
|
||||
id = c66c2557-12a7-4b32-94f4-48837da3fa84
|
||||
id = 3d8b82e5-d8e7-48d5-a554-cf853111bc50
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>Note that we can use the linux pipe as well as standard linux commands within the interactive shell. Finally we would start an instance with the following call:</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
cloudmonkey>deploy virtualmachine templateid=13ccff62-132b-4caf-b456-e8ef20cbff0e zoneid=e1bfdfaf-3d9b-43d4-9aea-2c9f173a1ae7 serviceofferingid=ef2537ad-c70f-11e1-821b-0800277e749c
|
||||
jobprocstatus = 0
|
||||
created = 2013-03-05T13:04:51-0800
|
||||
cmd = com.cloud.api.commands.DeployVMCmd
|
||||
userid = 7ed6d5da-93b2-4545-a502-23d20b48ef2a
|
||||
jobstatus = 1
|
||||
jobid = c441d894-e116-402d-aa36-fdb45adb16b7
|
||||
jobresultcode = 0
|
||||
jobresulttype = object
|
||||
jobresult:
|
||||
=========
|
||||
virtualmachine:
|
||||
==============
|
||||
domain = ROOT
|
||||
domainid = 8a111e58-e155-4482-93ce-84efff3c7c77
|
||||
haenable = False
|
||||
templatename = tiny Linux
|
||||
...<snipped>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>The instance would be stopped with:</para>
|
||||
<programlisting>
|
||||
cloudmonkey>stop virtualmachine id=7efe0377-4102-4193-bff8-c706909cc2d2
|
||||
</programlisting>
|
||||
<note><para>The <emphasis>ids</emphasis> that you will use will differ from this example. Make sure you use the ones that corresponds to your &PRODUCT; cloud.</para></note>
|
||||
</section>
|
||||
|
||||
<section id="scriptingcli">
|
||||
<title>Scripting with CloudMonkey</title>
|
||||
<para>All previous examples use CloudMonkey via the interactive shell, however it can be used as a straightfoward CLI, passing the commands to the <emphasis>cloudmonkey</emphasis> command like shown below.</para>
|
||||
<para><programlisting>$cloudmonkey list users</programlisting></para>
|
||||
<para>As such it can be used in shell scripts, it can received commands via stdin and its output can be parsed like any other unix commands as mentioned before.</para>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
<para>The following diagram shows the architecture of the SandBox mode.</para>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="./images/DevCloud.png" />
|
||||
<imagedata fileref="./images/DevCloud.png" scale="50"/>
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>DevCloud.png: Schematic of the DevCloud SandBox architecture</phrase>
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
<para>The following schematic shows the architecture of the Host-Only mode.</para>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="./images/DevCloud-hostonly.png" />
|
||||
<imagedata fileref="./images/DevCloud-hostonly.png" scale="50"/>
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>DevCloud-hostonly.png: Schematic of the DevCloud host-only architecture </phrase>
|
||||
|
|
|
|||
|
|
@ -26,4 +26,5 @@
|
|||
<title>Tools</title>
|
||||
<xi:include href="devcloud.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="marvin.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="cloudmonkey.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
</chapter>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
API usage.</para>
|
||||
<section id="whats-new-in-api-4.1">
|
||||
<title>What's New in the API for 4.1</title>
|
||||
<xi:include href="add-remove-nic.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="vmx-settings-dev.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="reset-ssh-key-dev.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="changed-apicommands-4.1.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ public class VMEntityDaoImpl extends GenericDaoBase<VMEntityVO, Long> implements
|
|||
public static final Logger s_logger = Logger.getLogger(VMEntityDaoImpl.class);
|
||||
|
||||
|
||||
@Inject protected VMReservationDaoImpl _vmReservationDao;
|
||||
@Inject protected VMReservationDao _vmReservationDao;
|
||||
|
||||
@Inject protected VMComputeTagDaoImpl _vmComputeTagDao;
|
||||
@Inject protected VMComputeTagDao _vmComputeTagDao;
|
||||
|
||||
@Inject protected VMRootDiskTagDaoImpl _vmRootDiskTagsDao;
|
||||
@Inject protected VMRootDiskTagDao _vmRootDiskTagsDao;
|
||||
|
||||
@Inject protected VMNetworkMapDaoImpl _vmNetworkMapDao;
|
||||
@Inject protected VMNetworkMapDao _vmNetworkMapDao;
|
||||
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class VMReservationDaoImpl extends GenericDaoBase<VMReservationVO, Long>
|
|||
|
||||
protected SearchBuilder<VMReservationVO> VmIdSearch;
|
||||
|
||||
@Inject protected VolumeReservationDaoImpl _volumeReservationDao;
|
||||
@Inject protected VolumeReservationDao _volumeReservationDao;
|
||||
|
||||
public VMReservationDaoImpl() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,11 +25,9 @@ import java.util.Map;
|
|||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.api.BaseCmd;
|
||||
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;
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityFactory;
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl;
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.VMEntityManager;
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
|
||||
|
|
@ -84,15 +82,14 @@ public class CloudOrchestrator implements OrchestrationService {
|
|||
@Inject
|
||||
protected DiskOfferingDao _diskOfferingDao = null;
|
||||
|
||||
@Inject
|
||||
protected VirtualMachineEntityFactory _vmEntityFactory;
|
||||
|
||||
@Inject
|
||||
protected NetworkDao _networkDao;
|
||||
|
||||
@Inject
|
||||
protected AccountDao _accountDao = null;
|
||||
|
||||
public CloudOrchestrator() {
|
||||
}
|
||||
|
||||
public VirtualMachineEntity createFromScratch(String uuid, String iso, String os, String hypervisor, String hostName, int cpu, int speed, long memory, List<String> networks, List<String> computeTags,
|
||||
Map<String, String> details, String owner) {
|
||||
|
|
@ -174,12 +171,7 @@ public class CloudOrchestrator implements OrchestrationService {
|
|||
}
|
||||
}
|
||||
|
||||
VirtualMachineEntityImpl vmEntity = null;
|
||||
try {
|
||||
vmEntity = _vmEntityFactory.getObject();
|
||||
} catch (Exception e) {
|
||||
// add error handling here
|
||||
}
|
||||
VirtualMachineEntityImpl vmEntity = ComponentContext.inject(VirtualMachineEntityImpl.class);
|
||||
vmEntity.init(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, new ArrayList<String>(networkNicMap.keySet()));
|
||||
|
||||
|
||||
|
|
@ -228,12 +220,7 @@ public class CloudOrchestrator implements OrchestrationService {
|
|||
List<String> computeTags, List<String> rootDiskTags, Map<String, NicProfile> networkNicMap, DeploymentPlan plan) throws InsufficientCapacityException {
|
||||
|
||||
// VirtualMachineEntityImpl vmEntity = new VirtualMachineEntityImpl(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, networks, vmEntityManager);
|
||||
VirtualMachineEntityImpl vmEntity = null;
|
||||
try {
|
||||
vmEntity = _vmEntityFactory.getObject();
|
||||
} catch (Exception e) {
|
||||
// add error handling here
|
||||
}
|
||||
VirtualMachineEntityImpl vmEntity = ComponentContext.inject(VirtualMachineEntityImpl.class);
|
||||
vmEntity.init(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, new ArrayList<String>(networkNicMap.keySet()));
|
||||
|
||||
//load vm instance and offerings and call virtualMachineManagerImpl
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class DefaultImageDataStoreImpl implements ImageDataStore {
|
|||
protected ImageDataStoreProvider provider;
|
||||
boolean needDownloadToCacheStorage = false;
|
||||
|
||||
protected DefaultImageDataStoreImpl() {
|
||||
public DefaultImageDataStoreImpl() {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class TemplateObject implements TemplateInfo {
|
|||
ObjectInDataStoreManager ojbectInStoreMgr;
|
||||
@Inject VMTemplatePoolDao templatePoolDao;
|
||||
|
||||
protected TemplateObject() {
|
||||
public TemplateObject() {
|
||||
}
|
||||
|
||||
protected void configure(VMTemplateVO template, DataStore dataStore) {
|
||||
|
|
|
|||
|
|
@ -240,4 +240,10 @@ public class DirectAgentManagerSimpleImpl extends ManagerBase implements AgentMa
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnectWithInvestigation(long hostId, Event event) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class SnapshotObject implements SnapshotInfo {
|
|||
@Inject protected SnapshotStateMachineManager stateMachineMgr;
|
||||
@Inject
|
||||
ObjectInDataStoreManager ojbectInStoreMgr;
|
||||
protected SnapshotObject() {
|
||||
public SnapshotObject() {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ public class ObjectInDataStoreDaoImpl extends GenericDaoBase<ObjectInDataStoreVO
|
|||
private SearchBuilder<ObjectInDataStoreVO> updateStateSearch;
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||
super.configure(name, params);
|
||||
|
||||
updateStateSearch = this.createSearchBuilder();
|
||||
updateStateSearch.and("id", updateStateSearch.entity().getId(), Op.EQ);
|
||||
updateStateSearch.and("state", updateStateSearch.entity().getState(), Op.EQ);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.type.RootDisk;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeType;
|
||||
|
|
@ -36,6 +37,7 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
|||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
|
|
@ -63,8 +65,7 @@ public class VolumeDao2Impl extends GenericDaoBase<VolumeVO, Long> implements Vo
|
|||
protected final SearchBuilder<VolumeVO> InstanceStatesSearch;
|
||||
protected final SearchBuilder<VolumeVO> AllFieldsSearch;
|
||||
protected GenericSearchBuilder<VolumeVO, Long> CountByAccount;
|
||||
//ResourceTagsDaoImpl _tagsDao = ComponentLocator.inject(ResourceTagsDaoImpl.class);
|
||||
ResourceTagsDaoImpl _tagsDao = null;
|
||||
@Inject ResourceTagDao _tagsDao = null;
|
||||
protected static final String SELECT_VM_SQL = "SELECT DISTINCT instance_id from volumes v where v.host_id = ? and v.mirror_state = ?";
|
||||
protected static final String SELECT_HYPERTYPE_FROM_VOLUME = "SELECT c.hypervisor_type from volumes v, storage_pool s, cluster c where v.pool_id = s.id and s.cluster_id = c.id and v.id = ?";
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class DefaultPrimaryDataStore implements PrimaryDataStore {
|
|||
|
||||
private VolumeDao volumeDao;
|
||||
|
||||
protected DefaultPrimaryDataStore() {
|
||||
public DefaultPrimaryDataStore() {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class VolumeEntityImpl implements VolumeEntity {
|
|||
private final VolumeService vs;
|
||||
private VolumeApiResult result;
|
||||
|
||||
protected VolumeEntityImpl() {
|
||||
public VolumeEntityImpl() {
|
||||
this.vs = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class VolumeObject implements VolumeInfo {
|
|||
ObjectInDataStoreManager ojbectInStoreMgr;
|
||||
private Object payload;
|
||||
|
||||
protected VolumeObject() {
|
||||
public VolumeObject() {
|
||||
_volStateMachine = Volume.State.getStateMachine();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -394,7 +394,6 @@ fi
|
|||
%attr(0755,root,root) %{_sysconfdir}/init.d/%{name}-agent
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/agent
|
||||
%dir %{_localstatedir}/log/%{name}/agent
|
||||
%attr(0644,root,root) %{_datadir}/%{name}-agent/*.jar
|
||||
%attr(0644,root,root) %{_datadir}/%{name}-agent/lib/*.jar
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
|
|
|||
|
|
@ -129,6 +129,18 @@ desetup_passwdsvcs() {
|
|||
}
|
||||
|
||||
create_guest_network() {
|
||||
# need to wait for eth device to appear before configuring it
|
||||
timer=0
|
||||
while ! `grep -q $dev /proc/net/dev` ; do
|
||||
logger -t cloud "$(basename $0):Waiting for interface $dev to appear, $timer seconds"
|
||||
sleep 1;
|
||||
if [ $timer -gt 15 ]; then
|
||||
logger -t cloud "$(basename $0):interface $dev never appeared"
|
||||
break
|
||||
fi
|
||||
timer=$[timer + 1]
|
||||
done
|
||||
|
||||
logger -t cloud " $(basename $0): Create network on interface $dev, gateway $gw, network $ip/$mask "
|
||||
# setup ip configuration
|
||||
sudo ip addr add dev $dev $ip/$mask brd +
|
||||
|
|
|
|||
|
|
@ -56,6 +56,18 @@ remove_routing() {
|
|||
}
|
||||
|
||||
add_an_ip () {
|
||||
# need to wait for eth device to appear before configuring it
|
||||
timer=0
|
||||
while ! `grep -q $ethDev /proc/net/dev` ; do
|
||||
logger -t cloud "$(basename $0):Waiting for interface $ethDev to appear, $timer seconds"
|
||||
sleep 1;
|
||||
if [ $timer -gt 15 ]; then
|
||||
logger -t cloud "$(basename $0):interface $ethDev never appeared"
|
||||
break
|
||||
fi
|
||||
timer=$[timer + 1]
|
||||
done
|
||||
|
||||
logger -t cloud "$(basename $0):Adding ip $pubIp on interface $ethDev"
|
||||
sudo ip link show $ethDev | grep "state DOWN" > /dev/null
|
||||
local old_state=$?
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@
|
|||
# $2 timeout seconds
|
||||
getLockFile() {
|
||||
__locked=0
|
||||
__LOCKFILE="/tmp/$1-$$.lock"
|
||||
__TS=`date +%s%N`
|
||||
__LOCKFILE="/tmp/$__TS-$$-$1.lock"
|
||||
if [ $2 ]
|
||||
then
|
||||
__TIMEOUT=$2
|
||||
|
|
@ -49,7 +50,7 @@ getLockFile() {
|
|||
|
||||
for i in `seq 1 $(($__TIMEOUT * 10))`
|
||||
do
|
||||
currlock=`ls -tr /tmp/$1-*.lock | head -n1`
|
||||
currlock=`ls /tmp/*-$1.lock | head -n1`
|
||||
if [ $currlock -ef $__LOCKFILE ]
|
||||
then
|
||||
__locked=1
|
||||
|
|
@ -77,7 +78,7 @@ getLockFile() {
|
|||
# $1 lock filename
|
||||
# $2 locked(1) or not(0)
|
||||
releaseLockFile() {
|
||||
__LOCKFILE="/tmp/$1-$$.lock"
|
||||
__LOCKFILE="/tmp/*-$$-$1.lock"
|
||||
__locked=$2
|
||||
if [ "$__locked" == "1" ]
|
||||
then
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ fi
|
|||
echo To backup called >> [RROUTER_LOG]
|
||||
[RROUTER_BIN_PATH]/disable_pubip.sh >> [RROUTER_LOG] 2>&1
|
||||
echo Disable public ip $? >> [RROUTER_LOG]
|
||||
[RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1
|
||||
[RROUTER_BIN_PATH]/primary-backup.sh backup >> [RROUTER_LOG] 2>&1
|
||||
echo Switch conntrackd mode backup $? >> [RROUTER_LOG]
|
||||
echo Status: BACKUP >> [RROUTER_LOG]
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InputDef;
|
|||
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef;
|
||||
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef.hostNicType;
|
||||
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.SerialDef;
|
||||
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.VirtioSerialDef;
|
||||
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.TermPolicy;
|
||||
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk;
|
||||
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk.PhysicalDiskFormat;
|
||||
|
|
@ -3053,6 +3054,11 @@ ServerResource {
|
|||
SerialDef serial = new SerialDef("pty", null, (short) 0);
|
||||
devices.addDevice(serial);
|
||||
|
||||
if (vmTO.getType() != VirtualMachine.Type.User) {
|
||||
VirtioSerialDef vserial = new VirtioSerialDef(vmTO.getName(), null);
|
||||
devices.addDevice(vserial);
|
||||
}
|
||||
|
||||
ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0);
|
||||
devices.addDevice(console);
|
||||
|
||||
|
|
|
|||
|
|
@ -846,6 +846,31 @@ public class LibvirtVMDef {
|
|||
}
|
||||
}
|
||||
|
||||
public static class VirtioSerialDef {
|
||||
private final String _name;
|
||||
private String _path;
|
||||
|
||||
public VirtioSerialDef(String name, String path) {
|
||||
_name = name;
|
||||
_path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder virtioSerialBuilder = new StringBuilder();
|
||||
if(_path == null) {
|
||||
_path = "/var/lib/libvirt/qemu";
|
||||
}
|
||||
virtioSerialBuilder.append("<channel type='unix'>\n");
|
||||
virtioSerialBuilder.append("<source mode='bind' path='" + _path
|
||||
+ "/" + _name + ".agent'/>\n");
|
||||
virtioSerialBuilder.append("<target type='virtio' name='org.qemu.guest_agent.0'/>\n");
|
||||
virtioSerialBuilder.append("<address type='virtio-serial' controller='0' bus='0' port='1'/>\n");
|
||||
virtioSerialBuilder.append("</channel>\n");
|
||||
return virtioSerialBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GraphicDef {
|
||||
private final String _type;
|
||||
private short _port = -2;
|
||||
|
|
|
|||
|
|
@ -156,4 +156,6 @@ public interface AgentManager extends Manager {
|
|||
|
||||
boolean reconnect(long hostId);
|
||||
Answer sendToSSVM(Long dcId, final Command cmd);
|
||||
|
||||
void disconnectWithInvestigation(final long hostId, final Status.Event event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
|||
|
||||
protected int _pingInterval;
|
||||
protected long _pingTimeout;
|
||||
@Inject protected AgentMonitor _monitor;
|
||||
@Inject protected AgentMonitorService _monitor;
|
||||
|
||||
protected ExecutorService _executor;
|
||||
protected ThreadPoolExecutor _connectExecutor;
|
||||
|
|
@ -668,7 +668,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
|||
public boolean start() {
|
||||
startDirectlyConnectedHosts();
|
||||
if (_monitor != null) {
|
||||
_monitor.start();
|
||||
_monitor.startMonitoring();
|
||||
}
|
||||
if (_connection != null) {
|
||||
_connection.start();
|
||||
|
|
@ -1455,7 +1455,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
|||
_executor.submit(new DisconnectTask(attache, event, false));
|
||||
}
|
||||
|
||||
protected void disconnectWithInvestigation(AgentAttache attache, final Status.Event event) {
|
||||
public void disconnectWithInvestigation(AgentAttache attache, final Status.Event event) {
|
||||
_executor.submit(new DisconnectTask(attache, event, true));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import javax.inject.Inject;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.Listener;
|
||||
import com.cloud.agent.api.AgentControlAnswer;
|
||||
import com.cloud.agent.api.AgentControlCommand;
|
||||
|
|
@ -56,13 +57,13 @@ import com.cloud.vm.VMInstanceVO;
|
|||
import com.cloud.vm.dao.VMInstanceDao;
|
||||
|
||||
@Component
|
||||
public class AgentMonitor extends Thread implements Listener {
|
||||
public class AgentMonitor extends Thread implements AgentMonitorService {
|
||||
private static Logger s_logger = Logger.getLogger(AgentMonitor.class);
|
||||
private static Logger status_Logger = Logger.getLogger(Status.class);
|
||||
private long _pingTimeout;
|
||||
@Inject private HostDao _hostDao;
|
||||
private boolean _stop;
|
||||
@Inject private AgentManagerImpl _agentMgr;
|
||||
@Inject private AgentManager _agentMgr;
|
||||
@Inject private VMInstanceDao _vmDao;
|
||||
@Inject private DataCenterDao _dcDao = null;
|
||||
@Inject private HostPodDao _podDao = null;
|
||||
|
|
@ -296,4 +297,8 @@ public class AgentMonitor extends Thread implements Listener {
|
|||
return -1;
|
||||
}
|
||||
|
||||
public void startMonitoring() {
|
||||
start();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.agent.manager;
|
||||
|
||||
import com.cloud.agent.Listener;
|
||||
|
||||
public interface AgentMonitorService extends Listener {
|
||||
|
||||
public Boolean isAgentBehindOnPing(long agentId);
|
||||
public Long getAgentPingTime(long agentId);
|
||||
public void pingBy(long agentId);
|
||||
public void signalStop();
|
||||
public void startMonitoring();
|
||||
}
|
||||
|
|
@ -135,7 +135,9 @@ public class ApiDispatcher {
|
|||
processParameters(cmd, params);
|
||||
UserContext ctx = UserContext.current();
|
||||
ctx.setAccountId(cmd.getEntityOwnerId());
|
||||
if (cmd instanceof BaseAsyncCmd) {
|
||||
|
||||
BaseCmd realCmdObj = ComponentContext.getTargetObject(cmd);
|
||||
if (realCmdObj instanceof BaseAsyncCmd) {
|
||||
|
||||
BaseAsyncCmd asyncCmd = (BaseAsyncCmd) cmd;
|
||||
String startEventId = params.get("ctxStartEventId");
|
||||
|
|
@ -370,8 +372,8 @@ public class ApiDispatcher {
|
|||
if (internalId == null) {
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Object entity uuid = " + uuid + " does not exist in the database.");
|
||||
throw new InvalidParameterValueException("Invalid parameter value=" + uuid
|
||||
+ " due to incorrect long value format, or entity was not found as it may have been deleted, or due to incorrect parameter annotation for the field in api cmd.");
|
||||
throw new InvalidParameterValueException("Invalid parameter " + annotation.name() + " value=" + uuid
|
||||
+ " due to incorrect long value format, or entity does not exist or due to incorrect parameter annotation for the field in api cmd class.");
|
||||
}
|
||||
return internalId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ import com.cloud.utils.db.Transaction;
|
|||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
@Component
|
||||
public class ApiServer implements HttpRequestHandler {
|
||||
public class ApiServer implements HttpRequestHandler, ApiServerService {
|
||||
private static final Logger s_logger = Logger.getLogger(ApiServer.class.getName());
|
||||
private static final Logger s_accessLogger = Logger.getLogger("apiserver." + ApiServer.class.getName());
|
||||
|
||||
|
|
@ -500,22 +500,22 @@ public class ApiServer implements HttpRequestHandler {
|
|||
// if the command is of the listXXXCommand, we will need to also return the
|
||||
// the job id and status if possible
|
||||
// For those listXXXCommand which we have already created DB views, this step is not needed since async job is joined in their db views.
|
||||
if (cmdObj instanceof BaseListCmd && !(cmdObj instanceof ListVMsCmd) && !(cmdObj instanceof ListRoutersCmd)
|
||||
&& !(cmdObj instanceof ListSecurityGroupsCmd)
|
||||
&& !(cmdObj instanceof ListTagsCmd)
|
||||
&& !(cmdObj instanceof ListEventsCmd)
|
||||
&& !(cmdObj instanceof ListVMGroupsCmd)
|
||||
&& !(cmdObj instanceof ListProjectsCmd)
|
||||
&& !(cmdObj instanceof ListProjectAccountsCmd)
|
||||
&& !(cmdObj instanceof ListProjectInvitationsCmd)
|
||||
&& !(cmdObj instanceof ListHostsCmd)
|
||||
&& !(cmdObj instanceof ListVolumesCmd)
|
||||
&& !(cmdObj instanceof ListUsersCmd)
|
||||
&& !(cmdObj instanceof ListAccountsCmd)
|
||||
&& !(cmdObj instanceof ListStoragePoolsCmd)
|
||||
&& !(cmdObj instanceof ListDiskOfferingsCmd)
|
||||
&& !(cmdObj instanceof ListServiceOfferingsCmd)
|
||||
&& !(cmdObj instanceof ListZonesByCmd)
|
||||
if (realCmdObj instanceof BaseListCmd && !(realCmdObj instanceof ListVMsCmd) && !(realCmdObj instanceof ListRoutersCmd)
|
||||
&& !(realCmdObj instanceof ListSecurityGroupsCmd)
|
||||
&& !(realCmdObj instanceof ListTagsCmd)
|
||||
&& !(realCmdObj instanceof ListEventsCmd)
|
||||
&& !(realCmdObj instanceof ListVMGroupsCmd)
|
||||
&& !(realCmdObj instanceof ListProjectsCmd)
|
||||
&& !(realCmdObj instanceof ListProjectAccountsCmd)
|
||||
&& !(realCmdObj instanceof ListProjectInvitationsCmd)
|
||||
&& !(realCmdObj instanceof ListHostsCmd)
|
||||
&& !(realCmdObj instanceof ListVolumesCmd)
|
||||
&& !(realCmdObj instanceof ListUsersCmd)
|
||||
&& !(realCmdObj instanceof ListAccountsCmd)
|
||||
&& !(realCmdObj instanceof ListStoragePoolsCmd)
|
||||
&& !(realCmdObj instanceof ListDiskOfferingsCmd)
|
||||
&& !(realCmdObj instanceof ListServiceOfferingsCmd)
|
||||
&& !(realCmdObj instanceof ListZonesByCmd)
|
||||
) {
|
||||
buildAsyncListResponse((BaseListCmd) cmdObj, caller);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.api;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import com.cloud.exception.CloudAuthenticationException;
|
||||
|
||||
public interface ApiServerService {
|
||||
public boolean verifyRequest(Map<String, Object[]> requestParameters, Long userId) throws ServerApiException;
|
||||
public Long fetchDomainId(String domainUUID);
|
||||
public void loginUser(HttpSession session, String username, String password, Long domainId, String domainPath, String loginIpAddress ,Map<String, Object[]> requestParameters) throws CloudAuthenticationException;
|
||||
public void logoutUser(long userId);
|
||||
public boolean verifyUser(Long userId);
|
||||
|
||||
public String getSerializedApiError(int errorCode, String errorText, Map<String, Object[]> apiCommandParams, String responseType);
|
||||
public String getSerializedApiError(ServerApiException ex, Map<String, Object[]> apiCommandParams, String responseType);
|
||||
|
||||
public String handleRequest(Map params, String responseType, StringBuffer auditTrailSb) throws ServerApiException;
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ public class ApiServlet extends HttpServlet {
|
|||
public static final Logger s_logger = Logger.getLogger(ApiServlet.class.getName());
|
||||
private static final Logger s_accessLogger = Logger.getLogger("apiserver." + ApiServer.class.getName());
|
||||
|
||||
@Inject ApiServer _apiServer;
|
||||
@Inject ApiServerService _apiServer;
|
||||
@Inject AccountService _accountMgr;
|
||||
|
||||
public ApiServlet() {
|
||||
|
|
|
|||
|
|
@ -1996,7 +1996,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
}
|
||||
|
||||
if (domainIds != null ){
|
||||
sc.setParameters("domainIdIn", domainIds);
|
||||
sc.setParameters("domainIdIn", domainIds.toArray());
|
||||
}
|
||||
|
||||
if (includePublicOfferings){
|
||||
|
|
@ -2102,7 +2102,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
domainRecord = _domainDao.findById(domainRecord.getParent());
|
||||
domainIds.add(domainRecord.getId());
|
||||
}
|
||||
sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds);
|
||||
sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds.toArray());
|
||||
|
||||
// include also public offering if no keyword, name and id specified
|
||||
if ( keyword == null && name == null && id == null ){
|
||||
|
|
@ -2235,7 +2235,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
}
|
||||
// domainId == null (public zones) or domainId IN [all domain id up to root domain]
|
||||
SearchCriteria<DataCenterJoinVO> sdc = _dcJoinDao.createSearchCriteria();
|
||||
sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds);
|
||||
sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
|
||||
sdc.addOr("domainId", SearchCriteria.Op.NULL);
|
||||
sc.addAnd("domain", SearchCriteria.Op.SC, sdc);
|
||||
|
||||
|
|
@ -2265,7 +2265,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
|
||||
// domainId == null (public zones) or domainId IN [all domain id up to root domain]
|
||||
SearchCriteria<DataCenterJoinVO> sdc = _dcJoinDao.createSearchCriteria();
|
||||
sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds);
|
||||
sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
|
||||
sdc.addOr("domainId", SearchCriteria.Op.NULL);
|
||||
sc.addAnd("domain", SearchCriteria.Op.SC, sdc);
|
||||
|
||||
|
|
@ -2286,7 +2286,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
return new Pair<List<DataCenterJoinVO>, Integer>(new ArrayList<DataCenterJoinVO>(), 0);
|
||||
}
|
||||
else{
|
||||
sc.addAnd("idIn", SearchCriteria.Op.IN, dcIds);
|
||||
sc.addAnd("idIn", SearchCriteria.Op.IN, dcIds.toArray());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ import com.cloud.utils.DateUtil;
|
|||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.Profiler;
|
||||
import com.cloud.utils.PropertiesUtil;
|
||||
import com.cloud.utils.component.ComponentContext;
|
||||
import com.cloud.utils.component.ComponentLifecycle;
|
||||
import com.cloud.utils.component.ManagerBase;
|
||||
import com.cloud.utils.concurrency.NamedThreadFactory;
|
||||
|
|
@ -364,11 +365,11 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager {
|
|||
|
||||
try {
|
||||
// schedule a scan task immediately
|
||||
if (_agentMgr instanceof ClusteredAgentManagerImpl) {
|
||||
if (ComponentContext.getTargetObject(_agentMgr) instanceof ClusteredAgentManagerImpl) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Received notification as part of addHost command to start a host scan task");
|
||||
}
|
||||
ClusteredAgentManagerImpl clusteredAgentMgr = (ClusteredAgentManagerImpl)_agentMgr;
|
||||
ClusteredAgentManagerImpl clusteredAgentMgr = (ClusteredAgentManagerImpl)ComponentContext.getTargetObject(_agentMgr);
|
||||
clusteredAgentMgr.scheduleHostScanTask();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ import com.cloud.dc.dao.AccountVlanMapDao;
|
|||
import com.cloud.dc.dao.ClusterDao;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
import com.cloud.dc.dao.DataCenterIpAddressDao;
|
||||
import com.cloud.dc.dao.DataCenterLinkLocalIpAddressDao;
|
||||
import com.cloud.dc.dao.DataCenterLinkLocalIpAddressDaoImpl;
|
||||
import com.cloud.dc.dao.HostPodDao;
|
||||
import com.cloud.dc.dao.PodVlanMapDao;
|
||||
|
|
@ -249,7 +250,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
VpcManager _vpcMgr;
|
||||
|
||||
// FIXME - why don't we have interface for DataCenterLinkLocalIpAddressDao?
|
||||
@Inject protected DataCenterLinkLocalIpAddressDaoImpl _LinkLocalIpAllocDao;
|
||||
@Inject protected DataCenterLinkLocalIpAddressDao _LinkLocalIpAllocDao;
|
||||
|
||||
private int _maxVolumeSizeInGb;
|
||||
private long _defaultPageSize;
|
||||
|
|
|
|||
|
|
@ -65,15 +65,6 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
|
|||
return _premium;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
void initComponent() {
|
||||
try {
|
||||
configure(this.getClass().getSimpleName(), this.getConfigParams());
|
||||
} catch (ConfigurationException e) {
|
||||
s_logger.warn("Self configuration failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateCache() {
|
||||
_configs = null;
|
||||
|
|
|
|||
|
|
@ -31,8 +31,10 @@ import com.cloud.configuration.Resource.ResourceOwnerType;
|
|||
import com.cloud.configuration.Resource.ResourceType;
|
||||
import com.cloud.configuration.ResourceCountVO;
|
||||
import com.cloud.configuration.ResourceLimit;
|
||||
import com.cloud.domain.dao.DomainDao;
|
||||
import com.cloud.domain.dao.DomainDaoImpl;
|
||||
import com.cloud.exception.UnsupportedServiceException;
|
||||
import com.cloud.user.dao.AccountDao;
|
||||
import com.cloud.user.dao.AccountDaoImpl;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
|
@ -48,11 +50,8 @@ public class ResourceCountDaoImpl extends GenericDaoBase<ResourceCountVO, Long>
|
|||
private final SearchBuilder<ResourceCountVO> AccountSearch;
|
||||
private final SearchBuilder<ResourceCountVO> DomainSearch;
|
||||
|
||||
//protected final DomainDaoImpl _domainDao = ComponentLocator.inject(DomainDaoImpl.class);
|
||||
//protected final AccountDaoImpl _accountDao = ComponentLocator.inject(AccountDaoImpl.class);
|
||||
|
||||
@Inject protected DomainDaoImpl _domainDao;
|
||||
@Inject protected AccountDaoImpl _accountDao;
|
||||
@Inject protected DomainDao _domainDao;
|
||||
@Inject protected AccountDao _accountDao;
|
||||
|
||||
public ResourceCountDaoImpl() {
|
||||
TypeSearch = createSearchBuilder();
|
||||
|
|
|
|||
|
|
@ -63,11 +63,11 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
|
|||
protected SearchBuilder<DataCenterVO> DisabledZonesSearch;
|
||||
protected SearchBuilder<DataCenterVO> TokenSearch;
|
||||
|
||||
@Inject protected DataCenterIpAddressDaoImpl _ipAllocDao = null;
|
||||
@Inject protected DataCenterLinkLocalIpAddressDaoImpl _LinkLocalIpAllocDao = null;
|
||||
@Inject protected DataCenterVnetDaoImpl _vnetAllocDao = null;
|
||||
@Inject protected PodVlanDaoImpl _podVlanAllocDao = null;
|
||||
@Inject protected DcDetailsDaoImpl _detailsDao = null;
|
||||
@Inject protected DataCenterIpAddressDao _ipAllocDao = null;
|
||||
@Inject protected DataCenterLinkLocalIpAddressDao _LinkLocalIpAllocDao = null;
|
||||
@Inject protected DataCenterVnetDao _vnetAllocDao = null;
|
||||
@Inject protected PodVlanDao _podVlanAllocDao = null;
|
||||
@Inject protected DcDetailsDao _detailsDao = null;
|
||||
|
||||
protected long _prefix;
|
||||
protected Random _rand = new Random(System.currentTimeMillis());
|
||||
|
|
|
|||
|
|
@ -23,6 +23,12 @@ import com.cloud.utils.db.GenericDao;
|
|||
|
||||
public interface DataCenterIpAddressDao extends GenericDao<DataCenterIpAddressVO, Long> {
|
||||
|
||||
public DataCenterIpAddressVO takeIpAddress(long dcId, long podId, long instanceId, String reservationId);
|
||||
public DataCenterIpAddressVO takeDataCenterIpAddress(long dcId, String reservationId);
|
||||
public void addIpRange(long dcId, long podId, String start, String end);
|
||||
public void releaseIpAddress(String ipAddress, long dcId, Long instanceId);
|
||||
public void releaseIpAddress(long nicId, String reservationId);
|
||||
|
||||
boolean mark(long dcId, long podId, String ip);
|
||||
List<DataCenterIpAddressVO> listByPodIdDcIdIpAddress(long podId, long dcId, String ipAddress);
|
||||
List<DataCenterIpAddressVO> listByPodIdDcId(long podId, long dcId);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.dc.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.dc.DataCenterLinkLocalIpAddressVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface DataCenterLinkLocalIpAddressDao extends GenericDao<DataCenterLinkLocalIpAddressVO, Long>{
|
||||
public DataCenterLinkLocalIpAddressVO takeIpAddress(long dcId, long podId, long instanceId, String reservationId);
|
||||
public boolean deleteIpAddressByPod(long podId);
|
||||
public void addIpRange(long dcId, long podId, String start, String end);
|
||||
public void releaseIpAddress(String ipAddress, long dcId, long instanceId);
|
||||
public void releaseIpAddress(long nicId, String reservationId);
|
||||
public List<DataCenterLinkLocalIpAddressVO> listByPodIdDcId(long podId, long dcId);
|
||||
public int countIPs(long podId, long dcId, boolean onlyCountAllocated);
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ import com.cloud.utils.net.NetUtils;
|
|||
|
||||
@Component
|
||||
@Local(value={DataCenterLinkLocalIpAddressDaoImpl.class}) @DB(txn=false)
|
||||
public class DataCenterLinkLocalIpAddressDaoImpl extends GenericDaoBase<DataCenterLinkLocalIpAddressVO, Long> implements GenericDao<DataCenterLinkLocalIpAddressVO, Long> {
|
||||
public class DataCenterLinkLocalIpAddressDaoImpl extends GenericDaoBase<DataCenterLinkLocalIpAddressVO, Long> implements DataCenterLinkLocalIpAddressDao {
|
||||
private static final Logger s_logger = Logger.getLogger(DataCenterLinkLocalIpAddressDaoImpl.class);
|
||||
|
||||
private final SearchBuilder<DataCenterLinkLocalIpAddressVO> AllFieldsSearch;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.dc.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.dc.DataCenterVnetVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface DataCenterVnetDao extends GenericDao<DataCenterVnetVO, Long> {
|
||||
public List<DataCenterVnetVO> listAllocatedVnets(long physicalNetworkId);
|
||||
public List<DataCenterVnetVO> findVnet(long dcId, String vnet);
|
||||
public int countZoneVlans(long dcId, boolean onlyCountAllocated);
|
||||
public List<DataCenterVnetVO> findVnet(long dcId, long physicalNetworkId, String vnet);
|
||||
|
||||
public void add(long dcId, long physicalNetworkId, int start, int end);
|
||||
|
||||
public void delete(long physicalNetworkId);
|
||||
|
||||
public DataCenterVnetVO take(long physicalNetworkId, long accountId, String reservationId);
|
||||
|
||||
public void release(String vnet, long physicalNetworkId, long accountId, String reservationId);
|
||||
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
|
|||
*/
|
||||
@Component
|
||||
@DB(txn=false)
|
||||
public class DataCenterVnetDaoImpl extends GenericDaoBase<DataCenterVnetVO, Long> implements GenericDao<DataCenterVnetVO, Long> {
|
||||
public class DataCenterVnetDaoImpl extends GenericDaoBase<DataCenterVnetVO, Long> implements DataCenterVnetDao {
|
||||
private final SearchBuilder<DataCenterVnetVO> FreeVnetSearch;
|
||||
private final SearchBuilder<DataCenterVnetVO> VnetDcSearch;
|
||||
private final SearchBuilder<DataCenterVnetVO> VnetDcSearchAllocated;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.dc.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.dc.PodVlanVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface PodVlanDao extends GenericDao<PodVlanVO, Long> {
|
||||
public List<PodVlanVO> listAllocatedVnets(long podId);
|
||||
public void add(long podId, int start, int end);
|
||||
public void delete(long podId);
|
||||
public PodVlanVO take(long podId, long accountId);
|
||||
public void release(String vlan, long podId, long accountId);
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
|
|||
* PodVlanDaoImpl maintains the one-to-many relationship between
|
||||
*/
|
||||
@Component
|
||||
public class PodVlanDaoImpl extends GenericDaoBase<PodVlanVO, Long> implements GenericDao<PodVlanVO, Long> {
|
||||
public class PodVlanDaoImpl extends GenericDaoBase<PodVlanVO, Long> implements PodVlanDao {
|
||||
private final SearchBuilder<PodVlanVO> FreeVlanSearch;
|
||||
private final SearchBuilder<PodVlanVO> VlanPodSearch;
|
||||
private final SearchBuilder<PodVlanVO> PodSearchAllocated;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class RecreatableFencer extends AdapterBase implements FenceBuilder {
|
|||
@Inject VolumeDao _volsDao;
|
||||
@Inject StoragePoolDao _poolDao;
|
||||
|
||||
protected RecreatableFencer() {
|
||||
public RecreatableFencer() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class RecreatableFencer extends AdapterBase implements FenceBuilder {
|
|||
for (VolumeVO vol : vols) {
|
||||
if (!vol.isRecreatable()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Unable to fence off volumes that are not recreatable: " + vol);
|
||||
s_logger.debug("Unable to f ence off volumes that are not recreatable: " + vol);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ import com.cloud.user.dao.AccountDao;
|
|||
import com.cloud.user.dao.UserStatisticsDao;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.component.AdapterBase;
|
||||
import com.cloud.utils.component.ComponentContext;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GlobalLock;
|
||||
import com.cloud.utils.db.Transaction;
|
||||
|
|
@ -1102,7 +1103,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
|
|||
}
|
||||
|
||||
NetworkElement element = _networkModel.getElementImplementingProvider(providers.get(0).getName());
|
||||
if (!(element instanceof IpDeployer)) {
|
||||
if (!(ComponentContext.getTargetObject(element) instanceof IpDeployer)) {
|
||||
s_logger.error("The firewall provider for network " + network.getName() + " don't have ability to deploy IP address!");
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ import com.cloud.utils.Journal;
|
|||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.component.AdapterBase;
|
||||
import com.cloud.utils.component.ComponentContext;
|
||||
import com.cloud.utils.component.ManagerBase;
|
||||
import com.cloud.utils.concurrency.NamedThreadFactory;
|
||||
import com.cloud.utils.db.*;
|
||||
|
|
@ -546,10 +547,10 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
|
|||
}
|
||||
IpDeployer deployer = null;
|
||||
NetworkElement element = _networkModel.getElementImplementingProvider(provider.getName());
|
||||
if (!(element instanceof IpDeployingRequester)) {
|
||||
if (!(ComponentContext.getTargetObject(element) instanceof IpDeployingRequester)) {
|
||||
throw new CloudRuntimeException("Element " + element + " is not a IpDeployingRequester!");
|
||||
}
|
||||
deployer = ((IpDeployingRequester)element).getIpDeployer(network);
|
||||
deployer = ((IpDeployingRequester)ComponentContext.getTargetObject(element)).getIpDeployer(network);
|
||||
if (deployer == null) {
|
||||
throw new CloudRuntimeException("Fail to get ip deployer for element: " + element);
|
||||
}
|
||||
|
|
@ -1529,13 +1530,13 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
|
|||
if (vmProfile.getType() == Type.User && element.getProvider() != null) {
|
||||
if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Dhcp) &&
|
||||
_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, element.getProvider()) &&
|
||||
(element instanceof DhcpServiceProvider)) {
|
||||
(ComponentContext.getTargetObject(element) instanceof DhcpServiceProvider)) {
|
||||
DhcpServiceProvider sp = (DhcpServiceProvider) element;
|
||||
sp.addDhcpEntry(network, profile, vmProfile, dest, context);
|
||||
}
|
||||
if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.UserData) &&
|
||||
_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.UserData, element.getProvider()) &&
|
||||
(element instanceof UserDataServiceProvider)) {
|
||||
(ComponentContext.getTargetObject(element) instanceof UserDataServiceProvider)) {
|
||||
UserDataServiceProvider sp = (UserDataServiceProvider) element;
|
||||
sp.addPasswordAndUserdata(network, profile, vmProfile, dest, context);
|
||||
}
|
||||
|
|
@ -3622,15 +3623,15 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
|
|||
@Override
|
||||
public StaticNatServiceProvider getStaticNatProviderForNetwork(Network network) {
|
||||
NetworkElement element = getElementForServiceInNetwork(network, Service.StaticNat);
|
||||
assert element instanceof StaticNatServiceProvider;
|
||||
return (StaticNatServiceProvider)element;
|
||||
assert ComponentContext.getTargetObject(element) instanceof StaticNatServiceProvider;
|
||||
return (StaticNatServiceProvider)ComponentContext.getTargetObject(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network) {
|
||||
NetworkElement element = getElementForServiceInNetwork(network, Service.Lb);
|
||||
assert element instanceof LoadBalancingServiceProvider;
|
||||
return ( LoadBalancingServiceProvider)element;
|
||||
assert ComponentContext.getTargetObject(element) instanceof LoadBalancingServiceProvider;
|
||||
return ( LoadBalancingServiceProvider)ComponentContext.getTargetObject(element);
|
||||
}
|
||||
@Override
|
||||
public boolean isNetworkInlineMode(Network network) {
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ import com.cloud.user.Account;
|
|||
import com.cloud.user.DomainManager;
|
||||
import com.cloud.user.dao.AccountDao;
|
||||
import com.cloud.utils.component.AdapterBase;
|
||||
import com.cloud.utils.component.ComponentContext;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.component.ManagerBase;
|
||||
import com.cloud.utils.db.DB;
|
||||
|
|
@ -398,9 +399,9 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
|
|||
Network network = _networksDao.findById(networkId);
|
||||
NetworkElement oldElement = getElementImplementingProvider(oldProvider.getName());
|
||||
NetworkElement newElement = getElementImplementingProvider(newProvider.getName());
|
||||
if (oldElement instanceof IpDeployingRequester && newElement instanceof IpDeployingRequester) {
|
||||
IpDeployer oldIpDeployer = ((IpDeployingRequester)oldElement).getIpDeployer(network);
|
||||
IpDeployer newIpDeployer = ((IpDeployingRequester)newElement).getIpDeployer(network);
|
||||
if (ComponentContext.getTargetObject(oldElement) instanceof IpDeployingRequester && ComponentContext.getTargetObject(newElement) instanceof IpDeployingRequester) {
|
||||
IpDeployer oldIpDeployer = ((IpDeployingRequester)ComponentContext.getTargetObject(oldElement)).getIpDeployer(network);
|
||||
IpDeployer newIpDeployer = ((IpDeployingRequester)ComponentContext.getTargetObject(newElement)).getIpDeployer(network);
|
||||
if (!oldIpDeployer.getProvider().getName().equals(newIpDeployer.getProvider().getName())) {
|
||||
throw new InvalidParameterException("There would be multiple providers for IP " + publicIp.getAddress() + "!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ import com.cloud.utils.AnnotationHelper;
|
|||
import com.cloud.utils.Journal;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.component.ComponentContext;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.component.ManagerBase;
|
||||
import com.cloud.utils.db.*;
|
||||
|
|
@ -2174,10 +2175,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
|
|||
addDefaultSecurityGroupProviderToPhysicalNetwork(pNetwork.getId());
|
||||
|
||||
// add VPCVirtualRouter as the defualt network service provider
|
||||
addDefaultVpcVirtualRouterToPhysicalNetwork(pNetwork.getId());
|
||||
|
||||
// add baremetal pxe/dhcp provider to the physical network
|
||||
addDefaultBaremetalProvidersToPhysicalNetwork(pNetwork.getId());
|
||||
addDefaultVpcVirtualRouterToPhysicalNetwork(pNetwork.getId());
|
||||
|
||||
txn.commit();
|
||||
return pNetwork;
|
||||
|
|
@ -2978,36 +2976,28 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
|
|||
|
||||
PhysicalNetworkServiceProvider nsp = addProviderToPhysicalNetwork(physicalNetworkId, Network.Provider.VirtualRouter.getName(), null, null);
|
||||
// add instance of the provider
|
||||
VirtualRouterElement element = (VirtualRouterElement) _networkModel.getElementImplementingProvider(Network.Provider.VirtualRouter.getName());
|
||||
if (element == null) {
|
||||
NetworkElement networkElement = _networkModel.getElementImplementingProvider(Network.Provider.VirtualRouter.getName());
|
||||
if (networkElement == null) {
|
||||
throw new CloudRuntimeException("Unable to find the Network Element implementing the VirtualRouter Provider");
|
||||
}
|
||||
|
||||
VirtualRouterElement element = (VirtualRouterElement)networkElement;
|
||||
element.addElement(nsp.getId(), VirtualRouterProviderType.VirtualRouter);
|
||||
|
||||
return nsp;
|
||||
}
|
||||
|
||||
|
||||
private PhysicalNetworkServiceProvider addDefaultBaremetalProvidersToPhysicalNetwork(long physicalNetworkId) {
|
||||
PhysicalNetworkVO pvo = _physicalNetworkDao.findById(physicalNetworkId);
|
||||
DataCenterVO dvo = _dcDao.findById(pvo.getDataCenterId());
|
||||
if (dvo.getNetworkType() == NetworkType.Basic) {
|
||||
addProviderToPhysicalNetwork(physicalNetworkId, "BaremetalDhcpProvider", null, null);
|
||||
addProviderToPhysicalNetwork(physicalNetworkId, "BaremetalPxeProvider", null, null);
|
||||
addProviderToPhysicalNetwork(physicalNetworkId, "BaremetaUserdataProvider", null, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected PhysicalNetworkServiceProvider addDefaultVpcVirtualRouterToPhysicalNetwork(long physicalNetworkId) {
|
||||
|
||||
PhysicalNetworkServiceProvider nsp = addProviderToPhysicalNetwork(physicalNetworkId,
|
||||
Network.Provider.VPCVirtualRouter.getName(), null, null);
|
||||
// add instance of the provider
|
||||
VpcVirtualRouterElement element = (VpcVirtualRouterElement) _networkModel.getElementImplementingProvider(Network.Provider.VPCVirtualRouter.getName());
|
||||
if (element == null) {
|
||||
|
||||
NetworkElement networkElement = _networkModel.getElementImplementingProvider(Network.Provider.VPCVirtualRouter.getName());
|
||||
if (networkElement == null) {
|
||||
throw new CloudRuntimeException("Unable to find the Network Element implementing the VPCVirtualRouter Provider");
|
||||
}
|
||||
|
||||
VpcVirtualRouterElement element = (VpcVirtualRouterElement)networkElement;
|
||||
element.addElement(nsp.getId(), VirtualRouterProviderType.VPCVirtualRouter);
|
||||
|
||||
return nsp;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.cloud.network.rules.FirewallRule.State;
|
|||
import com.cloud.network.rules.FirewallRule.TrafficType;
|
||||
import com.cloud.network.rules.FirewallRuleVO;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
|
@ -53,8 +54,8 @@ public class FirewallRulesDaoImpl extends GenericDaoBase<FirewallRuleVO, Long> i
|
|||
protected final SearchBuilder<FirewallRuleVO> SystemRuleSearch;
|
||||
protected final GenericSearchBuilder<FirewallRuleVO, Long> RulesByIpCount;
|
||||
|
||||
@Inject protected FirewallRulesCidrsDaoImpl _firewallRulesCidrsDao;
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject protected FirewallRulesCidrsDao _firewallRulesCidrsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
@Inject IPAddressDao _ipDao;
|
||||
|
||||
protected FirewallRulesDaoImpl() {
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import com.cloud.dc.Vlan.VlanType;
|
||||
import com.cloud.dc.VlanVO;
|
||||
import com.cloud.dc.dao.VlanDao;
|
||||
import com.cloud.dc.dao.VlanDaoImpl;
|
||||
import com.cloud.network.IpAddress.State;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
|
@ -57,9 +59,9 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
|
|||
protected GenericSearchBuilder<IPAddressVO, Integer> AllocatedIpCount;
|
||||
protected GenericSearchBuilder<IPAddressVO, Integer> AllIpCountForDashboard;
|
||||
protected GenericSearchBuilder<IPAddressVO, Long> AllocatedIpCountForAccount;
|
||||
@Inject protected VlanDaoImpl _vlanDao;
|
||||
@Inject protected VlanDao _vlanDao;
|
||||
protected GenericSearchBuilder<IPAddressVO, Long> CountFreePublicIps;
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
|
||||
// make it public for JUnit test
|
||||
public IPAddressDaoImpl() {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class LoadBalancerDaoImpl extends GenericDaoBase<LoadBalancerVO, Long> im
|
|||
private final SearchBuilder<LoadBalancerVO> AccountAndNameSearch;
|
||||
protected final SearchBuilder<LoadBalancerVO> TransitionStateSearch;
|
||||
|
||||
@Inject protected FirewallRulesCidrsDaoImpl _portForwardingRulesCidrsDao;
|
||||
@Inject protected FirewallRulesCidrsDao _portForwardingRulesCidrsDao;
|
||||
|
||||
protected LoadBalancerDaoImpl() {
|
||||
ListByIp = createSearchBuilder();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.network.dao;
|
||||
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface NetworkAccountDao extends GenericDao<NetworkAccountVO, Long> {
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ import com.cloud.utils.db.GenericDao;
|
|||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
||||
@Component
|
||||
public class NetworkAccountDaoImpl extends GenericDaoBase<NetworkAccountVO, Long> implements GenericDao<NetworkAccountVO, Long> {
|
||||
public class NetworkAccountDaoImpl extends GenericDaoBase<NetworkAccountVO, Long> implements NetworkAccountDao {
|
||||
public NetworkAccountDaoImpl() {
|
||||
super();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,13 +39,11 @@ import com.cloud.network.Networks.Mode;
|
|||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offerings.NetworkOfferingVO;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDao;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.GenericSearchBuilder;
|
||||
import com.cloud.utils.db.JoinBuilder;
|
||||
import com.cloud.utils.db.*;
|
||||
import com.cloud.utils.db.JoinBuilder.JoinType;
|
||||
import com.cloud.utils.db.SearchCriteria.Func;
|
||||
|
|
@ -76,13 +74,13 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
|
|||
|
||||
|
||||
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject NetworkAccountDaoImpl _accountsDao;
|
||||
@Inject NetworkDomainDaoImpl _domainsDao;
|
||||
@Inject NetworkOpDaoImpl _opDao;
|
||||
@Inject NetworkServiceMapDaoImpl _ntwkSvcMap;
|
||||
@Inject NetworkOfferingDaoImpl _ntwkOffDao;
|
||||
@Inject NetworkOpDaoImpl _ntwkOpDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
@Inject NetworkAccountDao _accountsDao;
|
||||
@Inject NetworkDomainDao _domainsDao;
|
||||
@Inject NetworkOpDao _opDao;
|
||||
@Inject NetworkServiceMapDao _ntwkSvcMap;
|
||||
@Inject NetworkOfferingDao _ntwkOffDao;
|
||||
@Inject NetworkOpDao _ntwkOpDao;
|
||||
|
||||
TableGenerator _tgMacAddress;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.network.dao;
|
||||
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface NetworkOpDao extends GenericDao<NetworkOpVO, Long> {
|
||||
public int getActiveNics(long networkId);
|
||||
public void changeActiveNicsBy(long networkId, int count);
|
||||
public void setCheckForGc(long networkId);
|
||||
public void clearCheckForGc(long networkId);
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ import com.cloud.utils.db.SearchCriteria.Op;
|
|||
import com.cloud.utils.db.UpdateBuilder;
|
||||
|
||||
@Component
|
||||
public class NetworkOpDaoImpl extends GenericDaoBase<NetworkOpVO, Long> implements GenericDao<NetworkOpVO, Long> {
|
||||
public class NetworkOpDaoImpl extends GenericDaoBase<NetworkOpVO, Long> implements NetworkOpDao {
|
||||
protected final SearchBuilder<NetworkOpVO> AllFieldsSearch;
|
||||
protected final GenericSearchBuilder<NetworkOpVO, Integer> ActiveNicsSearch;
|
||||
protected final Attribute _activeNicsAttribute;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import com.cloud.utils.db.SearchCriteria.Op;
|
|||
public class PhysicalNetworkDaoImpl extends GenericDaoBase<PhysicalNetworkVO, Long> implements PhysicalNetworkDao {
|
||||
final SearchBuilder<PhysicalNetworkVO> ZoneSearch;
|
||||
|
||||
@Inject protected PhysicalNetworkTrafficTypeDaoImpl _trafficTypeDao;
|
||||
@Inject protected PhysicalNetworkTrafficTypeDao _trafficTypeDao;
|
||||
|
||||
protected PhysicalNetworkDaoImpl() {
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.network.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface RouterNetworkDao extends GenericDao<RouterNetworkVO, Long> {
|
||||
public List<Long> getRouterNetworks(long routerId);
|
||||
public RouterNetworkVO findByRouterAndNetwork (long routerId, long networkId);
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ import com.cloud.utils.db.SearchCriteria;
|
|||
import com.cloud.utils.db.SearchCriteria.Op;
|
||||
|
||||
@Component
|
||||
public class RouterNetworkDaoImpl extends GenericDaoBase<RouterNetworkVO, Long> implements GenericDao<RouterNetworkVO, Long>{
|
||||
public class RouterNetworkDaoImpl extends GenericDaoBase<RouterNetworkVO, Long> implements RouterNetworkDao {
|
||||
protected final GenericSearchBuilder<RouterNetworkVO, Long> RouterNetworksSearch;
|
||||
protected final SearchBuilder<RouterNetworkVO> AllFieldsSearch;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ import com.cloud.utils.db.SearchCriteria;
|
|||
public class Site2SiteVpnConnectionDaoImpl extends GenericDaoBase<Site2SiteVpnConnectionVO, Long> implements Site2SiteVpnConnectionDao {
|
||||
private static final Logger s_logger = Logger.getLogger(Site2SiteVpnConnectionDaoImpl.class);
|
||||
|
||||
@Inject protected IPAddressDaoImpl _addrDao;
|
||||
@Inject protected Site2SiteVpnGatewayDaoImpl _vpnGatewayDao;
|
||||
@Inject protected IPAddressDao _addrDao;
|
||||
@Inject protected Site2SiteVpnGatewayDao _vpnGatewayDao;
|
||||
|
||||
private SearchBuilder<Site2SiteVpnConnectionVO> AllFieldsSearch;
|
||||
private SearchBuilder<Site2SiteVpnConnectionVO> VpcSearch;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.cloud.utils.db.SearchCriteria;
|
|||
@Component
|
||||
@Local(value={Site2SiteVpnGatewayDao.class})
|
||||
public class Site2SiteVpnGatewayDaoImpl extends GenericDaoBase<Site2SiteVpnGatewayVO, Long> implements Site2SiteVpnGatewayDao {
|
||||
@Inject protected IPAddressDaoImpl _addrDao;
|
||||
@Inject protected IPAddressDao _addrDao;
|
||||
|
||||
private static final Logger s_logger = Logger.getLogger(Site2SiteVpnGatewayDaoImpl.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import javax.inject.Inject;
|
|||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.cloud.network.dao.FirewallRulesCidrsDao;
|
||||
import com.cloud.network.dao.FirewallRulesCidrsDaoImpl;
|
||||
import com.cloud.network.rules.FirewallRule.Purpose;
|
||||
import com.cloud.network.rules.FirewallRule.State;
|
||||
|
|
@ -44,7 +45,7 @@ public class PortForwardingRulesDaoImpl extends GenericDaoBase<PortForwardingRul
|
|||
protected final SearchBuilder<PortForwardingRuleVO> AllRulesSearchByVM;
|
||||
protected final SearchBuilder<PortForwardingRuleVO> ActiveRulesSearchByAccount;
|
||||
|
||||
@Inject protected FirewallRulesCidrsDaoImpl _portForwardingRulesCidrsDao;
|
||||
@Inject protected FirewallRulesCidrsDao _portForwardingRulesCidrsDao;
|
||||
|
||||
protected PortForwardingRulesDaoImpl() {
|
||||
super();
|
||||
|
|
@ -154,7 +155,7 @@ public class PortForwardingRulesDaoImpl extends GenericDaoBase<PortForwardingRul
|
|||
@Override
|
||||
public List<PortForwardingRuleVO> listByDestIpAddr(String ip4Address) {
|
||||
SearchCriteria<PortForwardingRuleVO> sc = AllFieldsSearch.create();
|
||||
sc.setParameters("address", ip4Address);
|
||||
sc.setParameters("dstIp", ip4Address);
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import com.cloud.network.security.SecurityGroupVO;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
|
||||
import com.cloud.utils.db.DB;
|
||||
|
|
@ -39,7 +40,7 @@ public class SecurityGroupDaoImpl extends GenericDaoBase<SecurityGroupVO, Long>
|
|||
private SearchBuilder<SecurityGroupVO> AccountIdSearch;
|
||||
private SearchBuilder<SecurityGroupVO> AccountIdNameSearch;
|
||||
private SearchBuilder<SecurityGroupVO> AccountIdNamesSearch;
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
|
||||
|
||||
protected SecurityGroupDaoImpl() {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.springframework.stereotype.Component;
|
|||
import com.cloud.network.vpc.StaticRoute;
|
||||
import com.cloud.network.vpc.StaticRouteVO;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
|
||||
import com.cloud.utils.db.DB;
|
||||
|
|
@ -44,7 +45,7 @@ public class StaticRouteDaoImpl extends GenericDaoBase<StaticRouteVO, Long> impl
|
|||
protected final SearchBuilder<StaticRouteVO> AllFieldsSearch;
|
||||
protected final SearchBuilder<StaticRouteVO> NotRevokedSearch;
|
||||
protected final GenericSearchBuilder<StaticRouteVO, Long> RoutesByGatewayCount;
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
|
||||
protected StaticRouteDaoImpl() {
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.springframework.stereotype.Component;
|
|||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.network.vpc.VpcVO;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
|
@ -47,8 +47,9 @@ public class VpcDaoImpl extends GenericDaoBase<VpcVO, Long> implements VpcDao{
|
|||
final GenericSearchBuilder<VpcVO, Integer> CountByOfferingId;
|
||||
final SearchBuilder<VpcVO> AllFieldsSearch;
|
||||
final GenericSearchBuilder<VpcVO, Long> CountByAccountId;
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject VpcServiceMapDaoImpl _vpcSvcMap;
|
||||
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
@Inject VpcServiceMapDao _vpcSvcMap;
|
||||
|
||||
protected VpcDaoImpl() {
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import org.springframework.stereotype.Component;
|
|||
import com.cloud.projects.Project;
|
||||
import com.cloud.projects.ProjectVO;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
|
||||
import com.cloud.utils.db.DB;
|
||||
|
|
@ -45,7 +46,7 @@ public class ProjectDaoImpl extends GenericDaoBase<ProjectVO, Long> implements P
|
|||
protected GenericSearchBuilder<ProjectVO, Long> CountByDomain;
|
||||
protected GenericSearchBuilder<ProjectVO, Long> ProjectAccountSearch;
|
||||
// ResourceTagsDaoImpl _tagsDao = ComponentLocator.inject(ResourceTagsDaoImpl.class);
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
|
||||
protected ProjectDaoImpl() {
|
||||
AllFieldsSearch = createSearchBuilder();
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
|
|||
@DB
|
||||
public void persistDefaultValues() throws InternalErrorException {
|
||||
|
||||
fixupScriptFileAttribute();
|
||||
|
||||
// Create system user and admin user
|
||||
saveUser();
|
||||
|
||||
|
|
@ -703,6 +705,24 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
private void fixupScriptFileAttribute() {
|
||||
// TODO : this is a hacking fix to workaround that executable bit is not preserved in WAR package
|
||||
String scriptPath = Script.findScript("", "scripts/vm/systemvm/injectkeys.sh");
|
||||
if(scriptPath != null) {
|
||||
File file = new File(scriptPath);
|
||||
if(!file.canExecute()) {
|
||||
s_logger.info("Some of the shell script files may not have executable bit set. Fixup...");
|
||||
|
||||
String cmd = "chmod ugo+x " + scriptPath;
|
||||
s_logger.info("Executing " + cmd);
|
||||
String result = Script.runSimpleBashScript(cmd);
|
||||
if (result != null) {
|
||||
s_logger.warn("Failed to fixup shell script executable bits " + result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateKeyPairsOnDisk(String homeDir) {
|
||||
File keyDir = new File(homeDir + "/.ssh");
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
// under the License.
|
||||
package com.cloud.servlet;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
|
|
@ -31,10 +34,22 @@ public class CloudStartupServlet extends HttpServlet {
|
|||
public static final Logger s_logger = Logger.getLogger(CloudStartupServlet.class.getName());
|
||||
static final long serialVersionUID = SerialVersionUID.CloudStartupServlet;
|
||||
|
||||
Timer _timer = new Timer();
|
||||
|
||||
@Override
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
LogUtils.initLog4j("log4j-cloud.xml");
|
||||
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
|
||||
ComponentContext.initComponentsLifeCycle();
|
||||
|
||||
// wait when condition is ready for initialization
|
||||
_timer.scheduleAtFixedRate(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(ComponentContext.getApplicationContext() != null) {
|
||||
_timer.cancel();
|
||||
ComponentContext.initComponentsLifeCycle();
|
||||
}
|
||||
}
|
||||
}, 0, 1000);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,16 +35,14 @@ import com.cloud.storage.Snapshot.Type;
|
|||
import com.cloud.storage.SnapshotVO;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.VolumeVO;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.GenericSearchBuilder;
|
||||
import com.cloud.utils.db.*;
|
||||
import com.cloud.utils.db.JoinBuilder.JoinType;
|
||||
import com.cloud.utils.db.SearchCriteria.Func;
|
||||
import com.cloud.vm.VMInstanceVO;
|
||||
import com.cloud.vm.dao.VMInstanceDao;
|
||||
import com.cloud.vm.dao.VMInstanceDaoImpl;
|
||||
|
||||
@Component
|
||||
|
|
@ -66,10 +64,10 @@ public class SnapshotDaoImpl extends GenericDaoBase<SnapshotVO, Long> implements
|
|||
private SearchBuilder<SnapshotVO> InstanceIdSearch;
|
||||
private SearchBuilder<SnapshotVO> StatusSearch;
|
||||
private GenericSearchBuilder<SnapshotVO, Long> CountSnapshotsByAccount;
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
|
||||
@Inject protected VMInstanceDaoImpl _instanceDao;
|
||||
@Inject protected VolumeDaoImpl _volumeDao;
|
||||
@Inject protected VMInstanceDao _instanceDao;
|
||||
@Inject protected VolumeDao _volumeDao;
|
||||
|
||||
@Override
|
||||
public SnapshotVO findNextSnapshot(long snapshotId) {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.cloud.storage.Volume.Event;
|
|||
import com.cloud.storage.Volume.State;
|
||||
import com.cloud.storage.Volume.Type;
|
||||
import com.cloud.storage.VolumeVO;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.db.DB;
|
||||
|
|
@ -61,8 +62,7 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
|
|||
protected final SearchBuilder<VolumeVO> InstanceStatesSearch;
|
||||
protected final SearchBuilder<VolumeVO> AllFieldsSearch;
|
||||
protected GenericSearchBuilder<VolumeVO, Long> CountByAccount;
|
||||
// ResourceTagsDaoImpl _tagsDao = ComponentLocator.inject(ResourceTagsDaoImpl.class);
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
|
||||
protected static final String SELECT_VM_SQL = "SELECT DISTINCT instance_id from volumes v where v.host_id = ? and v.mirror_state = ?";
|
||||
protected static final String SELECT_HYPERTYPE_FROM_VOLUME = "SELECT c.hypervisor_type from volumes v, storage_pool s, cluster c where v.pool_id = s.id and s.cluster_id = c.id and v.id = ?";
|
||||
|
|
|
|||
|
|
@ -25,15 +25,19 @@ import javax.inject.Inject;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.host.dao.HostDaoImpl;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.dao.RouterNetworkDao;
|
||||
import com.cloud.network.dao.RouterNetworkDaoImpl;
|
||||
import com.cloud.network.dao.RouterNetworkVO;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.network.router.VirtualRouter.Role;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDao;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
|
||||
import com.cloud.user.UserStatisticsVO;
|
||||
import com.cloud.user.dao.UserStatisticsDao;
|
||||
import com.cloud.user.dao.UserStatisticsDaoImpl;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
|
@ -57,10 +61,10 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
|
|||
protected SearchBuilder<DomainRouterVO> HostUpSearch;
|
||||
protected SearchBuilder<DomainRouterVO> StateNetworkTypeSearch;
|
||||
protected SearchBuilder<DomainRouterVO> OutsidePodSearch;
|
||||
@Inject HostDaoImpl _hostsDao;
|
||||
@Inject RouterNetworkDaoImpl _routerNetworkDao;
|
||||
@Inject UserStatisticsDaoImpl _userStatsDao;
|
||||
@Inject NetworkOfferingDaoImpl _offDao;
|
||||
@Inject HostDao _hostsDao;
|
||||
@Inject RouterNetworkDao _routerNetworkDao;
|
||||
@Inject UserStatisticsDao _userStatsDao;
|
||||
@Inject NetworkOfferingDao _offDao;
|
||||
protected SearchBuilder<DomainRouterVO> VpcSearch;
|
||||
|
||||
public DomainRouterDaoImpl() {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import com.cloud.configuration.Resource;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
import com.cloud.tags.dao.ResourceTagDao;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
|
@ -79,7 +80,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
|||
protected SearchBuilder<UserVmVO> UserVmByIsoSearch;
|
||||
protected Attribute _updateTimeAttr;
|
||||
// ResourceTagsDaoImpl _tagsDao = ComponentLocator.inject(ResourceTagsDaoImpl.class);
|
||||
@Inject ResourceTagsDaoImpl _tagsDao;
|
||||
@Inject ResourceTagDao _tagsDao;
|
||||
|
||||
private static final String LIST_PODS_HAVING_VMS_FOR_ACCOUNT = "SELECT pod_id FROM cloud.vm_instance WHERE data_center_id = ? AND account_id = ? AND pod_id IS NOT NULL AND (state = 'Running' OR state = 'Stopped') " +
|
||||
"GROUP BY pod_id HAVING count(id) > 0 ORDER BY count(id) DESC";
|
||||
|
|
|
|||
|
|
@ -188,4 +188,10 @@ public class MockAgentManagerImpl extends ManagerBase implements AgentManager {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnectWithInvestigation(long hostId, Event event) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -425,23 +425,32 @@ public class ConsoleProxy {
|
|||
synchronized (connectionMap) {
|
||||
ConsoleProxyClient viewer = connectionMap.get(clientKey);
|
||||
if (viewer == null) {
|
||||
authenticationExternally(param);
|
||||
viewer = new ConsoleProxyVncClient();
|
||||
viewer.initClient(param);
|
||||
|
||||
connectionMap.put(clientKey, viewer);
|
||||
s_logger.info("Added viewer object " + viewer);
|
||||
reportLoadChange = true;
|
||||
} else if (!viewer.isFrontEndAlive()) {
|
||||
s_logger.info("The rfb thread died, reinitializing the viewer " + viewer);
|
||||
viewer.initClient(param);
|
||||
} else if (!param.getClientHostPassword().equals(viewer.getClientHostPassword())) {
|
||||
s_logger.warn("Bad sid detected(VNC port may be reused). sid in session: "
|
||||
+ viewer.getClientHostPassword() + ", sid in request: " + param.getClientHostPassword());
|
||||
viewer.initClient(param);
|
||||
} else {
|
||||
if(ajaxSession == null || ajaxSession.isEmpty())
|
||||
} else {
|
||||
// protected against malicous attack by modifying URL content
|
||||
if(ajaxSession != null) {
|
||||
long ajaxSessionIdFromUrl = Long.parseLong(ajaxSession);
|
||||
if(ajaxSessionIdFromUrl != viewer.getAjaxSessionId())
|
||||
throw new AuthenticationException ("Cannot use the existing viewer " +
|
||||
viewer + ": modified AJAX session id");
|
||||
}
|
||||
|
||||
if(param.getClientHostPassword() == null || param.getClientHostPassword().isEmpty() || !param.getClientHostPassword().equals(viewer.getClientHostPassword()))
|
||||
throw new AuthenticationException ("Cannot use the existing viewer " +
|
||||
viewer + ": bad sid");
|
||||
|
||||
if(!viewer.isFrontEndAlive()) {
|
||||
authenticationExternally(param);
|
||||
}
|
||||
viewer.initClient(param);
|
||||
reportLoadChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(reportLoadChange) {
|
||||
ConsoleProxyClientStatsCollector statsCollector = getStatsCollector();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ from marvin.integration.lib.utils import *
|
|||
from marvin.integration.lib.base import *
|
||||
from marvin.integration.lib.common import *
|
||||
from marvin import remoteSSHClient
|
||||
from nose.plugins.attrib import attr
|
||||
import datetime
|
||||
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ class Services:
|
|||
"privateport": 22,
|
||||
"protocol": 'TCP',
|
||||
},
|
||||
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -112,7 +113,7 @@ class TestAccounts(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ from marvin.cloudstackAPI import *
|
|||
from marvin.integration.lib.utils import *
|
||||
from marvin.integration.lib.base import *
|
||||
from marvin.integration.lib.common import *
|
||||
from nose.plugins.attrib import attr
|
||||
import datetime
|
||||
|
||||
|
||||
|
|
@ -74,7 +75,7 @@ class Services:
|
|||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"templatefilter": 'self',
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -87,7 +88,7 @@ class TestAllocationState(cloudstackTestCase):
|
|||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.api_client = super(
|
||||
TestResources,
|
||||
TestAllocationState,
|
||||
cls
|
||||
).getClsTestClient().getApiClient()
|
||||
cls.services = Services().services
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class Services:
|
|||
"templates": {
|
||||
"displaytext": 'Template from snapshot',
|
||||
"name": 'Template from snapshot',
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"templatefilter": 'self',
|
||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
||||
"hypervisor": 'XenServer',
|
||||
|
|
@ -98,7 +98,7 @@ class Services:
|
|||
"endport": 22,
|
||||
"protocol": "TCP"
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"mode": 'advanced',
|
||||
|
|
@ -122,7 +122,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["volume"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -546,7 +546,7 @@ class TestNATRules(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
#Create an account, network, VM and IP addresses
|
||||
cls.account = Account.create(
|
||||
|
|
@ -740,7 +740,7 @@ class TestRouters(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
|
||||
# Create an account, domain etc
|
||||
|
|
@ -866,7 +866,7 @@ class TestRouterRestart(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -996,7 +996,7 @@ class TestTemplates(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.account = Account.create(
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class Services:
|
|||
"password": "password",
|
||||
"ipaddress": "192.168.100.21"
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# CentOS 5.3 (64-bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -160,7 +160,7 @@ class TestDefaultSecurityGroupEgress(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -318,7 +318,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -475,7 +475,7 @@ class TestDefaultGroupEgress(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -675,7 +675,7 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -857,7 +857,7 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -1118,7 +1118,7 @@ class TestInvalidAccountAuthroize(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -1239,7 +1239,7 @@ class TestMultipleAccountsEgressRuleNeg(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -1486,7 +1486,7 @@ class TestMultipleAccountsEgressRule(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -1782,7 +1782,7 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -1993,7 +1993,7 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -2179,7 +2179,7 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class Services:
|
|||
"username": 'nsroot',
|
||||
"password": 'nsroot'
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -100,7 +100,7 @@ class TestEIP(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||
|
|
@ -922,7 +922,7 @@ class TestELB(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class Services:
|
|||
"publicport": 22,
|
||||
"protocol": 'TCP',
|
||||
},
|
||||
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -161,7 +161,7 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||
|
|
@ -739,7 +739,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||
|
|
@ -1374,7 +1374,7 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||
|
|
@ -1830,7 +1830,7 @@ class TestSharedNetworkWithoutIp(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["template"] = cls.template.id
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class Services:
|
|||
"template": {
|
||||
"displaytext": "Public Template",
|
||||
"name": "Public template",
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
||||
"hypervisor": 'XenServer',
|
||||
"format": 'VHD',
|
||||
|
|
@ -98,7 +98,7 @@ class Services:
|
|||
"configs": {
|
||||
"project.invite.timeout": 300,
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class Services:
|
|||
"template": {
|
||||
"displaytext": "Cent OS Template",
|
||||
"name": "Cent OS Template",
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"templatefilter": 'self',
|
||||
},
|
||||
"network_offering": {
|
||||
|
|
@ -112,7 +112,7 @@ class Services:
|
|||
"name": "Test Network",
|
||||
"displaytext": "Test Network",
|
||||
},
|
||||
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -485,7 +485,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -924,7 +924,7 @@ class TestMaxProjectNetworks(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class Services:
|
|||
"template": {
|
||||
"displaytext": "Cent OS Template",
|
||||
"name": "Cent OS Template",
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"templatefilter": 'self',
|
||||
"ispublic": False,
|
||||
},
|
||||
|
|
@ -130,7 +130,7 @@ class Services:
|
|||
"endport": 22,
|
||||
"cidrlist": '0.0.0.0/0',
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -152,7 +152,7 @@ class TestOfferings(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ class TestNetwork(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -520,7 +520,7 @@ class TestTemplates(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -895,7 +895,7 @@ class TestPublicIpAddress(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1194,7 +1194,7 @@ class TestSecurityGroup(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class Services:
|
|||
"templates": {
|
||||
"displaytext": 'Template',
|
||||
"name": 'Template',
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"templatefilter": 'self',
|
||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2"
|
||||
},
|
||||
|
|
@ -87,7 +87,7 @@ class Services:
|
|||
"isextractable": True,
|
||||
"isfeatured": True,
|
||||
"ispublic": True,
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
},
|
||||
"lbrule": {
|
||||
"name": "SSH",
|
||||
|
|
@ -105,7 +105,7 @@ class Services:
|
|||
"username": "test",
|
||||
"password": "test",
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -129,7 +129,7 @@ class TestVmUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -323,7 +323,7 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
cls.services["server"]["diskoffering"] = cls.disk_offering.id
|
||||
|
|
@ -678,7 +678,7 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
cls.account = Account.create(
|
||||
|
|
@ -996,7 +996,7 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1179,7 +1179,7 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1537,7 +1537,7 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class Services:
|
|||
"publicport": 22,
|
||||
"protocol": 'TCP',
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -1451,7 +1451,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
configs = Configurations.list(
|
||||
cls.api_client,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class Services:
|
|||
"template": {
|
||||
"displaytext": "Cent OS Template",
|
||||
"name": "Cent OS Template",
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"templatefilter": 'self',
|
||||
},
|
||||
"network_offering": {
|
||||
|
|
@ -101,7 +101,7 @@ class Services:
|
|||
"name": "test network",
|
||||
"displaytext": "test network"
|
||||
},
|
||||
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -122,7 +122,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -885,7 +885,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1341,7 +1341,7 @@ class TestMaxAccountNetworks(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class Services:
|
|||
"cidr": '55.55.0.0/11',
|
||||
# Any network (For creating FW rule
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Used for Get_Template : CentOS 5.3 (64 bit)
|
||||
"mode": 'advanced', # Networking mode: Advanced, basic
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ class TestRouterServices(cloudstackTestCase):
|
|||
cls.template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -595,7 +595,7 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -806,7 +806,7 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1017,7 +1017,7 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class Services:
|
|||
"endport": -1,
|
||||
"cidrlist": '0.0.0.0/0',
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# CentOS 5.3 (64-bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -129,7 +129,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -401,7 +401,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -536,7 +536,7 @@ class TestRevokeIngressRule(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -694,7 +694,7 @@ class TestDhcpOnlyRouter(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
|
|
@ -830,7 +830,7 @@ class TestdeployVMWithUserData(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
|
|
@ -989,7 +989,7 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
template = get_template(
|
||||
self.apiclient,
|
||||
self.zone.id,
|
||||
self.services["ostypeid"]
|
||||
self.services["ostype"]
|
||||
)
|
||||
|
||||
self.services["domainid"] = self.domain.id
|
||||
|
|
@ -1234,7 +1234,7 @@ class TestIngressRule(cloudstackTestCase):
|
|||
template = get_template(
|
||||
self.apiclient,
|
||||
self.zone.id,
|
||||
self.services["ostypeid"]
|
||||
self.services["ostype"]
|
||||
)
|
||||
|
||||
self.services["domainid"] = self.domain.id
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class Services:
|
|||
0: {
|
||||
"displaytext": "Public Template",
|
||||
"name": "Public template",
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2",
|
||||
"hypervisor": 'XenServer',
|
||||
"format": 'VHD',
|
||||
|
|
@ -89,12 +89,12 @@ class Services:
|
|||
"template": {
|
||||
"displaytext": "Cent OS Template",
|
||||
"name": "Cent OS Template",
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"templatefilter": 'self',
|
||||
},
|
||||
"templatefilter": 'self',
|
||||
"destzoneid": 2, # For Copy template (Destination zone)
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
"mode": 'advanced', # Networking mode: Advanced, basic
|
||||
|
|
@ -294,7 +294,7 @@ class TestTemplates(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.account = Account.create(
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class Services:
|
|||
"templates": {
|
||||
"displaytext": 'Template',
|
||||
"name": 'Template',
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"templatefilter": 'self',
|
||||
"url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2"
|
||||
},
|
||||
|
|
@ -83,7 +83,7 @@ class Services:
|
|||
"isextractable": True,
|
||||
"isfeatured": True,
|
||||
"ispublic": True,
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
},
|
||||
"lbrule": {
|
||||
"name": "SSH",
|
||||
|
|
@ -101,7 +101,7 @@ class Services:
|
|||
"username": "test",
|
||||
"password": "test",
|
||||
},
|
||||
"ostypeid": '01853327-513e-4508-9628-f1f55db1946f',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
# Cent OS 5.3 (64 bit)
|
||||
"sleep": 60,
|
||||
"timeout": 10,
|
||||
|
|
@ -122,7 +122,7 @@ class TestVmUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -459,7 +459,7 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
cls.services["server"]["diskoffering"] = cls.disk_offering.id
|
||||
|
|
@ -629,7 +629,7 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
cls.account = Account.create(
|
||||
|
|
@ -928,7 +928,7 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1090,7 +1090,7 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1255,7 +1255,7 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
@ -1416,7 +1416,7 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
|
|
|||
|
|
@ -79,14 +79,14 @@ class Services:
|
|||
"name": "testISO",
|
||||
"url": "http://iso.linuxquestions.org/download/504/1819/http/gd4.tuwien.ac.at/dsl-4.4.10.iso",
|
||||
# Source URL where ISO is located
|
||||
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
},
|
||||
"custom_volume": {
|
||||
"customdisksize": 2,
|
||||
"diskname": "Custom disk",
|
||||
},
|
||||
"sleep": 50,
|
||||
"ostypeid": 'bc66ada0-99e7-483b-befc-8fb0c2129b70',
|
||||
"ostype": 'CentOS 5.3 (64-bit)',
|
||||
"mode": 'advanced',
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ class TestAttachVolume(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -378,7 +378,7 @@ class TestAttachDetachVolume(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -623,7 +623,7 @@ class TestAttachVolumeISO(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -814,7 +814,7 @@ class TestVolumes(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
@ -1054,7 +1054,7 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
|
|||
template = get_template(
|
||||
cls.api_client,
|
||||
cls.zone.id,
|
||||
cls.services["ostypeid"]
|
||||
cls.services["ostype"]
|
||||
)
|
||||
cls.services["zoneid"] = cls.zone.id
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ echo 'cloud ALL=NOPASSWD:ALL' > /etc/sudoers.d/cloud
|
|||
echo 'UseDNS no' >> /etc/ssh/sshd_config
|
||||
|
||||
# Remove 5s grub timeout to speed up booting
|
||||
echo <<EOF > /etc/default/grub
|
||||
cat <<EOF > /etc/default/grub
|
||||
# If you change this file, run 'update-grub' afterwards to update
|
||||
# /boot/grub/grub.cfg.
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue