GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CLOUDSTACK-10013: Fix VMware related issues and fix misc tests · folkcode/cloudstack@15b11a3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • engine/orchestration/src/com/cloud/vm
    • VirtualMachineManagerImpl.java
  • python/lib/cloudutils
    • utilities.py
  • server/src/com/cloud/server
    • StatsCollector.java
  • systemvm
    • agent/conf
      • log4j-cloud.xml
    • debian
      • etc
        • issue
        • rc.local
      • opt/cloud
        • bin
          • cs
            • CsDhcp.py
          • setup
            • common.sh
            • router.sh
            • vpcrouter.sh
          • update_config.py
        • templates
          • keepalived.conf.templ
  • test/integration/smoke
    • test_deploy_virtio_scsi_vm.py
    • test_deploy_vm_root_resize.py
    • test_iso.py
    • test_list_ids_parameter.py
    • test_nested_virtualization.py
    • test_ssvm.py
    • test_vm_life_cycle.py
    • test_volumes.py
  • tools/appliance/definitions/systemvmtemplate
    • configure_acpid.sh
    • configure_grub.sh
    • configure_systemvm_services.sh
    • install_systemvm_packages.sh
    • preseed.cfg
  • ui/scripts
    • network.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java‎

Copy file name to clipboardExpand all lines: engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4776,8 +4776,8 @@ private Pair<JobInfo.Status, String> orchestrateStop(final VmWorkStop work) thro
47764776
final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId());
47774777
if (vm == null) {
47784778
s_logger.info("Unable to find vm " + work.getVmId());
4779+
throw new CloudRuntimeException("Unable to find VM id=" + work.getVmId());
47794780
}
4780-
assert vm != null;
47814781

47824782
orchestrateStop(vm.getUuid(), work.isCleanup());
47834783
return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null);
Collapse file

‎python/lib/cloudutils/utilities.py‎

Copy file name to clipboardExpand all lines: python/lib/cloudutils/utilities.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def isKVMEnabled(self):
216216
class serviceOpsRedhat7(serviceOps):
217217
def isServiceRunning(self, servicename):
218218
try:
219-
o = bash("systemctl status " + servicename)
220-
if "running" in o.getStdout() or "start" in o.getStdout() or "Running" in o.getStdout():
219+
o = bash("systemctl is-active " + servicename)
220+
if "inactive" not in o.getStdout():
221221
return True
222222
else:
223223
return False
Collapse file

‎server/src/com/cloud/server/StatsCollector.java‎

Copy file name to clipboardExpand all lines: server/src/com/cloud/server/StatsCollector.java
+18-2Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
import com.cloud.cluster.dao.ManagementServerHostDao;
6565
import com.cloud.dc.Vlan.VlanType;
6666
import com.cloud.dc.VlanVO;
67+
import com.cloud.dc.dao.ClusterDao;
6768
import com.cloud.dc.dao.VlanDao;
6869
import com.cloud.exception.StorageUnavailableException;
6970
import com.cloud.gpu.dao.HostGpuGroupsDao;
@@ -92,18 +93,20 @@
9293
import com.cloud.network.as.dao.AutoScaleVmProfileDao;
9394
import com.cloud.network.as.dao.ConditionDao;
9495
import com.cloud.network.as.dao.CounterDao;
96+
import com.cloud.org.Cluster;
9597
import com.cloud.resource.ResourceManager;
9698
import com.cloud.resource.ResourceState;
9799
import com.cloud.service.ServiceOfferingVO;
98100
import com.cloud.service.dao.ServiceOfferingDao;
99101
import com.cloud.storage.ImageStoreDetailsUtil;
102+
import com.cloud.storage.ScopeType;
103+
import com.cloud.storage.Storage.ImageFormat;
100104
import com.cloud.storage.StorageManager;
101105
import com.cloud.storage.StorageStats;
102106
import com.cloud.storage.VolumeStats;
103107
import com.cloud.storage.VolumeVO;
104108
import com.cloud.storage.dao.VolumeDao;
105109
import com.cloud.user.UserStatisticsVO;
106-
import com.cloud.storage.Storage.ImageFormat;
107110
import com.cloud.user.VmDiskStatisticsVO;
108111
import com.cloud.user.dao.UserStatisticsDao;
109112
import com.cloud.user.dao.VmDiskStatisticsDao;
@@ -173,6 +176,8 @@ public String toString() {
173176
@Inject
174177
private HostDao _hostDao;
175178
@Inject
179+
private ClusterDao _clusterDao;
180+
@Inject
176181
private UserVmDao _userVmDao;
177182
@Inject
178183
private VolumeDao _volsDao;
@@ -916,7 +921,18 @@ else if (volume.getFormat() == ImageFormat.OVA){
916921
}
917922
}
918923
try {
919-
HashMap<String, VolumeStatsEntry> volumeStatsByUuid = _userVmMgr.getVolumeStatistics(pool.getClusterId(), pool.getUuid(), pool.getPoolType(), volumeLocators, StatsTimeout.value());
924+
Map<String, VolumeStatsEntry> volumeStatsByUuid;
925+
if (pool.getScope() == ScopeType.ZONE) {
926+
volumeStatsByUuid = new HashMap<>();
927+
for (final Cluster cluster: _clusterDao.listByZoneId(pool.getDataCenterId())) {
928+
final Map<String, VolumeStatsEntry> volumeStatsForCluster = _userVmMgr.getVolumeStatistics(cluster.getId(), pool.getUuid(), pool.getPoolType(), volumeLocators, StatsTimeout.value());
929+
if (volumeStatsForCluster != null) {
930+
volumeStatsByUuid.putAll(volumeStatsForCluster);
931+
}
932+
}
933+
} else {
934+
volumeStatsByUuid = _userVmMgr.getVolumeStatistics(pool.getClusterId(), pool.getUuid(), pool.getPoolType(), volumeLocators, StatsTimeout.value());
935+
}
920936
if (volumeStatsByUuid != null){
921937
for (final Map.Entry<String, VolumeStatsEntry> entry : volumeStatsByUuid.entrySet()) {
922938
if (entry == null || entry.getKey() == null || entry.getValue() == null) {
Collapse file

‎systemvm/agent/conf/log4j-cloud.xml‎

Copy file name to clipboardExpand all lines: systemvm/agent/conf/log4j-cloud.xml
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ under the License.
2424
<!-- Preserve messages in a local file -->
2525
<!-- ================================= -->
2626

27-
<appender name="FILE1" class="org.apache.log4j.RollingFileAppender">
27+
<appender name="cloudLog" class="org.apache.log4j.RollingFileAppender">
2828
<param name="File" value="/var/log/cloud.log"/>
2929
<param name="MaxFileSize" value="10000KB"/>
3030
<param name="MaxBackupIndex" value="4"/>
@@ -34,7 +34,7 @@ under the License.
3434
</layout>
3535
</appender>
3636

37-
<appender name="FILE2" class="org.apache.log4j.RollingFileAppender">
37+
<appender name="cloudOut" class="org.apache.log4j.RollingFileAppender">
3838
<param name="File" value="/var/log/cloud/cloud.out"/>
3939
<param name="Append" value="true"/>
4040
<param name="MaxFileSize" value="10000KB"/>
@@ -45,7 +45,7 @@ under the License.
4545
</layout>
4646
</appender>
4747

48-
<appender name="FILE3" class="org.apache.log4j.rolling.RollingFileAppender">
48+
<appender name="cloudSystemvmLog" class="org.apache.log4j.rolling.RollingFileAppender">
4949
<param name="File" value="/usr/local/cloud/systemvm/cloud.log"/>
5050
<param name="Append" value="true"/>
5151
<param name="MaxFileSize" value="10000KB"/>
@@ -123,9 +123,9 @@ under the License.
123123
<root>
124124
<level value="INFO"/>
125125
<appender-ref ref="CONSOLE"/>
126-
<appender-ref ref="FILE1"/>
127-
<appender-ref ref="FILE2"/>
128-
<appender-ref ref="FILE3"/>
126+
<appender-ref ref="cloudLog"/>
127+
<appender-ref ref="cloudOut"/>
128+
<appender-ref ref="cloudSystemvmLog"/>
129129
</root>
130130

131131
</log4j:configuration>
Collapse file

‎systemvm/debian/etc/issue‎

Copy file name to clipboardExpand all lines: systemvm/debian/etc/issue
-3Lines changed: 0 additions & 3 deletions
This file was deleted.
Collapse file

‎systemvm/debian/etc/rc.local‎

Copy file name to clipboardExpand all lines: systemvm/debian/etc/rc.local
-19Lines changed: 0 additions & 19 deletions
This file was deleted.
Collapse file

‎systemvm/debian/opt/cloud/bin/cs/CsDhcp.py‎

Copy file name to clipboardExpand all lines: systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def configure_server(self):
8080
# DNS search order
8181
if gn.get_dns() and device:
8282
sline = "dhcp-option=tag:interface-%s-%s,6" % (device, idx)
83-
dns_list = [x for x in gn.get_dns() if x is not None]
83+
dns_list = [x for x in gn.get_dns() if not (not x)]
8484
line = "dhcp-option=tag:interface-%s-%s,6,%s" % (device, idx, ','.join(dns_list))
8585
self.conf.search(sline, line)
8686
# Gateway
Collapse file

‎systemvm/debian/opt/cloud/bin/setup/common.sh‎

Copy file name to clipboardExpand all lines: systemvm/debian/opt/cloud/bin/setup/common.sh
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ setup_common() {
331331
ip route add default via $GW dev $gwdev
332332
fi
333333

334-
# a hacking way to activate vSwitch under VMware
335-
ping -n -c 3 $GW &
334+
# Workaround to activate vSwitch under VMware
335+
timeout 3 ping -n -c 3 $GW || true
336336
if [ -n "$MGMTNET" -a -n "$LOCAL_GW" ]
337337
then
338-
ping -n -c 3 $LOCAL_GW &
338+
timeout 3 ping -n -c 3 $LOCAL_GW || true
339339
#This code is added to address ARP issue by pinging MGMT_GW
340340
MGMT_GW=$(echo $MGMTNET | awk -F "." '{print $1"."$2"."$3".1"}')
341-
ping -n -c 3 $MGMT_GW &
341+
timeout 3 ping -n -c 3 $MGMT_GW || true
342342
fi
343343

344344
if [ "$HYPERVISOR" == "vmware" ]; then
Collapse file

‎systemvm/debian/opt/cloud/bin/setup/router.sh‎

Copy file name to clipboardExpand all lines: systemvm/debian/opt/cloud/bin/setup/router.sh
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ setup_router() {
5959

6060
if [ "$oldmd5" != "$newmd5" ]
6161
then
62-
log_it "udev NIC assignment requires reboot to take effect"
63-
sync
64-
sleep 2
65-
reboot
62+
log_it "Reloading udev for new udev NIC assignment"
63+
udevadm control --reload-rules && udevadm trigger
6664
fi
6765
fi
6866

Collapse file

‎systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh‎

Copy file name to clipboardExpand all lines: systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,8 @@ EOF
6565
if [ "$HYPERVISOR" == "vmware" ] || [ "$HYPERVISOR" == "hyperv" ];
6666
then
6767
ip route add $MGMTNET via $LOCAL_GW dev eth0
68-
69-
# a hacking way to activate vSwitch under VMware
70-
ping -n -c 3 $LOCAL_GW &
71-
sleep 3
72-
pkill ping
68+
# workaround to activate vSwitch under VMware
69+
timeout 3 ping -n -c 3 $LOCAL_GW || true
7370
fi
7471
fi
7572

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.