Skip to content

Commit

Permalink
libvirt: Start default network and Capture libvirtd log
Browse files Browse the repository at this point in the history
Capture journalctl log of libvirtd unit when libvirt domain
creation fails.

Start the network using virsh cli before creating node

Signed-off-by: Smit Gardhariya <[email protected]>
  • Loading branch information
smit-gardhariya committed Jan 8, 2025
1 parent 4b8bca8 commit d33ac9d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lisa/sut_orchestrator/libvirt/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,16 @@ def _deploy_nodes(self, environment: Environment, log: Logger) -> None:
):
self._delete_nodes(environment, log)

self._log.debug("Capturing libvirtd log from host...")
self.host_node.execute(
cmd="journalctl -u libvirtd --no-page",
sudo=True,
)
self.host_node.execute(
cmd="cat /var/log/libvirt/libvirtd.log",
sudo=True,
)

raise ex

# Pre-determine all the nodes' properties, including the name of all the resouces
Expand Down
10 changes: 10 additions & 0 deletions lisa/sut_orchestrator/libvirt/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,16 @@ 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):
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

0 comments on commit d33ac9d

Please sign in to comment.