mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 19:14:40 +01:00
Enable UEFI on KVM hosts (by default), and configure with some default settings (#11740)
This commit is contained in:
parent
9c0efb7072
commit
2dd1e6d786
24
agent/conf/uefi.properties.in
Normal file
24
agent/conf/uefi.properties.in
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
# Configuration file for UEFI
|
||||||
|
|
||||||
|
guest.nvram.template.legacy=@GUESTNVRAMTEMPLATELEGACY@
|
||||||
|
guest.loader.legacy=@GUESTLOADERLEGACY@
|
||||||
|
guest.nvram.template.secure=@GUESTNVRAMTEMPLATESECURE@
|
||||||
|
guest.loader.secure=@GUESTLOADERSECURE@
|
||||||
|
guest.nvram.path=@GUESTNVRAMPATH@
|
||||||
1
debian/cloudstack-agent.install
vendored
1
debian/cloudstack-agent.install
vendored
@ -16,6 +16,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
/etc/cloudstack/agent/agent.properties
|
/etc/cloudstack/agent/agent.properties
|
||||||
|
/etc/cloudstack/agent/uefi.properties
|
||||||
/etc/cloudstack/agent/environment.properties
|
/etc/cloudstack/agent/environment.properties
|
||||||
/etc/cloudstack/agent/log4j-cloud.xml
|
/etc/cloudstack/agent/log4j-cloud.xml
|
||||||
/etc/default/cloudstack-agent
|
/etc/default/cloudstack-agent
|
||||||
|
|||||||
2
debian/cloudstack-agent.postinst
vendored
2
debian/cloudstack-agent.postinst
vendored
@ -23,7 +23,7 @@ case "$1" in
|
|||||||
configure)
|
configure)
|
||||||
OLDCONFDIR="/etc/cloud/agent"
|
OLDCONFDIR="/etc/cloud/agent"
|
||||||
NEWCONFDIR="/etc/cloudstack/agent"
|
NEWCONFDIR="/etc/cloudstack/agent"
|
||||||
CONFFILES="agent.properties log4j.xml log4j-cloud.xml"
|
CONFFILES="agent.properties uefi.properties log4j.xml log4j-cloud.xml"
|
||||||
|
|
||||||
mkdir -m 0755 -p /usr/share/cloudstack-agent/tmp
|
mkdir -m 0755 -p /usr/share/cloudstack-agent/tmp
|
||||||
|
|
||||||
|
|||||||
2
debian/control
vendored
2
debian/control
vendored
@ -24,7 +24,7 @@ Description: CloudStack server library
|
|||||||
|
|
||||||
Package: cloudstack-agent
|
Package: cloudstack-agent
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat
|
Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, ovmf, swtpm, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat
|
||||||
Recommends: init-system-helpers
|
Recommends: init-system-helpers
|
||||||
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
|
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
|
||||||
Description: CloudStack agent
|
Description: CloudStack agent
|
||||||
|
|||||||
@ -59,3 +59,8 @@ USAGELOG=/var/log/cloudstack/usage/usage.log
|
|||||||
USAGESYSCONFDIR=/etc/cloudstack/usage
|
USAGESYSCONFDIR=/etc/cloudstack/usage
|
||||||
PACKAGE=cloudstack
|
PACKAGE=cloudstack
|
||||||
EXTENSIONSDEPLOYMENTMODE=production
|
EXTENSIONSDEPLOYMENTMODE=production
|
||||||
|
GUESTNVRAMTEMPLATELEGACY=/usr/share/OVMF/OVMF_VARS_4M.fd
|
||||||
|
GUESTLOADERLEGACY=/usr/share/OVMF/OVMF_CODE_4M.fd
|
||||||
|
GUESTNVRAMTEMPLATESECURE=/usr/share/OVMF/OVMF_VARS_4M.ms.fd
|
||||||
|
GUESTLOADERSECURE=/usr/share/OVMF/OVMF_CODE_4M.secboot.fd
|
||||||
|
GUESTNVRAMPATH=/var/lib/libvirt/qemu/nvram/
|
||||||
|
|||||||
@ -115,6 +115,8 @@ Requires: ipset
|
|||||||
Requires: perl
|
Requires: perl
|
||||||
Requires: rsync
|
Requires: rsync
|
||||||
Requires: cifs-utils
|
Requires: cifs-utils
|
||||||
|
Requires: edk2-ovmf
|
||||||
|
Requires: swtpm
|
||||||
Requires: (python3-libvirt or python3-libvirt-python)
|
Requires: (python3-libvirt or python3-libvirt-python)
|
||||||
Requires: (qemu-img or qemu-tools)
|
Requires: (qemu-img or qemu-tools)
|
||||||
Requires: qemu-kvm
|
Requires: qemu-kvm
|
||||||
@ -356,6 +358,7 @@ install -D packaging/systemd/cloudstack-agent.service ${RPM_BUILD_ROOT}%{_unitdi
|
|||||||
install -D packaging/systemd/cloudstack-rolling-maintenance@.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-rolling-maintenance@.service
|
install -D packaging/systemd/cloudstack-rolling-maintenance@.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-rolling-maintenance@.service
|
||||||
install -D packaging/systemd/cloudstack-agent.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-agent
|
install -D packaging/systemd/cloudstack-agent.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-agent
|
||||||
install -D agent/target/transformed/agent.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/agent.properties
|
install -D agent/target/transformed/agent.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/agent.properties
|
||||||
|
install -D agent/target/transformed/uefi.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/uefi.properties
|
||||||
install -D agent/target/transformed/environment.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/environment.properties
|
install -D agent/target/transformed/environment.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/environment.properties
|
||||||
install -D agent/target/transformed/log4j-cloud.xml ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/log4j-cloud.xml
|
install -D agent/target/transformed/log4j-cloud.xml ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/log4j-cloud.xml
|
||||||
install -D agent/target/transformed/cloud-setup-agent ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-agent
|
install -D agent/target/transformed/cloud-setup-agent ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-agent
|
||||||
@ -523,7 +526,7 @@ mkdir -m 0755 -p /usr/share/cloudstack-agent/tmp
|
|||||||
/usr/bin/systemctl enable cloudstack-rolling-maintenance@p > /dev/null 2>&1 || true
|
/usr/bin/systemctl enable cloudstack-rolling-maintenance@p > /dev/null 2>&1 || true
|
||||||
/usr/bin/systemctl enable --now rngd > /dev/null 2>&1 || true
|
/usr/bin/systemctl enable --now rngd > /dev/null 2>&1 || true
|
||||||
|
|
||||||
# if saved configs from upgrade exist, copy them over
|
# if saved agent.properties from upgrade exist, copy them over
|
||||||
if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
|
if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
|
||||||
mv %{_sysconfdir}/%{name}/agent/agent.properties %{_sysconfdir}/%{name}/agent/agent.properties.rpmnew
|
mv %{_sysconfdir}/%{name}/agent/agent.properties %{_sysconfdir}/%{name}/agent/agent.properties.rpmnew
|
||||||
cp -p %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/%{name}/agent
|
cp -p %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/%{name}/agent
|
||||||
@ -531,6 +534,14 @@ if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
|
|||||||
mv %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/cloud.rpmsave/agent/agent.properties.rpmsave
|
mv %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/cloud.rpmsave/agent/agent.properties.rpmsave
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if saved uefi.properties from upgrade exist, copy them over
|
||||||
|
if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/uefi.properties" ]; then
|
||||||
|
mv %{_sysconfdir}/%{name}/agent/uefi.properties %{_sysconfdir}/%{name}/agent/uefi.properties.rpmnew
|
||||||
|
cp -p %{_sysconfdir}/cloud.rpmsave/agent/uefi.properties %{_sysconfdir}/%{name}/agent
|
||||||
|
# make sure we only do this on the first install of this RPM, don't want to overwrite on a reinstall
|
||||||
|
mv %{_sysconfdir}/cloud.rpmsave/agent/uefi.properties %{_sysconfdir}/cloud.rpmsave/agent/uefi.properties.rpmsave
|
||||||
|
fi
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
# Print help message
|
# Print help message
|
||||||
|
|||||||
@ -58,3 +58,8 @@ USAGECLASSPATH=
|
|||||||
USAGELOG=/var/log/cloudstack/usage/usage.log
|
USAGELOG=/var/log/cloudstack/usage/usage.log
|
||||||
USAGESYSCONFDIR=/etc/sysconfig
|
USAGESYSCONFDIR=/etc/sysconfig
|
||||||
EXTENSIONSDEPLOYMENTMODE=production
|
EXTENSIONSDEPLOYMENTMODE=production
|
||||||
|
GUESTNVRAMTEMPLATELEGACY=/usr/share/edk2/ovmf/OVMF_VARS.fd
|
||||||
|
GUESTLOADERLEGACY=/usr/share/edk2/ovmf/OVMF_CODE.cc.fd
|
||||||
|
GUESTNVRAMTEMPLATESECURE=/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd
|
||||||
|
GUESTLOADERSECURE=/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd
|
||||||
|
GUESTNVRAMPATH=/var/lib/libvirt/qemu/nvram/
|
||||||
|
|||||||
4
pom.xml
4
pom.xml
@ -1038,15 +1038,19 @@
|
|||||||
<exclude>dist/console-proxy/js/jquery.js</exclude>
|
<exclude>dist/console-proxy/js/jquery.js</exclude>
|
||||||
<exclude>engine/schema/dist/**</exclude>
|
<exclude>engine/schema/dist/**</exclude>
|
||||||
<exclude>plugins/hypervisors/hyperv/conf/agent.properties</exclude>
|
<exclude>plugins/hypervisors/hyperv/conf/agent.properties</exclude>
|
||||||
|
<exclude>plugins/hypervisors/hyperv/conf/uefi.properties</exclude>
|
||||||
<exclude>plugins/hypervisors/hyperv/DotNet/ServerResource/**</exclude>
|
<exclude>plugins/hypervisors/hyperv/DotNet/ServerResource/**</exclude>
|
||||||
<exclude>scripts/installer/windows/acs_license.rtf</exclude>
|
<exclude>scripts/installer/windows/acs_license.rtf</exclude>
|
||||||
<exclude>scripts/vm/systemvm/id_rsa.cloud</exclude>
|
<exclude>scripts/vm/systemvm/id_rsa.cloud</exclude>
|
||||||
<exclude>services/console-proxy/server/conf/agent.properties</exclude>
|
<exclude>services/console-proxy/server/conf/agent.properties</exclude>
|
||||||
|
<exclude>services/console-proxy/server/conf/uefi.properties</exclude>
|
||||||
<exclude>services/console-proxy/server/conf/environment.properties</exclude>
|
<exclude>services/console-proxy/server/conf/environment.properties</exclude>
|
||||||
<exclude>services/console-proxy/server/js/jquery.js</exclude>
|
<exclude>services/console-proxy/server/js/jquery.js</exclude>
|
||||||
<exclude>services/secondary-storage/conf/agent.properties</exclude>
|
<exclude>services/secondary-storage/conf/agent.properties</exclude>
|
||||||
|
<exclude>services/secondary-storage/conf/uefi.properties</exclude>
|
||||||
<exclude>services/secondary-storage/conf/environment.properties</exclude>
|
<exclude>services/secondary-storage/conf/environment.properties</exclude>
|
||||||
<exclude>systemvm/agent/conf/agent.properties</exclude>
|
<exclude>systemvm/agent/conf/agent.properties</exclude>
|
||||||
|
<exclude>systemvm/agent/conf/uefi.properties</exclude>
|
||||||
<exclude>systemvm/agent/conf/environment.properties</exclude>
|
<exclude>systemvm/agent/conf/environment.properties</exclude>
|
||||||
<exclude>systemvm/agent/js/jquery.js</exclude>
|
<exclude>systemvm/agent/js/jquery.js</exclude>
|
||||||
<exclude>systemvm/agent/js/jquery.flot.navigate.js</exclude>
|
<exclude>systemvm/agent/js/jquery.flot.navigate.js</exclude>
|
||||||
|
|||||||
@ -1410,7 +1410,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
|||||||
if (vmInstanceDetailVO != null &&
|
if (vmInstanceDetailVO != null &&
|
||||||
(ApiConstants.BootMode.LEGACY.toString().equalsIgnoreCase(vmInstanceDetailVO.getValue()) ||
|
(ApiConstants.BootMode.LEGACY.toString().equalsIgnoreCase(vmInstanceDetailVO.getValue()) ||
|
||||||
ApiConstants.BootMode.SECURE.toString().equalsIgnoreCase(vmInstanceDetailVO.getValue()))) {
|
ApiConstants.BootMode.SECURE.toString().equalsIgnoreCase(vmInstanceDetailVO.getValue()))) {
|
||||||
logger.info(" Live Migration of UEFI enabled VM : " + vm.getInstanceName() + " is not supported");
|
logger.debug("{} VM is UEFI enabled, Checking for other UEFI enabled hosts as it can be live migrated to UEFI enabled host only.", vm.getInstanceName());
|
||||||
if (CollectionUtils.isEmpty(filteredHosts)) {
|
if (CollectionUtils.isEmpty(filteredHosts)) {
|
||||||
filteredHosts = new ArrayList<>(allHosts);
|
filteredHosts = new ArrayList<>(allHosts);
|
||||||
}
|
}
|
||||||
@ -1420,6 +1420,9 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
|||||||
return new Pair<>(false, null);
|
return new Pair<>(false, null);
|
||||||
}
|
}
|
||||||
filteredHosts.removeIf(host -> !uefiEnabledHosts.contains(host.getId()));
|
filteredHosts.removeIf(host -> !uefiEnabledHosts.contains(host.getId()));
|
||||||
|
if (filteredHosts.isEmpty()) {
|
||||||
|
logger.warn("No UEFI enabled hosts are available for the live migration of VM {}", vm.getInstanceName());
|
||||||
|
}
|
||||||
return new Pair<>(!filteredHosts.isEmpty(), filteredHosts);
|
return new Pair<>(!filteredHosts.isEmpty(), filteredHosts);
|
||||||
}
|
}
|
||||||
return new Pair<>(true, filteredHosts);
|
return new Pair<>(true, filteredHosts);
|
||||||
|
|||||||
@ -60,6 +60,7 @@
|
|||||||
<include>log4j-cloud.xml</include>
|
<include>log4j-cloud.xml</include>
|
||||||
<include>consoleproxy.properties</include>
|
<include>consoleproxy.properties</include>
|
||||||
<include>agent.properties</include>
|
<include>agent.properties</include>
|
||||||
|
<include>uefi.properties</include>
|
||||||
</includes>
|
</includes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user