Browse Source

Merge "New profile to configure libvirt-guests on compute host" into stable/queens

tags/8.5.1
Zuul 1 month ago
parent
commit
0d285d6523

+ 56
- 0
manifests/profile/base/nova/compute/libvirt_guests.pp View File

@@ -0,0 +1,56 @@
1
+# Copyright 2016 Red Hat, Inc.
2
+#
3
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+# not use this file except in compliance with the License. You may obtain
5
+# a copy of the License at
6
+#
7
+#      http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+# Unless required by applicable law or agreed to in writing, software
10
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+# License for the specific language governing permissions and limitations
13
+# under the License.
14
+#
15
+# == Class: tripleo::profile::base::nova::compute::libvirt_guests
16
+#
17
+# Configures libvirt-guests service.
18
+#
19
+# === Parameters:
20
+#
21
+# [*step*]
22
+#   (Optional) The current step in deployment. See tripleo-heat-templates
23
+#   for more details.
24
+#   Defaults to hiera('step')
25
+#
26
+# [*enabled*]
27
+#   (Optional) Whether libvirt-guests should be configured and enabled or not.
28
+#   Defaults to undef
29
+#
30
+class tripleo::profile::base::nova::compute::libvirt_guests (
31
+  $step                          = Integer(hiera('step')),
32
+  $enabled                       = undef,
33
+) {
34
+  if $step >= 4 {
35
+    class { '::nova::compute::libvirt_guests':
36
+      enabled     => $enabled,
37
+    }
38
+    include ::nova::compute::libvirt_guests
39
+
40
+    #set dep to docker to make sure we shutdown instances before libvirt
41
+    #container stops
42
+    if str2bool(hiera('docker_enabled', false)) {
43
+      include ::systemd::systemctl::daemon_reload
44
+
45
+      Package<| name == 'docker' |>
46
+      -> file { '/etc/systemd/system/virt-guest-shutdown.target.wants':
47
+        ensure => directory,
48
+      }
49
+      -> systemd::unit_file { 'paunch-container-shutdown.service':
50
+        path   => '/etc/systemd/system/virt-guest-shutdown.target.wants',
51
+        target => '/usr/lib/systemd/system/paunch-container-shutdown.service',
52
+        before => Class['::nova::compute::libvirt_guests'],
53
+      }
54
+    }
55
+  }
56
+}

+ 10
- 0
manifests/releasenotes/notes/nova_libvirt_guests-d0e5424d40d9e26e.yaml View File

@@ -0,0 +1,10 @@
1
+---
2
+features:
3
+  - |
4
+    New profile to configure libvirt-guests on compute host. On compute
5
+    shutdown we might want to gracefully shutdown instances using
6
+    libvirt-guests. If it gets configured is managed with the tht
7
+    NovaResumeGuestsStateOnHostBoot parameter. This triggers config of
8
+    /etc/sysconfig/libvirt-guests via puppet-nova, configures a dependency
9
+    for virt-guest-shutdown.target to the docker service that instances get
10
+    shutdown before the libvirt container gets stopped.

Loading…
Cancel
Save