Skip to content

Commit 0e32380

Browse files
Merge remote-tracking branch 'origin/4.19'
2 parents 33dc746 + 308ed13 commit 0e32380

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

server/src/main/java/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java

+7
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,13 @@ public Date scheduleNextSnapshotJob(final SnapshotPolicyVO policy) {
415415
if (policyId == Snapshot.MANUAL_POLICY_ID) {
416416
return null;
417417
}
418+
419+
if (_volsDao.findById(policy.getVolumeId()) == null) {
420+
s_logger.warn("Found snapshot policy ID: " + policyId + " for volume ID: " + policy.getVolumeId() + " that does not exist or has been removed");
421+
removeSchedule(policy.getVolumeId(), policy.getId());
422+
return null;
423+
}
424+
418425
final Date nextSnapshotTimestamp = getNextScheduledTime(policyId, _currentTimestamp);
419426
SnapshotScheduleVO spstSchedVO = _snapshotScheduleDao.findOneByVolumePolicy(policy.getVolumeId(), policy.getId());
420427
if (spstSchedVO == null) {

systemvm/debian/opt/cloud/bin/setup/postinit.sh

+13-13
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ log_it() {
2626
# Restart journald for setting changes to apply
2727
systemctl restart systemd-journald
2828

29+
# Restore the persistent iptables nat, rules and filters for IPv4 and IPv6 if they exist
30+
ipv4="/etc/iptables/rules.v4"
31+
if [ -e $ipv4 ]
32+
then
33+
iptables-restore < $ipv4
34+
fi
35+
36+
ipv6="/etc/iptables/rules.v6"
37+
if [ -e $ipv6 ]
38+
then
39+
ip6tables-restore < $ipv6
40+
fi
41+
2942
CMDLINE=/var/cache/cloud/cmdline
3043
TYPE=$(grep -Po 'type=\K[a-zA-Z]*' $CMDLINE)
3144
if [ "$TYPE" == "router" ] || [ "$TYPE" == "vpcrouter" ] || [ "$TYPE" == "dhcpsrvr" ]
@@ -52,17 +65,4 @@ do
5265
systemctl disable --now --no-block $svc
5366
done
5467

55-
# Restore the persistent iptables nat, rules and filters for IPv4 and IPv6 if they exist
56-
ipv4="/etc/iptables/rules.v4"
57-
if [ -e $ipv4 ]
58-
then
59-
iptables-restore < $ipv4
60-
fi
61-
62-
ipv6="/etc/iptables/rules.v6"
63-
if [ -e $ipv6 ]
64-
then
65-
ip6tables-restore < $ipv6
66-
fi
67-
6868
date > /var/cache/cloud/boot_up_done

0 commit comments

Comments
 (0)