Skip to content

Commit 4f8a52f

Browse files
author
Kelven Yang
committed
Move VMware/Premium Secondary storage VM to opensource
1 parent d3eb9db commit 4f8a52f

82 files changed

Lines changed: 16872 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/build-cloud.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
<property name="meld.home" location="/usr/local/bin" />
112112
<property name="assertion" value="-da" />
113113

114+
<!-- directory for vmware-base library -->
115+
<property name="vmware-base.dir" location="${base.dir}/vmware-base" />
114116

115117
<!-- directories for testing -->
116118
<property name="test.target.dir" location="${target.dir}/test" />
@@ -126,6 +128,7 @@
126128
<property name="console-common.jar" value="cloud-console-common.jar" />
127129
<property name="console-proxy.jar" value="cloud-console-proxy.jar" />
128130
<property name="api.jar" value="cloud-api.jar"/>
131+
<property name="vmware-base.jar" value="cloud-vmware-base.jar" />
129132

130133
<!--
131134
Import information about the build version and company information
@@ -199,10 +202,18 @@
199202
<path refid="deps.classpath" />
200203
<path refid="dist.classpath" />
201204
</path>
202-
<target name="compile-core" depends="-init, compile-utils, compile-api" description="Compile the core business logic.">
205+
<target name="compile-core" depends="-init, compile-utils, compile-api, compile-vmware-base" description="Compile the core business logic.">
203206
<compile-java jar.name="${core.jar}" top.dir="${core.dir}" classpath="core.classpath" />
204207
</target>
205208

209+
<path id="vmware-base.classpath">
210+
<path refid="thirdparty.classpath" />
211+
<path refid="dist.classpath" />
212+
</path>
213+
<target name="compile-vmware-base" depends="-init, compile-utils" description="Compile the VMware support library">
214+
<compile-java jar.name="${vmware-base.jar}" top.dir="${vmware-base.dir}" classpath="vmware-base.classpath" />
215+
</target>
216+
206217
<path id="server.classpath">
207218
<path refid="deps.classpath" />
208219
<path refid="dist.classpath" />

build/package.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,33 @@
185185
<include name="cloud-commons-codec-1.4.jar" />
186186
<include name="cloud-commons-pool-1.4.jar" />
187187
<include name="cloud-cglib.jar" />
188+
<include name="cloud-axis.jar" />
189+
<include name="cloud-commons-discovery.jar" />
190+
<include name="cloud-wsdl4j.jar" />
191+
<include name="vmware-apputils.jar" />
192+
<include name="vmware-lib-jaxen-core.jar" />
193+
<include name="vmware-lib-jdom.jar" />
194+
<include name="vmware-lib-smtp.jar" />
195+
<include name="vmware-lib-xerces.jar" />
196+
<include name="vmware-vim.jar" />
197+
<include name="vmware-credstore.jar" />
198+
<include name="vmware-lib-jaxen-jdom.jar" />
199+
<include name="vmware-lib-mailapi.jar" />
200+
<include name="vmware-lib-wbem.jar" />
201+
<include name="vmware-lib-xml-apis.jar" />
202+
<include name="vmware-lib-activation.jar" />
203+
<include name="vmware-lib-jaxrpc.jar" />
204+
<include name="vmware-lib-saxpath.jar" />
205+
<include name="vmware-lib-xalan.jar" />
206+
<include name="vmware-vim25.jar" />
207+
<include name="vmware-vim.jar" />
188208
</zipfileset>
189209
<zipfileset dir="${jar.dir}">
190210
<include name="${agent.jar}" />
191211
<include name="${utils.jar}" />
192212
<include name="${core.jar}" />
193213
<include name="${api.jar}" />
214+
<include name="${vmware-base.jar}" />
194215
</zipfileset>
195216
<zipfileset dir="${console-proxy.dist.dir}" filemode="555">
196217
</zipfileset>

core/.classpath

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
88
<classpathentry combineaccessrules="false" kind="src" path="/deps"/>
99
<classpathentry combineaccessrules="false" kind="src" path="/tools"/>
10+
<classpathentry combineaccessrules="false" kind="src" path="/vmware-base"/>
1011
<classpathentry kind="output" path="bin"/>
1112
</classpath>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
3+
*/
4+
5+
package com.cloud.hypervisor.vmware.manager;
6+
7+
import com.cloud.agent.api.Command;
8+
import com.cloud.hypervisor.vmware.mo.VmwareHypervisorHost;
9+
import com.cloud.hypervisor.vmware.util.VmwareContext;
10+
11+
public interface VmwareHostService {
12+
VmwareContext getServiceContext(Command cmd);
13+
void invalidateServiceContext(VmwareContext context);
14+
VmwareHypervisorHost getHyperHost(VmwareContext context, Command cmd);
15+
16+
String getWorkerName(VmwareContext context, Command cmd);
17+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
3+
*/
4+
5+
package com.cloud.hypervisor.vmware.manager;
6+
7+
import java.io.File;
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
//import com.cloud.cluster.CheckPointManager;
12+
import com.cloud.hypervisor.vmware.mo.HostMO;
13+
import com.cloud.hypervisor.vmware.mo.VirtualEthernetCardType;
14+
import com.cloud.hypervisor.vmware.util.VmwareContext;
15+
import com.cloud.utils.Pair;
16+
import com.vmware.vim25.ManagedObjectReference;
17+
18+
public interface VmwareManager {
19+
public final String CONTEXT_STOCK_NAME = "vmwareMgr";
20+
21+
// this limitation comes from the fact that we are using linked clone on shared VMFS storage,
22+
// we need to limit the size of vCenter cluster, http://en.wikipedia.org/wiki/VMware_VMFS
23+
public final int MAX_HOSTS_PER_CLUSTER = 8;
24+
25+
String composeWorkerName();
26+
27+
String getSystemVMIsoFileNameOnDatastore();
28+
void prepareSecondaryStorageStore(String strStorageUrl);
29+
30+
void setupResourceStartupParams(Map<String, Object> params);
31+
List<ManagedObjectReference> addHostToPodCluster(VmwareContext serviceContext, long dcId, Long podId, Long clusterId,
32+
String hostInventoryPath) throws Exception;
33+
34+
String getManagementPortGroupByHost(HostMO hostMo) throws Exception;
35+
String getServiceConsolePortGroupName();
36+
String getManagementPortGroupName();
37+
38+
String getSecondaryStorageStoreUrl(long dcId);
39+
40+
File getSystemVMKeyFile();
41+
42+
VmwareStorageManager getStorageManager();
43+
long pushCleanupCheckpoint(String hostGuid, String vmName);
44+
void popCleanupCheckpoint(long checkpiont);
45+
void gcLeftOverVMs(VmwareContext context);
46+
47+
Pair<Integer, Integer> getAddiionalVncPortRange();
48+
VirtualEthernetCardType getGuestNicDeviceType();
49+
50+
int getMaxHostsPerCluster();
51+
52+
boolean beginExclusiveOperation(int timeOutSeconds);
53+
void endExclusiveOperation();
54+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
3+
*/
4+
5+
package com.cloud.hypervisor.vmware.manager;
6+
7+
import com.cloud.agent.api.Answer;
8+
import com.cloud.agent.api.BackupSnapshotCommand;
9+
import com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand;
10+
import com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand;
11+
import com.cloud.agent.api.CreateVolumeFromSnapshotCommand;
12+
import com.cloud.agent.api.DeleteSnapshotBackupCommand;
13+
import com.cloud.agent.api.DeleteSnapshotsDirCommand;
14+
import com.cloud.agent.api.storage.CopyVolumeCommand;
15+
import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
16+
17+
public interface VmwareStorageManager {
18+
Answer execute(VmwareHostService hostService, PrimaryStorageDownloadCommand cmd);
19+
Answer execute(VmwareHostService hostService, BackupSnapshotCommand cmd);
20+
Answer execute(VmwareHostService hostService, DeleteSnapshotsDirCommand cmd);
21+
Answer execute(VmwareHostService hostService, DeleteSnapshotBackupCommand cmd);
22+
Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromVolumeCommand cmd);
23+
Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromSnapshotCommand cmd);
24+
Answer execute(VmwareHostService hostService, CopyVolumeCommand cmd);
25+
Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCommand cmd);
26+
}

0 commit comments

Comments
 (0)