Skip to content
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

libvirt: Start default network and Capture libvirtd log #3592

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions lisa/sut_orchestrator/libvirt/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from lisa.platform_ import Platform
from lisa.sut_orchestrator.libvirt.libvirt_device_pool import LibvirtDevicePool
from lisa.tools import (
Cat,
Chmod,
Chown,
Cp,
Expand Down Expand Up @@ -406,6 +407,12 @@ def _deploy_nodes(self, environment: Environment, log: Logger) -> None:
):
self._delete_nodes(environment, log)

self._log.debug("Capturing libvirtd log from host...")
journalctl = self.host_node.tools[Journalctl]
journalctl.logs_for_unit(unit_name="libvirtd", sudo=True)
cat = self.host_node.tools[Cat]
cat.read(file="/var/log/libvirt/libvirtd.log", sudo=True)

LiliDeng marked this conversation as resolved.
Show resolved Hide resolved
raise ex

# Pre-determine all the nodes' properties, including the name of all the resouces
Expand Down
12 changes: 12 additions & 0 deletions lisa/sut_orchestrator/libvirt/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,18 @@ def _install_libvirt(runbook: schema.TypedSchema, node: Node, log: Logger) -> No
log.info("Enabled libvirtd and virtnetworkd services")
node.reboot(time_out=900)
_wait_for_libvirtd(node)
if isinstance(node.os, CBLMariner):
# Some time we have seen 'default' nw of libvirt is not started
# start it in that case and mark it auto-start
node.execute(
cmd="virsh net-start default",
sudo=True,
)
node.execute(
cmd="virsh net-autostart default",
sudo=True,
)
log.info("Marked 'default' libvirt network as auto-start")


def _wait_for_libvirtd(node: Node) -> None:
Expand Down
Loading