~ubuntu-branches/ubuntu/maverick/eucalyptus/maverick

« back to all changes in this revision

Viewing changes to cluster/handlers.h

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2010-07-21 17:27:10 UTC
  • mfrom: (1.1.38 upstream)
  • Revision ID: james.westby@ubuntu.com-20100721172710-7xv07dmdqgivc3t9
Tags: 2.0~bzr1211-0ubuntu1
* New major upstream version merge, 2.0 (r1211).
* debian/patches/:
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 02-Makefile.patch: Updated to reflect new code layout.
  - 07-local_support_euca_conf-in.patch: Updated to reflect new code layout.
  - 08-ubuntu-default-networking.patch: Refreshed.
  - 09-small-128-192MB.patch: Updated to point to new location.
  - 10-disable-iscsi.patch: Refreshed.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 15-fix-default-ramdisk.patch: Updated to point to new location.
  - 16-kvm_libvirt_xml_default_use_kvm.patch: Updated to reflect changes.
  - 17-fix_walrus_OOM_errors.patch: Removed, fixed upstream.
  - 18-priv_security.patch: Updated to reflect upstream changes.
  - 20-brute-force-webui.patch: Updated to reflect upstream changes. 
  - 21-eucalyptus-1.7-with-gwt-1.6.4.patch: New patch, allows 
    eucalyptus-1.7 to be built against gwt 1.6.4. Based on patch courtesy 
    of Dmitrii Zagorodnov, upstream. (LP: #597330)
* debian/eucalyptus-java-common.links: 
  - Changed symlink for groovy, point to groovy.all.jar, making compatiable 
    with groovy versions >1.7. (LP: #595421)
  - Added ant.jar & jetty-rewrite-handler.jar as they are now required.
* debian/control
  - & debian/build-jars: Added libjavassist-java and libjetty-extra-java as 
    build dependencies.
  - Added libjetty-extra-java as a dependency of eucalyptus-java-common
* The binary resulting jar's have been renamed from eucalyptus-*-1.6.2.jar
  to eucalyptus-*-main.jar:    
  - debian/eucalyptus-cc.upstart
  - debian/eucalyptus-cloud.install
  - debian/eucalyptus-common.eucalyptus.upstart
  - debian/eucalyptus-java-common.install
  - debian/eucalyptus-network.upstart
  - debian/eucalyptus-sc.install
  - debian/eucalyptus-walrus.install
* debian/eucalyptus-java-common.install: New upstream jars that have been
  installed:
  - eucalyptus-db-hsqldb-ext-main.jar
  - eucalyptus-component-main.jar
* debian/control:
  - Updated Standards Version to 3.8.4 (no change)
  - Updated the upstream Homepage to: http://open.eucalyptus.com/
  - Changed Vcs-Bzr to reflect new location of Ubuntu hosted development branch.
  - Made the Build Dependency of groovy and the binary eucalyptus-java-common
    package depend on version >=1.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
#include <data.h>
66
66
#include <client-marshal.h>
67
67
#include <vnetwork.h>
 
68
#include <linux/limits.h>
 
69
 
 
70
#ifndef MAX_PATH
 
71
#define MAX_PATH 4096
 
72
#endif
68
73
 
69
74
#define OP_TIMEOUT 60
70
75
#define OP_TIMEOUT_PERNODE 20
 
76
#define OP_TIMEOUT_MIN 5
71
77
 
72
78
enum {SHARED_MEM, SHARED_FILE};
73
 
 
74
 
typedef struct virtualMachine_t {
75
 
  int mem, cores, disk;
76
 
  char name[64];
77
 
} virtualMachine;
78
 
int allocate_virtualMachine(virtualMachine *out, int mem, int disk, int cores, char *name);
79
 
//void free_virtualMachine(virtualMachine *in);
80
 
 
81
 
typedef struct netConfig_t {
82
 
  int vlan;
83
 
  char publicMac[24], privateMac[24], publicIp[24], privateIp[24];
84
 
} netConfig;
85
 
int allocate_netConfig(netConfig *out, char *pvMac, char *pbMac, char *pvIp, char *pbIp, int vlan);
86
 
//void free_netConfig(netConfig *in);
 
79
enum {INIT, CONFIG, VNET, INSTCACHE, RESCACHE, NCCALL, ENDLOCK};
87
80
 
88
81
typedef struct instance_t {
89
82
  char instanceId[16];
93
86
  char kernelId[16];
94
87
  char ramdiskId[16];
95
88
  
96
 
  char amiURL[64];
97
 
  char kernelURL[64];
98
 
  char ramdiskURL[64];
 
89
  char amiURL[512];
 
90
  char kernelURL[512];
 
91
  char ramdiskURL[512];
99
92
  
100
93
  char state[16];
101
94
  time_t ts;
104
97
  char keyName[1024];
105
98
  
106
99
  netConfig ccnet;
107
 
  int networkIndex;
108
100
  virtualMachine ccvm;
109
101
 
110
102
  int ncHostIdx;
111
103
  char serviceTag[64];
112
104
 
113
 
  char userData[64];
 
105
  char userData[4096];
114
106
  char launchIndex[64];
115
107
  char groupNames[64][32];
116
108
 
118
110
  int volumesSize;
119
111
} ccInstance;
120
112
 
121
 
int allocate_ccInstance(ccInstance *out, char *id, char *amiId, char *kernelId, char *ramdiskId, char *amiURL, char *kernelURL, char *ramdiskURL, char *ownerId, char *state, time_t ts, char *reservationId, netConfig *ccnet, virtualMachine *ccvm, int ncHostIdx, char *keyName, char *serviceTag, char *userData, char *launchIndex, char groupNames[][32], ncVolume *volumes, int volumesSize, int networkIndex);
122
 
void print_ccInstance(ccInstance *in);
123
 
//void free_ccInstance(ccInstance *inInst);
 
113
int allocate_ccInstance(ccInstance *out, char *id, char *amiId, char *kernelId, char *ramdiskId, char *amiURL, char *kernelURL, char *ramdiskURL, char *ownerId, char *state, time_t ts, char *reservationId, netConfig *ccnet, virtualMachine *ccvm, int ncHostIdx, char *keyName, char *serviceTag, char *userData, char *launchIndex, char groupNames[][32], ncVolume *volumes, int volumesSize);
 
114
void print_ccInstance(char *tag, ccInstance *in);
124
115
 
125
116
enum {RESDOWN, RESUP, RESASLEEP, RESWAKING};
 
117
enum {INSTINVALID, INSTVALID, INSTCONFLICT};
 
118
enum {RESINVALID, RESVALID};
126
119
enum {MONITOR, CLEANUP, CONTROL};
127
120
enum {CONFIGLOCK, CACHELOCK, VNETCONFIGLOCK};
128
121
 
135
128
  // state information
136
129
  int state, lastState;
137
130
  time_t stateChange, idleStart;
 
131
  int running;
138
132
} ccResource;
139
133
int allocate_ccResource(ccResource *out, char *ncURL, char *ncService, int ncPort, char *hostname, char *mac, char *ip, int maxMemory, int availMemory, int maxDisk, int availDisk, int maxCores, int availCores, int state, int laststate, time_t stateChange, time_t idleStart);
140
134
 
141
135
typedef struct ccResourceCache_t {
142
136
  ccResource resources[MAXNODES];
143
 
  int valid[MAXNODES];
 
137
  int cacheState[MAXNODES];
144
138
  int numResources;
145
139
  int lastResourceUpdate;
146
140
  int resourceCacheUpdate;
149
143
typedef struct ccInstanceCache_t {
150
144
  ccInstance instances[MAXINSTANCES];
151
145
  time_t lastseen[MAXINSTANCES];
152
 
  time_t valid[MAXINSTANCES];
 
146
  int cacheState[MAXINSTANCES];
153
147
  int numInsts;
154
148
  int instanceCacheUpdate;
155
149
} ccInstanceCache;
156
150
 
157
151
typedef struct ccConfig_t {
158
 
  char eucahome[1024];
159
 
  char configFiles[2][1024];
 
152
  char eucahome[MAX_PATH];
 
153
  char configFiles[2][MAX_PATH];
160
154
  int use_wssec, use_tunnels;
161
 
  char policyFile[1024];
162
 
  int initialized;
 
155
  char policyFile[MAX_PATH];
 
156
  int initialized, kick_dhcp;
163
157
  int schedPolicy, schedState;
164
158
  int idleThresh, wakeThresh;
165
159
  time_t configMtime, instanceTimeout, ncPollingFrequency;
208
202
int privIpSet(ccInstance *inst, void *ip);
209
203
int pubIpCmp(ccInstance *inst, void *ip);
210
204
int pubIpSet(ccInstance *inst, void *ip);
 
205
int free_instanceNetwork(char *mac, int vlan, int force, int dolock);
211
206
int ccInstance_to_ncInstance(ccInstance *dst, ncInstance *src);
212
207
 
213
208
int add_resourceCache(char *host, ccResource *in);
226
221
int setup_shared_buffer(void **buf, char *bufname, size_t bytes, sem_t **lock, char *lockname, int mode);
227
222
void unlock_exit(int);
228
223
void shawn(void);
 
224
int ncClientCall(ncMetadata *meta, int timeout, int ncLock, char *ncURL, char *ncOp, ...);
 
225
int ncGetTimeout(time_t op_start, time_t op_max, int numCalls, int idx);
229
226
 
230
227
int refresh_resources(ncMetadata *ccMeta, int timeout, int dolock);
231
228
int refresh_instances(ncMetadata *ccMeta, int timeout, int dolock);