diff --git a/build.xml b/build.xml index 1a6ae190fb9..e9e4bef6145 100755 --- a/build.xml +++ b/build.xml @@ -27,4 +27,5 @@ + diff --git a/build/build-aws-api.properties b/build/build-aws-api.properties new file mode 100644 index 00000000000..38362661910 --- /dev/null +++ b/build/build-aws-api.properties @@ -0,0 +1,12 @@ +company.major.version=1 +company.minor.version=0 +company.patch.version=8 + +target.compat.version=1.6 +source.compat.version=1.6 + +debug=true +build.type=developer +debuglevel=lines,source,vars +deprecation=off + diff --git a/build/build-aws-api.xml b/build/build-aws-api.xml new file mode 100644 index 00000000000..bee02ce2a6f --- /dev/null +++ b/build/build-aws-api.xml @@ -0,0 +1,440 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build-cloud.xml b/build/build-cloud.xml index 259c98034d3..8467069197d 100755 --- a/build/build-cloud.xml +++ b/build/build-cloud.xml @@ -493,7 +493,7 @@ - + diff --git a/build/build-common.xml b/build/build-common.xml index d18c966483c..64be0fec68e 100755 --- a/build/build-common.xml +++ b/build/build-common.xml @@ -46,7 +46,7 @@ - + diff --git a/build/developer.xml b/build/developer.xml index 4e17bb9c79a..0fc0d7eb95d 100755 --- a/build/developer.xml +++ b/build/developer.xml @@ -125,7 +125,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -216,7 +216,7 @@ - + @@ -241,6 +241,9 @@ + + + diff --git a/build/package.xml b/build/package.xml index c7e184c3e26..0d892c33bf0 100755 --- a/build/package.xml +++ b/build/package.xml @@ -139,7 +139,7 @@ - + diff --git a/build/replace.properties b/build/replace.properties index 47724fd9e22..7c5fd3de052 100644 --- a/build/replace.properties +++ b/build/replace.properties @@ -7,3 +7,4 @@ AGENTLOGDIR=logs AGENTLOG=logs/agent.log MSMNTDIR=/mnt COMPONENTS-SPEC=components-premium.xml +AWSAPILOG=awsapi.log diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 41f0b8876e5..a939eb7751a 100755 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -9,6 +9,7 @@ disableAccount=com.cloud.api.commands.DisableAccountCmd;7 enableAccount=com.cloud.api.commands.EnableAccountCmd;7 ###lockAccount=com.cloud.api.commands.LockAccountCmd;7 listAccounts=com.cloud.api.commands.ListAccountsCmd;15 +markDefaultZoneForAccount=com.cloud.api.commands.MarkDefaultZoneForAccountCmd;1 #### User commands createUser=com.cloud.api.commands.CreateUserCmd;3 diff --git a/client/tomcatconf/db.properties.in b/client/tomcatconf/db.properties.in index 9c099dc0e3d..f74a46a7a1a 100644 --- a/client/tomcatconf/db.properties.in +++ b/client/tomcatconf/db.properties.in @@ -49,3 +49,6 @@ db.usage.maxActive=100 db.usage.maxIdle=30 db.usage.maxWait=10000 db.usage.autoReconnect=true + +# awsapi database settings +db.awsapi.name=cloudbridge diff --git a/client/tomcatconf/log4j-cloud.xml.in b/client/tomcatconf/log4j-cloud.xml.in index 0876507796a..8af720231aa 100755 --- a/client/tomcatconf/log4j-cloud.xml.in +++ b/client/tomcatconf/log4j-cloud.xml.in @@ -33,6 +33,17 @@ + + + + + + + + + + + @@ -92,6 +103,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/client/tomcatconf/server-nonssl.xml b/client/tomcatconf/server-nonssl.xml index 6eba083c116..0b627b228cd 100755 --- a/client/tomcatconf/server-nonssl.xml +++ b/client/tomcatconf/server-nonssl.xml @@ -54,6 +54,8 @@ + diff --git a/client/tomcatconf/server.xml.in b/client/tomcatconf/server.xml.in new file mode 100644 index 00000000000..71b98a9e197 --- /dev/null +++ b/client/tomcatconf/server.xml.in @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cloud.spec b/cloud.spec index 8a298e477fb..f1f44b69ef4 100644 --- a/cloud.spec +++ b/cloud.spec @@ -128,6 +128,7 @@ Requires: %{name}-setup = %{version} # reqs the agent-scripts package because of xenserver within the management server Requires: %{name}-agent-scripts = %{version} Requires: %{name}-python = %{version} +Requires: %{name}-aws-api = %{version} # for consoleproxy # Requires: %{name}-agent Requires: tomcat6 @@ -271,6 +272,14 @@ Group: System Environment/Libraries The CloudStack usage monitor provides usage accounting across the entire cloud for cloud operators to charge based on usage parameters. +%package aws-api +Summary: CloudStack CloudBridge +Group: System Environment/Libraries +Requires: java >= 1.6.0 +Requires: tomcat6 +Obsoletes: cloud-bridge < %{version}-%{release} +%description aws-api +This is the CloudStack CloudBridge %prep @@ -293,6 +302,7 @@ echo Doing CloudStack build rm $RPM_BUILD_ROOT/etc/rc.d/init.d/cloud-console-proxy rm $RPM_BUILD_ROOT/usr/bin/cloud-setup-console-proxy rm $RPM_BUILD_ROOT/usr/libexec/console-proxy-runner +./tools/ant/apache-ant-1.7.1/bin/ant deploy-rpm-install -Drpm.install.dir=$RPM_BUILD_ROOT %clean @@ -373,6 +383,32 @@ else /sbin/service %{name}-agent condrestart >/dev/null 2>&1 || true fi +%post client +if [ "$1" == "1" ] ; then + /sbin/chkconfig --add %{name}-management > /dev/null 2>&1 || true + /sbin/chkconfig --level 345 %{name}-management on > /dev/null 2>&1 || true +fi + +if [ "$1" == "1" ] ; then + root=/usr/share/cloud/bridge + target=/usr/share/cloud/management/ + + if [ ! -e $target/webapps/awsapi ]; then + ln -s $root/webapps/awsapi $target/webapps/awsapi + fi + + jars=`ls $root/lib` + for j in $jars + do + cp -f $root/lib/$j $root/webapps/awsapi/WEB-INF/lib/ + done + + confs="cloud-bridge.properties ec2-service.properties hibernate.cfg.xml CloudStack.cfg.xml" + for c in $confs + do + cp -f $root/conf/$c $target/conf + done +fi %files utils %defattr(0644,root,root,0755) @@ -432,7 +468,7 @@ fi %{_javadir}/jetty-util-6.1.26.jar %{_javadir}/%{name}-axis.jar %{_javadir}/%{name}-commons-discovery.jar -%{_javadir}/%{name}-wsdl4j.jar +%{_javadir}/%{name}-wsdl4j-1.6.2.jar %{_javadir}/%{name}-bcprov-jdk16-1.45.jar %{_javadir}/%{name}-jsch-0.1.42.jar %{_javadir}/%{name}-iControl.jar @@ -539,6 +575,15 @@ fi %config(noreplace) %{_sysconfdir}/%{name}/usage/log4j-%{name}_usage.xml %config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/usage/db.properties +%files aws-api +%defattr(0644,cloud,cloud,0755) +%{_datadir}/cloud/bridge/conf/* +%{_datadir}/cloud/bridge/lib/* +%{_datadir}/cloud/bridge/webapps/* +%attr(0644,root,root) %{_datadir}/cloud/setup/bridge/db/* +%attr(0755,root,root) %{_bindir}/cloudstack-aws-api-register +%attr(0755,root,root) %{_bindir}/cloud-setup-bridge + %changelog * Mon May 3 2010 Manuel Amador (Rudd-O) 1.9.12 - Bump version for RC4 release diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index 94cfafe7e6b..dd225644f5c 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -1233,8 +1233,10 @@ CREATE TABLE `cloud`.`account` ( `removed` datetime COMMENT 'date removed', `cleanup_needed` tinyint(1) NOT NULL default '0', `network_domain` varchar(255), + `default_zone_id` bigint unsigned, PRIMARY KEY (`id`), INDEX i_account__removed(`removed`), + CONSTRAINT `fk_account__default_zone_id` FOREIGN KEY `fk_account__default_zone_id`(`default_zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE, CONSTRAINT `uc_account__uuid` UNIQUE (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/setup/db/db/schema-302to303.sql b/setup/db/db/schema-302to303.sql index e3a295deed7..4e76dc73055 100755 --- a/setup/db/db/schema-302to303.sql +++ b/setup/db/db/schema-302to303.sql @@ -118,4 +118,9 @@ DELETE FROM `cloud`.`configuration` WHERE name='xen.min.product.version'; DELETE FROM `cloud`.`configuration` WHERE name='xen.min.version'; DELETE FROM `cloud`.`configuration` WHERE name='xen.min.xapi.version'; +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.ec2.api', 'false', 'enable EC2 API on CloudStack'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.s3.api', 'false', 'enable Amazon S3 API on CloudStack'); +ALTER TABLE `cloud`.`account` ADD COLUMN `default_zone_id` bigint unsigned; +ALTER TABLE `cloud`.`account` ADD CONSTRAINT `fk_account__default_zone_id` FOREIGN KEY `fk_account__default_zone_id`(`default_zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE; + DELETE FROM `cloud`.`storage_pool_host_ref` WHERE pool_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL); diff --git a/wscript_build b/wscript_build index ecee490d1c9..352d68dc2c2 100644 --- a/wscript_build +++ b/wscript_build @@ -77,7 +77,7 @@ def build_jars (): "cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar", "cloud-ws-commons-util-1.0.2.jar", "cloud-commons-collections-3.2.1.jar", "vmware*.jar", "cloud-secstorage-extras.jar", - "cloud-agent-simulator.jar"] + "cloud-agent-simulator.jar", "cloud-awsapi.jar", "cloud-test.jar", "cloud-wsdl4j.jar"] for a in jars_str: if _basename (a).startswith ("cloud-") \ @@ -112,7 +112,7 @@ def build_thirdparty_dir (): def build_dependences (): excludes = ["cloud-xstream-1.3.1.jar", "cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar", "cloud-ws-commons-util-1.0.2.jar", - "cloud-commons-collections-3.2.1.jar"] + "cloud-commons-collections-3.2.1.jar", "cloud-wsdl4j.jar"] start_path = bld.path.find_dir ("deps") bld.install_files('${JAVADIR}',start_path.ant_glob("*.jar", excl = excludes), cwd=start_path) diff --git a/wscript_configure b/wscript_configure index 82457247ca4..4f6f69a165d 100644 --- a/wscript_configure +++ b/wscript_configure @@ -231,6 +231,7 @@ conf.env.CPSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CPPATH}"),conf conf.env.CPLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${CPPATH}"),conf.env) conf.env.MSLOG = _join(conf.env.MSLOGDIR,"management-server.log") +conf.env.AWSAPILOG = _join(conf.env.MSLOGDIR,"awsapi.log") conf.env.APISERVERLOG = _join(conf.env.MSLOGDIR,"api-server.log") conf.env.AGENTLOG = _join(conf.env.AGENTLOGDIR,"agent.log") conf.env.USAGELOG = _join(conf.env.USAGELOGDIR,"usage.log")