From 4a88506bfdcb030b142cbf73b9f6766b61b9929a Mon Sep 17 00:00:00 2001 From: Shuicheng Lin Date: Tue, 21 May 2019 15:06:08 +0800 Subject: [PATCH] fix vm console log cannot be collected When the vm is created by libvirt/qemu, a pty device is created also under /dev/pts. And nova will check this device exist or not when get console log. After openstack containerization, libvirt and nova compute are run in container. Libvirt mounts /dev space to container directly, so the pty device could be seen in host also. But nova compute doesn't mount /dev space, and lead to the issue. Solution: mount /dev/pts space in host to nova compute container. Test: vm console log could be seen both in horizon and by openstack cmd. Closes-Bug: 1817618 Change-Id: I39bdd8c50a3bbea3b7896bac258721d7e1d2ee44 Signed-off-by: Shuicheng Lin --- sysinv/sysinv/sysinv/sysinv/helm/nova.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sysinv/sysinv/sysinv/sysinv/helm/nova.py b/sysinv/sysinv/sysinv/sysinv/helm/nova.py index be6ff8fb8c..bd84a697e2 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/nova.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/nova.py @@ -67,7 +67,7 @@ class NovaHelm(openstack.OpenstackBaseHelm): 'pod': { 'mounts': { 'nova_compute': { - 'nova_compute': self._get_mount_uefi_overrides() + 'nova_compute': self._get_mount_overrides() } }, 'replicas': { @@ -119,6 +119,19 @@ class NovaHelm(openstack.OpenstackBaseHelm): else: return overrides + def _get_mount_overrides(self): + overrides = self._get_mount_uefi_overrides() + # mount /dev/pts in order to get console log + overrides['volumes'].append({ + 'name': 'dev-pts', + 'hostPath': {'path': '/dev/pts'} + }) + overrides['volumeMounts'].append({ + 'name': 'dev-pts', + 'mountPath': '/dev/pts' + }) + return overrides + def _get_endpoints_overrides(self): overrides = { 'identity': {