122 Commits

Author SHA1 Message Date
Sheng Yang
f89dd9050c IPv6: CLOUDSTACK-1113: Fix the mechanism to find the usable IP in the IPv6
The new policy is:
1. Generate a random IP.
2. Find the next available IP, start from the generated IP.
3. If we cannot find an available IP after certain times(10000 by default,
network.ipv6.search.retry.max) retry, give up.
2013-02-05 14:31:12 -08:00
Sheng Yang
2e236a8322 IPv6: Fix ip address in range check 2013-02-05 14:31:06 -08:00
Rohit Yadav
c9e764818b rat: Fix license headers on ucs plugin etc.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-02 08:57:16 -08:00
Kelven Yang
7bd8bec68a Sync javelin with master up to 894cb8f7d9fc8b5561754a9fa541fef8f235148a 2013-01-31 17:20:19 -08:00
frank
8416d81b99 Merge branch 'ucs' into javelin
Conflicts:
	api/src/org/apache/cloudstack/api/ApiConstants.java
	plugins/pom.xml
	utils/src/com/cloud/utils/exception/CloudRuntimeException.java
	utils/src/com/cloud/utils/exception/RuntimeCloudException.java
2013-01-31 14:44:07 -08:00
Sheng Yang
f9a68e7f15 IPv6: Add vlan overlap checking 2013-01-29 22:01:38 -08:00
Sheng Yang
0b62fc4c17 IPv6: Verify if requested IPv4/IPv6 addresses are valid
Also rename NetUtils.isValidIPv6() to NetUtils.isValidIpv6()
2013-01-29 19:08:09 -08:00
Sheng Yang
fa00ddf07e IPv6: Fix getIp6FromRange() 2013-01-27 19:07:44 -08:00
Sheng Yang
bd4bc025d1 IPv6: Accept IPv6 parameter for createNetworkCmd
Also ass public_ipv6_address for ipv6 address management.

Extend nics and vlans for ipv6 address.

Add dependency to com.googlecode.ipv6(java-ipv6).

Modify dhcpcommand for ipv6.
2013-01-26 23:14:15 -08:00
Alex Huang
1567a112fa unit test works again 2013-01-24 14:36:44 -08:00
Kelven Yang
2c5859dbd4 Bring javelin back to the status of being able to start System VMs after another round of master branch merge 2013-01-18 19:15:32 -08:00
frank
fb050894f5 CloudStack CLOUDSTACK-723
Enhanced baremetal servers support on Cisco UCS

able to dump xmlobject
2013-01-17 16:11:15 -08:00
Alex Huang
cbb7ff1c32 added missing files 2013-01-17 06:50:59 -08:00
Alex Huang
9759ad57f2 Commit the current changes to unit tests 2013-01-17 06:50:11 -08:00
frank
53473c07b9 CloudStack CLOUDSTACK-723
Enhanced baremetal servers support on Cisco UCS

introduce an python etree like xml helper.
Ok, this is not a new wheel. Frankly speaking, all Java XML API just suc**.
there are two popular types of XML API in java, one class is for data binding, JAXB,
XStream fall into this category. Another class is tree based, like JDOM, XOM ...

for XML api call, data binding library is painful as you have to specify the schema
that how xml stream converts to java object, which means you have to pre-define all
schemas(xsd file for JAXB, java object for XStream ...). This is not productive, because you
must add new schema when XML document grows.

Tree based library shines in this case, for it's able to dynamically create an object tree
from xml stream without any knowledge of its structure. However, all tree based
XML API library fall into below convention:

Element e = root.getChildElement("child1").getChildElement("child2").getChildElement("child3")...getChildElement("childN")

anything wrong with it???

the sadness is if there is no "child2", you will get a NPE with above code, which means you have to judge
before getting.

And, why so verbose?? why not:

Element e = root.child1.child2.child3...childN ???

Ok I am joking, it's impossible in Java the world knows Java is a static language.

but you can actually do:

Element e = root.get("child1.child2.child3");

or

List<Element> e = root.getAsList("child1.child2.child3")

this is known as XPath style(though XPATH use '/'), python etree has supported it.

so I did this toy for my UCS xml api call, it's quite like etree which is easy to use, for example:

<components.xml>
    <system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
        <checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
        <checker name="EncryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker"/>
        <checker name="DatabaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker"/>
        <checker name="DatabaseUpgradeChecker" class="com.cloud.upgrade.PremiumDatabaseUpgradeChecker"/>
    </system-integrity-checker>
</components.xml>

XmlObject xo = XmlObjectParser.parseFromFile("~/components.xml.in");
List<XmlObject> checkers = xo.getAsList("system-integrity-checker.checker");

then you get a list of XmlObject which represent each 'checker' element:

XmlObject firstChecker = checkers.get(0);
// firstChecker.get("name") == "ManagementServerNode"
// firstChecker.get("class") == "com.cloud.cluster.ManagementServerNode"
// firstChecker.getTag() == "checker"
// firstChecker.getText() == "" if it's <checker/>xxx</checker>, then getText() == "xxx"

example 2:
<checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
    <system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
        <checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
    </system-integrity-checker>
</components.xml>

yout can do:

XmlObject xo = XmlObjectParser.parseFromFile("~/components.xml.in");
XmlObject checker = xo.get("system-integrity-checker.checker");

then it returns a single object as we only have one "checker" in xml stream,

or you still do

List<XmlObject> checkers = xo.getAsList("system-integrity-checker.checker");

it returns a list which only contains one element of "checker"

if you do:

XmlObject checker = xo.get("system-integrity-checker.checker.this_middle_element_doesnt_exist.some_element");

it returns a null without any exception, so you don't have to worry if a parent element is missing when getting a leaf element

again it's not a new wheel, I just hate JAVA xml api
2013-01-16 16:27:21 -08:00
Rohit Yadav
ea3f5ecb54 Fix license for xml files in javelin
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-12 06:31:47 -08:00
Rohit Yadav
38eaa04b98 Pull changes from master into javelin
- Disables simulator plugin, breaks build, available via simulator profile
- Fixes spring injections
- Fix api,acl plugins, ApiServer, ApiDispatcher
- Fix other merge conflicts

Conflicts:
	docs/en-US/external-firewalls-and-load-balancers.xml
	plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
	utils/test/com/cloud/utils/log/CglibThrowableRendererTest.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-12 06:02:54 -08:00
Noa Resare
1033200b0b CLOUDSTACK-933: CglibThrowableRendererTest writing stack traces...
Improve CglibThrowableRenderer test case

Log to a separate Logger instead of the default one to avoid spurious
stack traces in test run output.

Actually verify that registering CglibThrowableRenderer with the
alternative log hierarchy actually removes call trace lines that
contains the string <generated>
2013-01-11 17:09:44 -05:00
Alex Huang
f922c6fc03 Keep removing 2013-01-10 14:46:52 -08:00
Alex Huang
56e5fbdee2 removed import of componentlocator and inject from all files 2013-01-10 11:44:47 -08:00
Alex Huang
f40e7b7511 removed componentlocator and inject 2013-01-10 11:05:20 -08:00
Alex Huang
cf8de7ee17 Removed all the .project files 2013-01-08 14:11:00 -08:00
Alex Huang
30f2565d98 Merge branch 'api_refactoring' into javelin 2013-01-08 12:36:04 -08:00
Chip Childers
bec00cce46 CLOUDSTACK-505: Converted regex expressions to pre-compiled Pattern objects
This was done for performance reasons.

I also refined the regex strings and added more test cases for different
string scenarios.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-12-17 23:01:19 -05:00
Chip Childers
44da7b1841 CLOUDSTACK-505: Reworked approach to cleaning request / response strings
As noted in the bug, several of the API command in question
are async calls.  I've added a simple regex-based string cleaning
function, and have the request and response strings running through
it prior to being appended to the audit log.

Unit tests added for the new cleaning function as well.

The call to skip logging the createSSHKeyPair response remains intact
for now, although it should probably be scrubbed similarly to the
password fields.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-12-17 14:11:09 -05:00
Kelven Yang
d79f1f6fdc Replace Adapters and PluggableServices, use Spring to load them 2012-11-07 15:03:24 -08:00
Kelven Yang
453b31f3f4 Refactor ComponentLocator to be based on Spring so that legacy way of loading component can coexist with Spring 2012-11-07 15:03:23 -08:00
Kelven Yang
0e9924fcee Add autowiring+AOP support to injected components 2012-11-07 15:03:23 -08:00
Kelven Yang
d70154609a Wire up injection for dynamically constructed objects 2012-10-29 16:16:07 -07:00
Kelven Yang
16ed8701da Test of using Spring DI to implement Basic/Premium configuration 2012-10-25 18:22:32 -07:00
Kelven Yang
c272cf6b69 add TransactionContextBuilder based on Spring AOP 2012-10-25 15:01:12 -07:00
Min Chen
7b7f4cd1fd CLOUDSTACK-409: ThreadLocal Transaction and its db connection got reset for user managed db connnection, causing ClusterHeartBeat thread frequently trying to get db connection. Add unit test to test user managed transaction. 2012-10-25 13:06:50 -07:00
Chiradeep Vittal
5b85edb961 bug CS-16034 getRandomIp can return -1 unexpectedly
also fixes unit test failures
2012-08-16 11:42:25 -07:00
Alena Prokharchyk
048c5e50cf Merge branch 'master' into vpc
Conflicts:
	utils/test/com/cloud/utils/component/MockComponentLocator.java
2012-08-08 11:50:39 -07:00
Alex Huang
57b57703eb fixed broken unit test 2012-08-07 17:38:05 -07:00
Alena Prokharchyk
d38e9eebed VPC: CS-15850 - don't unplug the nic for public network when there are existing ips in the same vlan having network rules
Conflicts:

	server/src/com/cloud/network/vpc/VpcManagerImpl.java
2012-08-07 11:25:02 -07:00
Alena Prokharchyk
cf64fda5d5 VPC: unittest preparation
Conflicts:

	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/test/com/cloud/network/MockNetworkManagerImpl.java
2012-08-07 11:23:52 -07:00
Sheng Yang
84a1a311f9 S2S VPN: CS-15511: Add PFS support for VPN connection 2012-08-06 15:27:13 -07:00
Alena Prokharchyk
5a72044dc7 Merge branch 'master' into vpc 2012-08-03 14:30:54 -07:00
Chip Childers
95ce55f0a1 License header updates for the utils folder 2012-08-03 14:15:09 -04:00
Sheng Yang
e9ae7336c1 CS-15649: Remove DES from s2s vpn support policy
DES is considered INSECURE.
2012-07-20 10:53:42 -07:00
Sheng Yang
c0fcca3990 CS-15511: Not allow pfs parameter for customer VPN gateway 2012-07-19 15:10:31 -07:00
Sheng Yang
94c62f2127 CS-15513: Fix group 5 of s2s vpn
Conflicts:

	utils/test/com/cloud/utils/net/NetUtilsTest.java
2012-07-10 10:38:17 -07:00
Sheng Yang
24c480f9e6 CS-6840: Add commands for site-to-site vpn
Conflicts:

	api/src/com/cloud/api/BaseCmd.java
	api/src/com/cloud/api/ResponseGenerator.java
	client/tomcatconf/commands.properties.in
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	utils/test/com/cloud/utils/net/NetUtilsTest.java
2012-07-02 16:26:34 -07:00
David Nalley
937a9f7c45 fixing utils license header 2012-06-06 23:06:02 -04:00
David Nalley
91fadc4a0d fixing line ends in utils 2012-04-09 20:05:41 -04:00
frank
2f634c0913 Switch to Apache license 2012-04-03 04:50:05 -07:00
Alex Huang
c42f50c4b0 Used a different way to allocate guest ip address. not in used yet. 2012-01-30 16:10:10 -08:00
Alex Huang
ddbcd01f56 fixed up unit test 2011-11-11 14:15:13 -08:00
Alex Huang
f6fcaa49ec Merge complete except for virtualnetworkappliancemanager 2011-11-10 15:18:16 -08:00