Error mounting device on create instance (LXC)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Miguel Ángel Herranz Trillo | ||
Queens |
Fix Committed
|
Medium
|
Miguel Ángel Herranz Trillo | ||
Rocky |
Fix Committed
|
Medium
|
Matt Riedemann | ||
Stein |
Fix Committed
|
Medium
|
Matt Riedemann |
Bug Description
Description
===========
After installing Openstack in Ubuntu 18.04 and using LXC as virtualization engine, the creation of an instance fails with a log in `nova-compute.log` reporting that:
```Instance failed to spawn: TypeError: mount() takes exactly 4 arguments (3 given)```
Extra analysis of the logs an code points towards this file of `python-nova` package:
/usr/lib/
The problem seems that the call at line 251
```
246 def mnt_dev(self):
247 """Mount the device into the file system."""
248 LOG.debug("Mount %(dev)s on %(dir)s",
249 {'dev': self.mapped_device, 'dir': self.mount_dir})
250 out, err = nova.privsep.
251 self.mount_dir)
252 if err:
253 self.error = _('Failed to mount filesystem: %s') % err
254 LOG.debug(
255 return False
256
257 self.mounted = True
258 return True
```
is not matching the function signature defined in /usr/lib/
```
30 def mount(fstype, device, mountpoint, options):
31 mount_cmd = ['mount']
32 if fstype:
33 mount_cmd.
34 if options is not None:
35 mount_cmd.
36 mount_cmd.
37 return processutils.
```
So, it should be safe just to add `None` as `options` parameter.
Steps to reproduce
==================
Environment info:
OS: Ubuntu 18.04.2 LTS
Kernel: Linux 4.15.0-46-generic #49-Ubuntu SMP x86_64
Openstack: queens
Related packages versions:
nova-api: Installed: 2:17.0.9-0ubuntu1
python-nova: Installed: 2:17.0.9-0ubuntu1
nova-compute: Installed: 2:17.0.9-0ubuntu1
nova-compute-lxc: Installed: 2:17.0.9-0ubuntu1
Command executed to create the instance:
```
# openstack server create --flavor lxc.small --image lxc_ubuntu_18.04 --nic net-id=
+------
| Field | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| adminPass | GhYewcoXch3w |
| config_drive | |
| created | 2019-05-
| flavor | lxc.small (0) |
| hostId | |
| id | fe69997d-
| image | lxc_ubuntu_18.04 (de3ca120-
| key_name | vagrant |
| name | test_lxc_instance |
| progress | 0 |
| project_id | 4c2cf8fa37c8451
| properties | |
| security_groups | name='35a8788c-
| status | BUILD |
| updated | 2019-05-
| user_id | 0d48615bb8c747f
| volumes_attached | |
+------
```
Expected result
===============
```
# openstack server list
+------
| ID | Name | Status | Networks | Image | Flavor |
+------
| dac7b2b8-
+------
```
Actual result
=============
```
# openstack server list
+------
| ID | Name | Status | Networks | Image | Flavor |
+------
| fe69997d-
+------
```
Logs
====
Included some logs generated during the command, and retrieved using:
```
grep -r "2019-05-17 10:0[01]" /var/log >> openstack_
```
tags: | added: libvirt lxc privsep |
Changed in nova: | |
assignee: | Miguel Ángel Herranz Trillo (maherranzt) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → Miguel Ángel Herranz Trillo (maherranzt) |
Fix proposed to branch: master /review. opendev. org/659780
Review: https:/