canonical / canonical/pycloudlib

Qemu image times out when using config-defined working_dir

Open
#335 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
22
Forks
42
PR merge metrics
No merged PRs in 30d

Description

When specifying a `working_dir` for the new qemu provider, I get the following failure. However if the `working_dir` points to a tmpfs (`/run/`, `/tmp/`), it succeeds. I think that this is because startup time when reading the qcow image from disk is much slower than from a tmpfs (RAM).

We may want to bump up the timeout value from 10s, or at least include a note in the template config about the risks of using a disk-backed filesystem for `working_dir`.

```
_____ ERROR at setup of TestVarLogCloudInitOutput.test_var_log_cloud_init_output_not_world_readable ______

request = >
fixture_utils =
session_cloud = , setup_image = None

@pytest.fixture
def client(
request, fixture_utils, session_cloud, setup_image
) -> Iterator[IntegrationInstance]:
"""Provide a client that runs for every test."""
> with _client(request, fixture_utils, session_cloud) as client:

tests/integration_tests/conftest.py:280:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.11/contextlib.py:137: in __enter__
return next(self.gen)
tests/integration_tests/conftest.py:260: in _client
with session_cloud.launch(
tests/integration_tests/clouds.py:151: in launch
pycloudlib_instance = self._perform_launch(
tests/integration_tests/clouds.py:107: in _perform_launch
self._maybe_wait(pycloudlib_instance, wait)
tests/integration_tests/clouds.py:98: in _maybe_wait
pycloudlib_instance.wait()
.tox/integration-tests/lib/python3.11/site-packages/pycloudlib/instance.py:169: in wait
self._wait_for_instance_start(**kwargs)
.tox/integration-tests/lib/python3.11/site-packages/pycloudlib/qemu/instance.py:213: in _wait_for_instance_start
self.wait_till_status("running")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , expected_status = 'running'
timeout = 500

def wait_till_status(self, expected_status: str, timeout: int = 500):
"""Wait for instance to reach a certain status.

Args:
status: status to wait for
timeout: timeout in seconds
"""
if not self.qmp:
> raise MissingPrerequisiteError("No QMP connection")
E pycloudlib.errors.MissingPrerequisiteError: No QMP connection

.tox/integration-tests/lib/python3.11/site-packages/pycloudlib/qemu/instance.py:236: MissingPrerequisiteError
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.