Skip to content

Commit 7bcff5a

Browse files
author
Kelven Yang
committed
Vmware incremental check-in
1 parent afc0adf commit 7bcff5a

6 files changed

Lines changed: 27 additions & 4 deletions

File tree

api/src/com/cloud/hypervisor/Hypervisor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public static enum Type {
2323
None, //for storage hosts
2424
Xen,
2525
XenServer,
26-
KVM;
26+
KVM,
27+
VMware;
2728
}
2829

2930
}

build/build-cloud.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@
264264
<include name="httpcore-4.0.jar" />
265265
<include name="commons-httpclient-3.1.jar" />
266266
<include name="commons-codec-1.4.jar" />
267+
<include name="commons-discovery.jar" />
267268
<include name="email.jar" />
268269
<include name="xmlrpc-client-3.1.3.jar" />
269270
<include name="xmlrpc-common-3.1.3.jar" />

core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4114,6 +4114,7 @@ protected void fillHostInfo(StartupRoutingCommand cmd) {
41144114
break;
41154115
}
41164116
}
4117+
41174118
// assume the memory Virtualization overhead is 1/64
41184119
ram = (ram - dom0Ram) * 63/64;
41194120
cmd.setMemory(ram);

core/test/com/cloud/vmware/TestVMWare.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.vmware.vim25.VirtualDeviceConfigSpecOperation;
2020
import com.vmware.vim25.VirtualEthernetCard;
2121
import com.vmware.vim25.VirtualEthernetCardNetworkBackingInfo;
22+
import com.vmware.vim25.VirtualNicManagerNetConfig;
2223
import com.vmware.vim25.VirtualPCNet32;
2324
import com.vmware.vim25.VirtualDeviceConfigSpec;
2425
import com.vmware.vim25.VirtualMachineCloneSpec;
@@ -784,6 +785,14 @@ private void createDatacenter() throws Exception {
784785
"cloud.dc.test");
785786
}
786787

788+
private void getPropertyWithPath() throws Exception {
789+
ManagedObjectReference morHost = new ManagedObjectReference();
790+
morHost.setType("HostSystem");
791+
morHost.set_value("host-161");
792+
793+
VirtualNicManagerNetConfig[] netConfigs = (VirtualNicManagerNetConfig[])cb.getServiceUtil3().getDynamicProperty(morHost, "config.virtualNicManagerInfo.netConfig");
794+
}
795+
787796
public static void main(String[] args) throws Exception {
788797
setupLog4j();
789798
TestVMWare client = new TestVMWare();
@@ -809,7 +818,9 @@ public static void main(String[] args) throws Exception {
809818
// client.addNic();
810819
// client.addNicToNetwork();
811820

812-
client.createDatacenter();
821+
// client.createDatacenter();
822+
client.getPropertyWithPath();
823+
813824
cb.disConnect();
814825
} catch (Exception e) {
815826
e.printStackTrace();

server/src/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,13 @@ public List<HostVO> discoverHosts(long dcId, Long podId, Long clusterId, URI url
478478
Enumeration<Discoverer> en = _discoverers.enumeration();
479479
while (en.hasMoreElements()) {
480480
Discoverer discoverer = en.nextElement();
481-
Map<? extends ServerResource, Map<String, String>> resources = discoverer.find(dcId, podId, clusterId, url, username, password);
481+
Map<? extends ServerResource, Map<String, String>> resources = null;
482+
483+
try {
484+
resources = discoverer.find(dcId, podId, clusterId, url, username, password);
485+
} catch(Exception e) {
486+
s_logger.info("Exception in host discovery process with discoverer: " + discoverer.getName() + ", skip to another discoverer if there is any");
487+
}
482488
if (resources != null) {
483489
for (Map.Entry<? extends ServerResource, Map<String, String>> entry : resources.entrySet()) {
484490
ServerResource resource = entry.getKey();
@@ -1677,7 +1683,7 @@ protected void updateHost(final HostVO host, final StartupCommand startup, final
16771683

16781684
// If this command is from a KVM agent, or from an agent that has a
16791685
// null hypervisor type, don't do the CIDR check
1680-
if (hypervisorType == null || hypervisorType == Hypervisor.Type.KVM)
1686+
if (hypervisorType == null || hypervisorType == Hypervisor.Type.KVM || hypervisorType == Hypervisor.Type.VMware)
16811687
doCidrCheck = false;
16821688

16831689
if (doCidrCheck)

setup/db/templates.xenserver.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (58,
7272
INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (59, 7, 'Other install media', 'Ubuntu');
7373
INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (60, 7, 'Other install media', 'Other');
7474

75+
-- temporarily added for vmware, will be moved when vmware support is fully in-place
76+
INSERT INTO `cloud`.`host_master`(`type`, `service_address`, `admin`, `password`) VALUES('VSphere', 'vsphere-1.lab.vmops.com', 'Administrator', 'Suite219');
77+

0 commit comments

Comments
 (0)