Openstack unable to assign ip to Instance

asked 2017-08-04 13:45:54 -0500

dheerajgudipati gravatar image

I am using os_server anisble module to spinup an instance. I am able to spinup instance and attach ip to it but after creating the instance I have to manually configure the ip. How can I make it assign the Ip automatically to instance while creating. Here is my module

      - name: Deploy on OpenStack
        hosts: localhost
        gather_facts: false
        tasks:
        - name : Create a new instance
           os_server:
                state: present
                auth:
                auth_url: http://xx.xxx.xx.xx:x000/v2.0
                username: automation
                password: automation
                project_name: Automation
         name: test
         image: rhel-guest-image-7.2
         key_name: ansible 
         timeout: 200
         flavor: ucc.as
         auto_floating_ip: yes
         nics:
            - net-name: corenet
            - net-name: nmnet
            - net-name: public
        meta:
           hostname: test1

On the openstack dashboard I can see the ip assigned to the instance but when I open the console on login the instance ip are not present. I have to manually configure it.

edit retag flag offensive close merge delete

Comments

Neutron provides the IP address to the instance via DHCP. There are many reasons why this may fail:

  • the image you use doesn't issue a DHCP request
  • Neutron's DHCP service is not running or has a problem
  • there is no connection between the DHCP server and the instance
Bernd Bausch gravatar imageBernd Bausch ( 2017-08-05 20:32:35 -0500 )edit

To check the DHCP service, run openstack network agent list or neutron agent-list. To check the connection between DHCP and the instance, you first need to know the details of your network implementation.

Is this a general problem or it only occurs with this particular instance or with Ansible?

Bernd Bausch gravatar imageBernd Bausch ( 2017-08-05 20:35:20 -0500 )edit