diff --git a/charms/openstack-hypervisor/config.yaml b/charms/openstack-hypervisor/config.yaml index 2828d1f9..f7cf875a 100644 --- a/charms/openstack-hypervisor/config.yaml +++ b/charms/openstack-hypervisor/config.yaml @@ -5,6 +5,11 @@ options: debug: default: False type: boolean + resume-on-boot: + default: True + description: | + Whether to resume the guest VMs when the host boots. + type: boolean dns-domain: default: "openstack.local" type: string diff --git a/charms/openstack-hypervisor/src/charm.py b/charms/openstack-hypervisor/src/charm.py index c528be1e..7fc805ff 100755 --- a/charms/openstack-hypervisor/src/charm.py +++ b/charms/openstack-hypervisor/src/charm.py @@ -416,6 +416,7 @@ class HypervisorOperatorCharm(sunbeam_charm.OSBaseOperatorCharm): "compute.migration-address": self.migration_address or config("ip-address") or local_ip, + "compute.resume-on-boot": config("resume-on-boot"), "credentials.ovn-metadata-proxy-shared-secret": self.metadata_secret(), "identity.admin-role": contexts.identity_credentials.admin_role, "identity.auth-url": contexts.identity_credentials.internal_endpoint, diff --git a/charms/openstack-hypervisor/tests/unit/test_charm.py b/charms/openstack-hypervisor/tests/unit/test_charm.py index e2b8a082..6cad0e01 100644 --- a/charms/openstack-hypervisor/tests/unit/test_charm.py +++ b/charms/openstack-hypervisor/tests/unit/test_charm.py @@ -144,6 +144,7 @@ class TestCharm(test_utils.CharmTestCase): "compute.cert": certificate, "compute.key": private_key, "compute.migration-address": "10.0.0.10", + "compute.resume-on-boot": True, "compute.rbd-user": "nova", "compute.rbd-secret-uuid": "ddd", "compute.rbd-key": "eee", @@ -247,6 +248,7 @@ class TestCharm(test_utils.CharmTestCase): "compute.cert": certificate, "compute.key": private_key, "compute.migration-address": "10.0.0.10", + "compute.resume-on-boot": True, "compute.rbd-user": "nova", "compute.rbd-secret-uuid": "ddd", "compute.rbd-key": "eee",