File tree Expand file tree Collapse file tree 2 files changed +20
-13
lines changed
server/src/main/java/com/cloud/storage/snapshot
systemvm/debian/opt/cloud/bin/setup Expand file tree Collapse file tree 2 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,13 @@ public Date scheduleNextSnapshotJob(final SnapshotPolicyVO policy) {
417417 if (policyId == Snapshot .MANUAL_POLICY_ID ) {
418418 return null ;
419419 }
420+
421+ if (_volsDao .findById (policy .getVolumeId ()) == null ) {
422+ s_logger .warn ("Found snapshot policy ID: " + policyId + " for volume ID: " + policy .getVolumeId () + " that does not exist or has been removed" );
423+ removeSchedule (policy .getVolumeId (), policy .getId ());
424+ return null ;
425+ }
426+
420427 final Date nextSnapshotTimestamp = getNextScheduledTime (policyId , _currentTimestamp );
421428 SnapshotScheduleVO spstSchedVO = _snapshotScheduleDao .findOneByVolumePolicy (policy .getVolumeId (), policy .getId ());
422429 if (spstSchedVO == null ) {
Original file line number Diff line number Diff line change @@ -26,6 +26,19 @@ log_it() {
2626# Restart journald for setting changes to apply
2727systemctl 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+
2942CMDLINE=/var/cache/cloud/cmdline
3043TYPE=$( grep -Po ' type=\K[a-zA-Z]*' $CMDLINE )
3144if [ " $TYPE " == " router" ] || [ " $TYPE " == " vpcrouter" ] || [ " $TYPE " == " dhcpsrvr" ]
5265 systemctl disable --now --no-block $svc
5366done
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-
6868date > /var/cache/cloud/boot_up_done
You can’t perform that action at this time.
0 commit comments