Skip to content

Fix libvirt for mariner if already present #3410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions lisa/sut_orchestrator/libvirt/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,23 +213,9 @@ def install(self) -> str:
packages_list = self._distro_package_mapping[type(linux).__name__]
self._log.info(f"installing packages: {packages_list}")
linux.install_packages(packages_list)
self._fix_mariner_installation()
_fix_mariner_installation(node=self._node)
return self._get_version()

# Some fixes to the libvirt installation on Mariner.
# Can be removed once the issues have been addressed in Mariner.
def _fix_mariner_installation(self) -> None:
if not isinstance(self._node.os, CBLMariner):
return

self._node.tools[Usermod].add_user_to_group("libvirt", sudo=True)
self._node.tools[Sed].substitute(
"hidepid=2",
"hidepid=0",
"/etc/fstab",
sudo=True,
)


class QemuPackageInstaller(QemuInstaller):
_distro_package_mapping = {
Expand Down Expand Up @@ -584,3 +570,20 @@ def _install_libvirt(runbook: schema.TypedSchema, node: Node, log: Logger) -> No
else:
libvirt_version = libvirt_installer._get_version()
log.info(f"Already installed! libvirt version: {libvirt_version}")
_fix_mariner_installation(node=node)
node.reboot(time_out=900)


# Some fixes to the libvirt installation on Mariner.
# Can be removed once the issues have been addressed in Mariner.
def _fix_mariner_installation(node: Node) -> None:
if not isinstance(node.os, CBLMariner):
return

node.tools[Usermod].add_user_to_group("libvirt", sudo=True)
node.tools[Sed].substitute(
"hidepid=2",
"hidepid=0",
"/etc/fstab",
sudo=True,
)
Loading