Permalink
Browse files

merged latest changes from 1.6-vmware-broker (critical bug for non-te…

…mplate-based instances)
  • Loading branch information...
1 parent 6f68b8b commit bcfe5865172512eaa0ead93af9ea91f3a6b4b769 root committed Feb 3, 2010
Showing with 225 additions and 17 deletions.
  1. +144 −0 1.6-vmware-broker-script.txt
  2. +7 −0 eucalyptus.spec
  3. +16 −0 rpm_build.sh
  4. +2 −2 storage/Makefile
  5. +27 −3 storage/Wclient.c
  6. +21 −3 storage/http.c
  7. +5 −6 storage/img.c
  8. +3 −3 storage/walrus.c
@@ -0,0 +1,144 @@
+/******************************************************************************/
+/* Generated by Zelix KlassMaster 5.3.0 ZKM Script Helper 2009.12.23 18:10:00 */
+/******************************************************************************/
+
+classpath "/usr/lib/jvm/java-6-openjdk/jre/lib/resources.jar"
+ "/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar"
+ "/usr/lib/jvm/java-6-openjdk/jre/lib/jsse.jar"
+ "/usr/lib/jvm/java-6-openjdk/jre/lib/jce.jar"
+ "/usr/lib/jvm/java-6-openjdk/jre/lib/charsets.jar"
+ "/usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar"
+ "/usr/share/eucalyptus/activation-1.1.1.jar"
+ "/usr/share/eucalyptus/ant-1.7.jar"
+ "/usr/share/eucalyptus/antlr3-3.0.1+dfsg.jar"
+ "/usr/share/eucalyptus/antlrall.jar"
+ "/usr/share/eucalyptus/asm2-2.2.3.jar"
+ "/usr/share/eucalyptus/avalon-framework-4.2.0.jar"
+ "/usr/share/eucalyptus/axiom-api-1.2.8.jar"
+ "/usr/share/eucalyptus/axiom-dom-1.2.8.jar"
+ "/usr/share/eucalyptus/axiom-impl-1.2.8.jar"
+ "/usr/share/eucalyptus/backport-util-concurrent-2.2.jar"
+ "/usr/share/eucalyptus/bcel-5.2.jar"
+ "/usr/share/eucalyptus/bcprov.jar"
+ "/usr/share/eucalyptus/bsf-2.4.0.jar"
+ "/usr/share/eucalyptus/c3p0-0.9.1.2.jar"
+ "/usr/share/eucalyptus/cglib-2.1.3.jar"
+ "/usr/share/eucalyptus/commons-beanutils-1.8.0-BETA.jar"
+ "/usr/share/eucalyptus/commons-cli-1.1.jar"
+ "/usr/share/eucalyptus/commons-codec-1.3.jar"
+ "/usr/share/eucalyptus/commons-collections3-3.2.1.jar"
+ "/usr/share/eucalyptus/commons-discovery-0.4.jar"
+ "/usr/share/eucalyptus/commons-fileupload-1.2.1.jar"
+ "/usr/share/eucalyptus/commons-httpclient-3.1.jar"
+ "/usr/share/eucalyptus/commons-io-1.4.jar"
+ "/usr/share/eucalyptus/commons-jxpath-1.2.jar"
+ "/usr/share/eucalyptus/commons-lang-2.4.jar"
+ "/usr/share/eucalyptus/commons-logging-1.1.1.jar"
+ "/usr/share/eucalyptus/commons-logging-adapters-1.1.1.jar"
+ "/usr/share/eucalyptus/commons-logging-api-1.1.1.jar"
+ "/usr/share/eucalyptus/commons-pool-1.4.jar"
+ "/usr/share/eucalyptus/dnsjava-2.0.6.jar"
+ "/usr/share/eucalyptus/dom4j-1.6.1.jar"
+ "/usr/share/eucalyptus/drools-compiler-4.0.7.jar"
+ "/usr/share/eucalyptus/drools-core-4.0.7.jar"
+ "/usr/share/eucalyptus/ecj.jar"
+ "/usr/share/eucalyptus/el-api-2.1.jar"
+ "/usr/share/eucalyptus/eucalyptus-auth-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-cloud-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-clustermgr-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-commons-ext-0.4.jar"
+ "/usr/share/eucalyptus/eucalyptus-config-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-core-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-dns-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-groupmgr-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-imagemgr-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-interface-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-keymgr-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-msgs-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-storage-common-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-storagecontroller-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-vmware-broker-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-walrus-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-ws-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/eucalyptus-www-1.6-devel-vmware-broker.jar"
+ "/usr/share/eucalyptus/excalibur-logkit.jar"
+ "/usr/share/eucalyptus/ezmorph-1.0.5.jar"
+ "/usr/share/eucalyptus/geronimo-activation-1.1-spec-1.0.1.jar"
+ "/usr/share/eucalyptus/geronimo-ejb-3.0-spec-1.0.1.jar"
+ "/usr/share/eucalyptus/geronimo-j2ee-connector-1.5-spec-1.1.jar"
+ "/usr/share/eucalyptus/geronimo-jms-1.1-spec-1.1.jar"
+ "/usr/share/eucalyptus/geronimo-jpa-3.0-spec-1.1.1.jar"
+ "/usr/share/eucalyptus/geronimo-jta-1.0.1b-spec-1.1.jar"
+ "/usr/share/eucalyptus/geronimo-stax-1.0-spec-1.0.1.jar"
+ "/usr/share/eucalyptus/gnumail-providers.jar"
+ "/usr/share/eucalyptus/gnumail.jar"
+ "/usr/share/eucalyptus/google-collect-20080808.jar"
+ "/usr/share/eucalyptus/groovy-1.6.3.jar"
+ "/usr/share/eucalyptus/gwt-dev-linux-1.6.4.jar"
+ "/usr/share/eucalyptus/gwt-servlet-1.6.4.jar"
+ "/usr/share/eucalyptus/gwt-user-1.6.4.jar"
+ "/usr/share/eucalyptus/hsqldb-1.8.0.10.jar"
+ "/usr/share/eucalyptus/hsqldbutil-1.8.0.10.jar"
+ "/usr/share/eucalyptus/inetlib-1.1.1.jar"
+ "/usr/share/eucalyptus/janino-2.5.15-1.jar"
+ "/usr/share/eucalyptus/javassist-3.8.1.jar"
+ "/usr/share/eucalyptus/jaxen-1.1.1.jar"
+ "/usr/share/eucalyptus/jaxp-1.3.jar"
+ "/usr/share/eucalyptus/jcl-over-slf4j-1.5.2.jar"
+ "/usr/share/eucalyptus/jettison-1.0.jar"
+ "/usr/share/eucalyptus/jetty6-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-ajp-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-client-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-html-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-management-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-naming-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-rewrite-handler-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-servlet-tester-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-sslengine-6.1.19.jar"
+ "/usr/share/eucalyptus/jetty6-util-6.1.19.jar"
+ "/usr/share/eucalyptus/jibx-bind-1.1.6a.jar"
+ "/usr/share/eucalyptus/jibx-extras-1.1.6a.jar"
+ "/usr/share/eucalyptus/jibx-run-1.1.6a.jar"
+ "/usr/share/eucalyptus/json-lib-2.2.2.jar"
+ "/usr/share/eucalyptus/jug-asl-2.0.0.jar"
+ "/usr/share/eucalyptus/jul-to-slf4j-1.5.2.jar"
+ "/usr/share/eucalyptus/junit-3.8.2.jar"
+ "/usr/share/eucalyptus/log4j-1.2.15.jar"
+ "/usr/share/eucalyptus/mvel-1.3.14.jar"
+ "/usr/share/eucalyptus/netty-3.1.0.CR1.jar"
+ "/usr/share/eucalyptus/openjdk-crypto.jar"
+ "/usr/share/eucalyptus/regexp-1.4.jar"
+ "/usr/share/eucalyptus/serializer.jar"
+ "/usr/share/eucalyptus/servlet-api-2.5.jar"
+ "/usr/share/eucalyptus/slf4j-api-1.5.2.jar"
+ "/usr/share/eucalyptus/slf4j-log4j12-1.5.2.jar"
+ "/usr/share/eucalyptus/vijava220090625.jar"
+ "/usr/share/eucalyptus/vim.jar"
+ "/usr/share/eucalyptus/vim25.jar"
+ "/usr/share/eucalyptus/wsdl4j-1.6.2.jar"
+ "/usr/share/eucalyptus/wss4j-1.5.7.jar"
+ "/usr/share/eucalyptus/xalan2.jar"
+ "/usr/share/eucalyptus/xercesImpl.jar"
+ "/usr/share/eucalyptus/xml-security-1.4.2.jar"
+ "/usr/share/eucalyptus/xom-1.1.jar"
+ "/usr/share/eucalyptus/xpp3-1.1.3.4.O.jar";
+
+open "/usr/share/eucalyptus/eucalyptus-vmware-broker-1.6-devel-vmware-broker.jar";
+
+/*trim deleteSourceFileAttributes=false*/
+/* deleteDeprecatedAttributes=true*/
+/* deleteAnnotationAttributes=false*/
+/* deleteUnknownAttributes=false;*/
+
+exclude *.* public static main(java.lang.String[]);
+
+obfuscate changeLogFileIn=""
+ changeLogFileOut="/tmp/ChangeLog.txt"
+ aggressiveMethodRenaming=true
+ keepGenericsInfo=true
+ obfuscateFlow=aggressive
+ encryptStringLiterals=flowObfuscate
+ collapsePackagesWithDefault=""
+ lineNumbers=delete;
+
+saveAll archiveCompression=all "/usr/src/ZKM/images";
View
@@ -150,13 +150,19 @@ This package contains the internal log service of eucalyptus.
%build
./configure --with-axis2=/opt/packages/axis2-1.4 --with-axis2c=/opt/euca-axis2c --enable-debug --prefix=/
+if [ -e rpm_build.sh ]; then
+ ./rpm_build.sh build
+fi
cd clc
make deps
cd ..
make 2> err.log > out.log
%install
make install
+if [ -e rpm_build.sh ]; then
+ ./rpm_build.sh install
+fi
ls /usr/share/eucalyptus/*jar > jar_list
%clean
@@ -622,3 +628,4 @@ fi
*Sat May 21 2008 mayhem group (support@open.eucalyptus.com)
- first release of eucalyptus
+
View
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+
+if [ "$1" = "build" ]; then
+ echo "$0 in build"
+ rm -f clc/modules/vmware-broker/src/main/java/edu/ucsb/eucalyptus/cloud/ws/BrokerLicenseTool.java
+fi
+
+if [ "$1" = "install" ]; then
+ echo "$0 in install"
+ rm -rf /usr/src/ZKM/images
+ java -jar /usr/src/ZKM/ZKM.jar /usr/src/ZKM/1.6-vmware-broker-script.txt
+ cp /usr/src/ZKM/images/eucalyptus-vmware-broker*.jar /usr/share/eucalyptus
+ vmware_client_class="`grep "^Class:" /tmp/ChangeLog.txt|grep VMwareClient|cut -f 3`"
+ sed -i "s/edu.ucsb.eucalyptus.cloud.ws.VMwareClient/$vmware_client_class/g" /usr/share/eucalyptus/euca_vmware
+fi
View
@@ -14,8 +14,8 @@ build: all
euca_imager: Makefile euca_imager.c $(IMAGER_LIBS)
$(CC) $(CFLAGS) $(INCLUDES) euca_imager.c -o euca_imager $(IMAGER_LIBS) -lcurl -lrt
-Wclient: Makefile Wclient.c ../util/euca_auth.o ../util/misc.o walrus.o
- $(CC) $(CFLAGS) $(INCLUDES) Wclient.c -o Wclient ../util/euca_auth.o ../util/misc.o walrus.o $(STORAGE_LIBS)
+Wclient: Makefile Wclient.c ../util/euca_auth.o ../util/misc.o walrus.o http.o
+ $(CC) $(CFLAGS) $(INCLUDES) Wclient.c -o Wclient ../util/euca_auth.o ../util/misc.o walrus.o http.o $(STORAGE_LIBS)
walrus.o: walrus.c walrus.h
$(CC) $(CFLAGS) $(INCLUDES) -c walrus.c
View
@@ -68,13 +68,14 @@ permission notice:
#include "eucalyptus.h"
#include "misc.h"
#include "walrus.h"
+#include "http.h"
#define BUFSIZE 4096 /* should be big enough for CERT and the signature */
#define STRSIZE 245 /* for short strings: files, hosts, URLs */
#define WALRUS_ENDPOINT "/services/Walrus"
#define DEFAULT_HOST_PORT "localhost:8773"
#define DEFAULT_COMMAND "GetObject"
-#define USAGE { fprintf (stderr, "Usage: Wclient [GetDecryptedImage|GetObject] -h [host:port] -m [manifest] -f [output file] [-z]\n"); exit (1); }
+#define USAGE { fprintf (stderr, "Usage: Wclient [GetDecryptedImage|GetObject|HttpPut] -h [host:port] -u [URL] -m [manifest] -f [in|out file] -l [login] -p [password] [-z]\n"); exit (1); }
char debug = 1;
int main (int argc, char * argv[])
@@ -83,10 +84,13 @@ int main (int argc, char * argv[])
char * hostport = NULL;
char * manifest = NULL;
char * file_name = NULL;
+ char * url = NULL;
+ char * login = NULL;
+ char * password = NULL;
int do_compress = 0;
int ch;
- while ((ch = getopt(argc, argv, "dh:m:f:z")) != -1) {
+ while ((ch = getopt(argc, argv, "dh:m:f:zu:l:p:")) != -1) {
switch (ch) {
case 'h':
hostport = optarg;
@@ -100,6 +104,15 @@ int main (int argc, char * argv[])
case 'f':
file_name = optarg;
break;
+ case 'u':
+ url = optarg;
+ break;
+ case 'l':
+ login = optarg;
+ break;
+ case 'p':
+ password = optarg;
+ break;
case 'z':
do_compress = 1;
break;
@@ -115,17 +128,26 @@ int main (int argc, char * argv[])
command = argv[0];
}
+ int do_get;
if ( strcmp (command, "GetDecryptedImage")==0
|| strcmp (command, "GetObject")==0 ) {
if (manifest==NULL) {
fprintf (stderr, "Error: manifest must be specified\n");
USAGE;
}
+ do_get = 1;
+ } else if ( strcmp (command, "HttpPut")==0) {
+ if (url==NULL || file_name==NULL) {
+ fprintf (stderr, "Error: URL and input file must be specified\n");
+ USAGE;
+ }
+ do_get = 0;
} else {
fprintf (stderr, "Error: unknown command [%s]\n", command);
USAGE;
}
+ if (do_get) {
/* use a temporary file for network data */
char * tmp_name = strdup ("walrus-download-XXXXXX");
int tmp_fd = mkstemp (tmp_name);
@@ -168,6 +190,8 @@ int main (int argc, char * argv[])
}
free (tmp_name);
-
+ } else { // HttpPut
+ int result = http_put (file_name, url, login, password);
+ }
return 0;
}
View
@@ -83,6 +83,8 @@ struct request {
FILE * fp; /* input file pointer to be used by curl READERs */
long long total_read; /* bytes written during the operation */
long long total_calls; /* write calls made during the operation */
+ time_t timestamp; // timestamp for periodically printing progress messages
+ long long file_size; // file size in bytes, to print in progress messages
};
static int curl_initialized = 0;
@@ -131,6 +133,8 @@ int http_put (const char * file_path, const char * url, const char * login, cons
curl_easy_setopt (curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)mystat.st_size);
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0L); // TODO: make this optional?
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0L);
+ curl_easy_setopt (curl, CURLOPT_LOW_SPEED_LIMIT, 360L); // must have at least a 360 baud modem
+ curl_easy_setopt (curl, CURLOPT_LOW_SPEED_TIME, 10L); // abort if below speed limit for this many seconds
if (login!=NULL && password!=NULL) {
char userpwd [STRSIZE];
@@ -140,6 +144,8 @@ int http_put (const char * file_path, const char * url, const char * login, cons
struct request params;
params.fp = fp;
+ params.timestamp = time(NULL);
+ params.file_size = (long long)mystat.st_size;
curl_easy_setopt (curl, CURLOPT_READDATA, &params);
curl_easy_setopt (curl, CURLOPT_READFUNCTION, read_data);
@@ -171,6 +177,9 @@ int http_put (const char * file_path, const char * url, const char * login, cons
case 408L: // timeout, retry
logprintfl (EUCAWARN, "http_put(): server responded with HTTP code %ld (timeout)\n", httpcode);
break;
+ case 500L: // internal server error (could be a fluke, so we'll retry)
+ logprintfl (EUCAWARN, "http_put(): server responded with HTTP code %ld (transient?)\n", httpcode);
+ break;
default: // some kind of error, will not retry
logprintfl (EUCAERROR, "http_put(): server responded with HTTP code %ld\n", httpcode);
retries = 0;
@@ -206,8 +215,17 @@ static size_t read_data (char *buffer, size_t size, size_t nitems, void *params)
((struct request *)params)->total_read += items_read * size;
((struct request *)params)->total_calls++;
+ if (((struct request *)params)->total_calls%50==0) {
+ time_t prev = ((struct request *)params)->timestamp;
+ time_t now = time(NULL);
+ if ((now-prev)>10) {
+ ((struct request *)params)->timestamp = now;
+ long long bytes_read = ((struct request *)params)->total_read;
+ long long bytes_file = ((struct request *)params)->file_size;
+ int percent = (int)((bytes_read*100)/bytes_file);
+ logprintfl (EUCADEBUG, "http_put(): upload progress %ld/%ld bytes (%d%%)\n", bytes_read, bytes_file, percent);
+ }
+ }
+
return items_read;
}
-
-
-
View
@@ -593,7 +593,7 @@ int build_disk_image (
char *kernelId, char *kernelURL, char *kernel_path,
char *ramdiskId, char *ramdiskURL, char *ramdisk_path,
const char *keyName,
- long long total_disk_limit_mb,
+ long long root_limit_mb,
long long swap_size_mb,
long long ephemeral_size_mb)
{
@@ -603,12 +603,12 @@ int build_disk_image (
int e = ERROR;
- logprintfl (EUCAINFO, "retrieving images (disk limit=%lldMB)...\n", total_disk_limit_mb);
+ logprintfl (EUCAINFO, "retrieving images (root limit=%lldMB)...\n", root_limit_mb);
/* get the necessary files from Walrus, caching them if possible */
char * image_name;
int mount_offset = 0;
- long long limit_mb = total_disk_limit_mb - swap_size_mb; // OK if total is negative (unlimited)
+ long long limit_mb = root_limit_mb; // OK if total is negative (unlimited)
/*
if (convert_to_disk) {
image_name = "disk";
@@ -620,11 +620,10 @@ int build_disk_image (
*/
#define CHECK_LIMIT(WHAT) \
- if (total_disk_limit_mb>0L && limit_mb < 1L) { \
+ if (root_limit_mb>0L && limit_mb < 1L) { \
logprintfl (EUCAFATAL, "error: insufficient disk capacity remaining (%lldMB) in VM Type for component %s\n", limit_mb, WHAT); \
return e; \
}
- CHECK_LIMIT("swap");
// static long long get_cached_file (const char * src_url, const char * dst_path, const char * cache_key, sem * s, int convert_to_disk, long long limit_mb, long long swap_size_mb)
@@ -821,7 +820,7 @@ int img_convert (
char disk_path [SIZE]; snprintf (disk_path, SIZE, "%s/%s-disk", unique_path, root->id);
char vmdk_path [SIZE]; snprintf (vmdk_path, SIZE, "%s/%s-disk.vmdk", unique_path, root->id);
- int rc = build_disk_image ("admin",
+ rc = build_disk_image ("admin",
root->id, root->location.url, image_path,
kernel->id, kernel->location.url, kernel_path,
ramdisk->id, ramdisk->location.url, ramdisk_path,
Oops, something went wrong.

0 comments on commit bcfe586

Please sign in to comment.