Skip to content

Commit ebc9537

Browse files
committed
Revert "Disable VMwareTools detection to avoid unreliable result caused by race-condition when VMwareTools is not ready in guest OS yet and the API is called"
This reverts commit 8e0faaa.
1 parent 8e0faaa commit ebc9537

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎client/pom.xml‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<parent>
1717
<groupId>org.apache.cloudstack</groupId>
1818
<artifactId>cloudstack</artifactId>
19-
<version>4.3.0-SNAPSHOT</version>
20-
</parent>
19+
<version>4.2.0-SNAPSHOT</version>
20+
</parent>
2121
<dependencies>
2222
<dependency>
2323
<groupId>org.apache.cloudstack</groupId>
@@ -173,6 +173,7 @@
173173
<dependency>
174174
<groupId>mysql</groupId>
175175
<artifactId>mysql-connector-java</artifactId>
176+
<version>${cs.mysql.version}</version>
176177
<scope>runtime</scope>
177178
</dependency>
178179
<dependency>
@@ -195,6 +196,13 @@
195196
<artifactId>cloud-engine-components-api</artifactId>
196197
<version>${project.version}</version>
197198
</dependency>
199+
200+
<dependency>
201+
<groupId>org.apache.cloudstack</groupId>
202+
<artifactId>cloud-engine-compute</artifactId>
203+
<version>${project.version}</version>
204+
</dependency>
205+
198206
<dependency>
199207
<groupId>org.apache.cloudstack</groupId>
200208
<artifactId>cloud-engine-network</artifactId>
@@ -282,6 +290,7 @@
282290
</dependency>
283291
</dependencies>
284292
<build>
293+
<defaultGoal>install</defaultGoal>
285294
<plugins>
286295
<plugin>
287296
<groupId>ru.concerteza.buildnumber</groupId>
@@ -329,8 +338,8 @@
329338
<maxIdleTime>60000</maxIdleTime>
330339
</connector>
331340
</connectors>
332-
<webXml>${project.build.directory}/generated-webapp/WEB-INF/web.xml</webXml>
333-
<webAppSourceDirectory>${project.build.directory}/generated-webapp</webAppSourceDirectory>
341+
<webXml>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</webXml>
342+
<webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
334343
<webAppConfig>
335344
<contextPath>/client</contextPath>
336345
<extraClasspath>${project.build.directory}/utilities/scripts/db/;${project.build.directory}/utilities/scripts/db/db/</extraClasspath>
@@ -382,7 +391,10 @@
382391
<fileset dir="${basedir}/../scripts" />
383392
</copy>
384393
<!-- CLOUDSTACK-1304 -->
385-
<chmod perm="755" file="${basedir}/target/generated-webapp/WEB-INF/classes/scripts/**" type="both" />
394+
<chmod perm="755">
395+
<fileset
396+
dir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts" />
397+
</chmod>
386398
<copy todir="${basedir}/target/generated-webapp/WEB-INF/">
387399
<fileset dir="${basedir}/WEB-INF/">
388400
<include name="web.xml" />
@@ -549,6 +561,7 @@
549561
<plugin>
550562
<groupId>org.apache.maven.plugins</groupId>
551563
<artifactId>maven-dependency-plugin</artifactId>
564+
<version>2.5.1</version>
552565
<executions>
553566
<execution>
554567
<id>copy</id>

‎plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,13 +1659,12 @@ private PlugNicAnswer execute(PlugNicCommand cmd) {
16591659
throw new Exception(msg);
16601660
}
16611661

1662-
/*
16631662
if(!isVMWareToolsInstalled(vmMo)){
16641663
String errMsg = "vmware tools is not installed or not running, cannot add nic to vm " + vmName;
16651664
s_logger.debug(errMsg);
16661665
return new PlugNicAnswer(cmd, false, "Unable to execute PlugNicCommand due to " + errMsg);
16671666
}
1668-
*/
1667+
16691668
// TODO need a way to specify the control of NIC device type
16701669
VirtualEthernetCardType nicDeviceType = VirtualEthernetCardType.E1000;
16711670

@@ -1740,13 +1739,12 @@ private UnPlugNicAnswer execute(UnPlugNicCommand cmd) {
17401739
throw new Exception(msg);
17411740
}
17421741

1743-
/*
17441742
if(!isVMWareToolsInstalled(vmMo)){
17451743
String errMsg = "vmware tools not installed or not running, cannot remove nic from vm " + vmName;
17461744
s_logger.debug(errMsg);
17471745
return new UnPlugNicAnswer(cmd, false, "Unable to execute unPlugNicCommand due to " + errMsg);
17481746
}
1749-
*/
1747+
17501748
VirtualDevice nic = findVirtualNicDevice(vmMo, cmd.getNic().getMac());
17511749
if ( nic == null ) {
17521750
return new UnPlugNicAnswer(cmd, true, "success");
@@ -6871,17 +6869,6 @@ public Answer execute(DestroyCommand cmd) {
68716869

68726870
private boolean isVMWareToolsInstalled(VirtualMachineMO vmMo) throws Exception{
68736871
GuestInfo guestInfo = vmMo.getVmGuestInfo();
6874-
if(guestInfo == null) {
6875-
s_logger.error("null GuestInfo is returned");
6876-
return false;
6877-
}
6878-
6879-
if(guestInfo.getGuestState() == null) {
6880-
s_logger.error("null GuestState is returned");
6881-
return false;
6882-
}
6883-
6884-
s_logger.info("VMwareTools guest state: " + guestInfo.getGuestState());
68856872
return (guestInfo != null && guestInfo.getGuestState() != null && guestInfo.getGuestState().equalsIgnoreCase("running"));
68866873
}
68876874
}

0 commit comments

Comments
 (0)