I verified  commit 216b7a5cd50bb0ef10edfeb6b551b75b083952ae
(<https://github.com/openstack/nova-
lxd/commit/216b7a5cd50bb0ef10edfeb6b551b75b083952ae>) works as it should
to fix flavor extra specs.

Procedure followed:

I stood up a Xenial/Mitaka juju 1.x/nova-lxd environment using the 
openstack-charmers' bundle in bundles/lxd/default.yaml, imported a Xenial lxd 
image, and set the `lxd:nested_allowed` extra spec on the m1.small flavor:
$ nova flavor-key m1.small set lxd:nested_allowed=True 
$ nova flavor-show m1.small 
+----------------------------+--------------------------------+
| Property                   | Value                          |
+----------------------------+--------------------------------+
| OS-FLV-DISABLED:disabled   | False                          |
| OS-FLV-EXT-DATA:ephemeral  | 0                              |
| disk                       | 20                             |
| extra_specs                | {"lxd:nested_allowed": "True"} |
| id                         | 2                              |
| name                       | m1.small                       |
| os-flavor-access:is_public | True                           |
| ram                        | 512                            |
| rxtx_factor                | 1.0                            |
| swap                       |                                |
| vcpus                      | 1                              |
+----------------------------+--------------------------------+

1) python-nova-lxd 13.0.0-0ubuntu3.1: failing test

At this stage the version of python-nova-lxd run by the hypervisors is
13.0.0:

$ juju run --service nova-compute 'dpkg -l python-nova-lxd | grep ii'
- MachineId: "10"
  Stdout: |
    ii  python-nova-lxd 13.0.0-0ubuntu3.1 all          OpenStack Compute Python 
libraries - LXD driver
  UnitId: nova-compute/0
- MachineId: "11"
  Stdout: |
    ii  python-nova-lxd 13.0.0-0ubuntu3.1 all          OpenStack Compute Python 
libraries - LXD driver
  UnitId: nova-compute/1
- MachineId: "12"
  Stdout: |
    ii  python-nova-lxd 13.0.0-0ubuntu3.1 all          OpenStack Compute Python 
libraries - LXD driver
  UnitId: nova-compute/2


Now we boot an instance using the m1.small flavor, and verify that 
security.nesting is not set on either the instance or its profile, since the 
extra spec is being ignored.

$ nova boot --image xenial-lxd --flavor m1.small --key-name testkey
--nic net-id=c1fc9eb7-af43-484e-9784-85315bd3d4e1 x-nesting-test

# Determine which compute host the instance was scheduled to, and under which 
name 
nova show x-nesting-test | grep -E 'hypervisor|instance' | sed 's/|//g' 
 OS-EXT-SRV-ATTR:hypervisor_hostname   juju-dsjpoulain-machine-10               
                
 OS-EXT-SRV-ATTR:instance_name         instance-00000005

# On the hypervisor, check that the instance and its profile do NOT have 
security.nesting set on them
ubuntu@juju-dsjpoulain-machine-10:~$ lxc config show instance-00000005 
--expanded | grep security # no output
ubuntu@juju-dsjpoulain-machine-10:~$ lxc profile show instance-00000005 | grep 
security # no output


2) python-nova-lxd 13.2.0-0ubuntu1: passing test

I installed python-nova-lxd 13.2.0-0ubuntu1 from xenial-proposed on all
hypervisors in the fleet and restarted nova-compute:

$ juju run --service nova-compute 'dpkg -l python-nova-lxd | grep ii'
- MachineId: "10"
  Stdout: |
    ii  python-nova-lxd 13.2.0-0ubuntu1 all          OpenStack Compute Python 
libraries - LXD driver
  UnitId: nova-compute/0
- MachineId: "11"
  Stdout: |
    ii  python-nova-lxd 13.2.0-0ubuntu1 all          OpenStack Compute Python 
libraries - LXD driver
  UnitId: nova-compute/1
- MachineId: "12"
  Stdout: |
    ii  python-nova-lxd 13.2.0-0ubuntu1 all          OpenStack Compute Python 
libraries - LXD driver
  UnitId: nova-compute/2

$ juju run --service nova-compute 'sudo service nova-compute restart'
- MachineId: "10"
  Stdout: ""
  UnitId: nova-compute/0
- MachineId: "11"
  Stdout: ""
  UnitId: nova-compute/1
- MachineId: "12"
  Stdout: ""
  UnitId: nova-compute/2

# Boot another instance with the same flavor, m1.small.
$ nova boot --image xenial-lxd --flavor m1.small --key-name testkey --nic 
net-id=c1fc9eb7-af43-484e-9784-85315bd3d4e1 x-nesting-test-proposed

# Identify hypervisor/instance name
nova show x-nesting-test-proposed | grep -E 'hypervisor|instance' | sed 's/|//g'
 OS-EXT-SRV-ATTR:hypervisor_hostname   juju-dsjpoulain-machine-12               
                
 OS-EXT-SRV-ATTR:instance_name         instance-00000007

# Verify security.nesting is set on both the instance and its profile
ubuntu@juju-dsjpoulain-machine-12:~$ lxc config show instance-00000007 
--expanded | grep security
  security.nesting: "True"
ubuntu@juju-dsjpoulain-machine-12:~$ lxc profile show instance-00000007 | grep 
security
  security.nesting: "True"

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1649368

Title:
  [SRU] newton nova-lxd 13.2.0 point release

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nova-lxd/+bug/1649368/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to