mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-4405: change rpm and debian packaging to support automatic update (KVM upgrade)
Including following steps:
b. Run "cloudstack-agent-upgrade". This script will upgrade all the existing bridge name to new bridge name, and update related firewall rules.
c. install a libvirt hook:
c1. mkdir /etc/libvirt/hooks
c2. cp /usr/share/cloudstack-agent/lib/libvirtqemuhook /etc/libvirt/hooks/qemu
c3. chmod +x /etc/libvirt/hooks/qemu
c4. service libvirtd restart
(cherry picked from commit a0988780ad)
Signed-off-by: Wei Zhou <w.zhou@leaseweb.com>
This commit is contained in:
parent
258118efa6
commit
164e3e33b4
|
|
@ -34,7 +34,15 @@ case "$1" in
|
|||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Running cloudstack-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later)
|
||||
/usr/bin/cloudstack-agent-upgrade
|
||||
if [ ! -d "/etc/libvirt/hooks" ] ; then
|
||||
mkdir /etc/libvirt/hooks
|
||||
fi
|
||||
cp -a /usr/share/cloudstack-agent/lib/libvirtqemuhook /etc/libvirt/hooks/qemu
|
||||
/etc/init.d/libvirt-bin restart
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ install:
|
|||
install -D packaging/debian/init/cloud-agent $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-agent
|
||||
install -D agent/target/transformed/cloud-setup-agent $(DESTDIR)/usr/bin/cloudstack-setup-agent
|
||||
install -D agent/target/transformed/cloud-ssh $(DESTDIR)/usr/bin/cloudstack-ssh
|
||||
install -D agent/target/transformed/cloudstack-agent-upgrade $(DESTDIR)/usr/bin/cloudstack-setup-agent
|
||||
install -D agent/target/transformed/libvirtqemuhook $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
|
||||
install -D agent/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/agent
|
||||
|
||||
# cloudstack-management
|
||||
|
|
|
|||
|
|
@ -463,6 +463,13 @@ fi
|
|||
|
||||
%post agent
|
||||
if [ "$1" == "1" ] ; then
|
||||
echo "Running %{_bindir}/%{name}-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later)"
|
||||
%{_bindir}/%{name}-agent-upgrade
|
||||
if [ ! -d %{_sysconfdir}/libvirt/hooks ] ; then
|
||||
mkdir %{_sysconfdir}/libvirt/hooks
|
||||
fi
|
||||
cp -a ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib/libvirtqemuhook %{_sysconfdir}/libvirt/hooks/qemu
|
||||
/sbin/service libvirtd restart
|
||||
/sbin/chkconfig --add cloudstack-agent > /dev/null 2>&1 || true
|
||||
/sbin/chkconfig --level 345 cloudstack-agent on > /dev/null 2>&1 || true
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue