New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt-cloud: openstack driver: crash on instance creation #47766

Closed
zerthimon opened this Issue May 22, 2018 · 2 comments

Comments

@zerthimon
Contributor

zerthimon commented May 22, 2018

Description of Issue/Question

salt-call crashes when boot_from_volume: True is set in the cloud profile.

[DEBUG   ] Manager myopenstack:RegionOne ran task compute.GET.flavors.os-extra_specs in 0.0983929634094s
[ERROR   ] There was a profile error: 'unicode' object has no attribute 'id'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/cloud/cli.py", line 281, in run
    self.config.get('names')
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1454, in run_profile
    ret[name] = self.create(vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1284, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/openstack.py", line 697, in create
    data = request_instance(conn=conn, call='action', vm_=vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/openstack.py", line 651, in request_instance
    return show_instance(vm_['name'], conn=conn, call='action')
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/openstack.py", line 469, in show_instance
    ret['image'] = conn.get_image(node.image.id).name
AttributeError: 'unicode' object has no attribute 'id'

from cloud provider:

myopenstack:
  driver: openstack
  ...

from cloud profile:

ubuntu:
  provider: myopenstack
  ...
  boot_from_volume: True
  terminate_volume: False
  volume_size: 7

Steps to Reproduce Issue

salt-cloud -p ubuntu myinstance

Versions Report

# salt-cloud -V
Salt Version:
            Salt: 2018.3.0
 
Dependency Versions:
 Apache Libcloud: 1.5.0
            cffi: 1.11.5
        cherrypy: 3.5.0
        dateutil: 2.4.2
       docker-py: 3.3.0
           gitdb: 0.6.4
       gitpython: 1.0.1
           ioflo: Not Installed
          Jinja2: 2.8
         libgit2: Not Installed
         libnacl: Not Installed
        M2Crypto: Not Installed
            Mako: 1.0.3
    msgpack-pure: Not Installed
  msgpack-python: 0.5.6
    mysql-python: Not Installed
       pycparser: 2.18
        pycrypto: 2.6.1
    pycryptodome: Not Installed
          pygit2: Not Installed
          Python: 2.7.12 (default, Dec  4 2017, 14:50:18)
    python-gnupg: Not Installed
          PyYAML: 3.12
           PyZMQ: 15.2.0
            RAET: Not Installed
           smmap: 0.9.0
         timelib: Not Installed
         Tornado: 4.2.1
             ZMQ: 4.1.4
 
System Versions:
            dist: Ubuntu 16.04 xenial
          locale: UTF-8
         machine: x86_64
         release: 4.4.0-124-generic
          system: Linux
         version: Ubuntu 16.04 xenial
@gtmanfred

This comment has been minimized.

Contributor

gtmanfred commented May 22, 2018

Ahh yes, that would be because when you boot from a volume, no image is specified.

I will get this fixed, thanks.

Daniel

@gtmanfred gtmanfred self-assigned this May 22, 2018

@gtmanfred gtmanfred added this to the Approved milestone May 22, 2018

gtmanfred added a commit to gtmanfred/salt that referenced this issue Aug 6, 2018

if booted from volume, use string from image
If cloud servers in openstack are booted with a volume as their root
partition, they do not have an image assigned to them, so they won't
have an image id.  In these cases just pass the string from node.image
to the image information about that machine.

Fixes saltstack#47766
@gtmanfred

This comment has been minimized.

Contributor

gtmanfred commented Aug 6, 2018

This will be fixed in #48956

@rallytime rallytime closed this Aug 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment