Skip to content
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

neutron: enable designate integration #2095

Merged
merged 1 commit into from
Apr 15, 2019

Conversation

sjamgade
Copy link
Contributor

@sjamgade sjamgade commented Apr 10, 2019

the config enabled by this flag lets neutron create dns records when
floating ip are created and assigned.
The config was previously added but was not enabled as the barclamp was
still under development

This config is not really needed for designate or neutron to work, but they help enable certain features
this is where the flag is used

<%if @designate_enabled -%>
external_dns_driver = designate
[designate]
url = <%= @designate_public_uri %>
admin_auth_url = <%= @keystone_settings['internal_auth_url'] %>
admin_tenant_name = <%= @keystone_settings['service_tenant'] %>
admin_username = <%= @keystone_settings['service_user'] %>
admin_password = <%= @keystone_settings['service_password'] %>
region_name = <%= @keystone_settings['endpoint_region'] %>
admin_user_domain = <%= @keystone_settings['admin_domain'] %>
admin_project_domain = <%= @keystone_settings['admin_domain'] %>
<% end -%>

@KeithMnemonic
Copy link

But is the neutron barclamp creating the ext-net ? If so you need to see the dns_name on that network. Is that also being done? And are you using the ml2 driver? that is another step needed.

@sjamgade
Copy link
Contributor Author

Thanks for input, I was not aware of these steps. let me wip this

@sjamgade sjamgade added the wip label Apr 10, 2019
@dirkmueller
Copy link
Contributor

there is a pending XXX for this for floating (this is the name of ext-net)

@jgrassler
Copy link
Contributor

What is a "pending XXX"?

@@ -445,3 +445,27 @@
only_if { ha_enabled }
end
end

floating_dns_domain = node[:neutron][:floating_dns_domain]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put all of this in post_install_conf after the floating etc is being created? otherwise execution order might be wrong.

Copy link
Contributor

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline

@dirkmueller
Copy link
Contributor

@jgrassler 7ca9b93

@@ -64,6 +64,13 @@ def fetch_rabbitmq_settings(barclamp=@cookbook_name)
end

class CrowbarOpenStackHelper
def self.config_for_role_exists?(name)
shouldbe = "#{name}-config-"
@cached_roles = @cached_roles || Chef::Role.list.keys
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/SelfAssignment: Use self-assignment shorthand ||=. (https://github.com/bbatsov/ruby-style-guide#self-assignment)

Copy link
Contributor

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline comments

chef/cookbooks/neutron/recipes/common_config.rb Outdated Show resolved Hide resolved
@jgrassler
Copy link
Contributor

@jgrassler 7ca9b93

Interesting. i just looked at what Sumit's got and that config section lacked domain information. Upon further investigation we stumbled upon this little gem:

https://github.com/openstack/neutron/blob/stable/rocky/neutron/services/externaldns/drivers/designate/driver.py#L54

tl;dr: the Designate integration in Neutron does not support Keystone V2. We'll try to come up with a patch.

@toabctl
Copy link
Contributor

toabctl commented Apr 12, 2019

tl;dr: the Designate integration in Neutron does not support Keystone V2. We'll try to come up with a patch.

@jgrassler I think you can just set the domain info and set auth_type = password (then you land here: https://github.com/openstack/neutron/blob/stable/rocky/neutron/services/externaldns/drivers/designate/driver.py#L50). iirc using password and having the needed info will automatically select the correct version. But you could also set auth_type = v3password to be sure to use v3. @cmurphy might know more about this...

@cmurphy
Copy link
Contributor

cmurphy commented Apr 12, 2019

Yes, just use auth_type=password and set user_domain_name and project_domain_name

dirkmueller
dirkmueller previously approved these changes Apr 15, 2019
Copy link
Contributor

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments inline to avoid the extra config role lookup as it is not actually used..

chef/cookbooks/neutron/recipes/common_config.rb Outdated Show resolved Hide resolved
@sjamgade
Copy link
Contributor Author

This should be ready for reviews !

Copy link
Contributor

@jgrassler jgrassler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one typo (it appears on multiple lines), otherwise this looks good.

chef/cookbooks/neutron/recipes/post_install_conf.rb Outdated Show resolved Hide resolved

execute "update_dns_domain_for_floating_network" do
command "#{env} neutron net-update floating --dns-domain #{domain_floating}"
not_if "#{openstack_cmd} network show floating -f value -c dns_domain | grep -q #{domain_floating}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [101/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

@sjamgade sjamgade force-pushed the rocky_neutron branch 2 times, most recently from aa52e85 to 43c7e2c Compare April 15, 2019 13:35
The config enabled by the flag lets neutron create dns records when
floating ip are created and assigned. (flag: designate_enabled)
The config was previously added but was not enabled as the barclamp was
still under development. Add designate public url to the config.[1]

Set domain name for fixed and floating network.
This allows neutron to assign correct dns domain to the port as they are
created. There is more information at [1]. This is mainly needed when
integrating neutron with external dns service (designate).  Using the neutron
cli to net-update as openstack cli does not support it
(`openstack help network set` has no option for dns-domain)

Fixed a typo in template for neutron as domains are expected to end with
a dot(.)

[1] https://docs.openstack.org/ocata/networking-guide/config-dns-int.html
@@ -119,6 +119,17 @@
infoblox_settings = neutron[:neutron][:infoblox]
end

designate_public_uri = nil
designate_server = node_search_with_cache("roles:designate-server").first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if there are multiple nodes, as in an HA case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't pose a problem: we just need a node object for any node with the designate role. A little further down we invoke CrowbarHelper.get_host_for_public_url() on that node object and that function will Do The Right Thing on an HA cloud and yield the HA cluster's public host (I've checked in QA's HA enabled test environment).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks!

@dirkmueller dirkmueller merged commit 3b413e2 into crowbar:master Apr 15, 2019
jgrassler added a commit to jgrassler/crowbar-openstack that referenced this pull request Apr 15, 2019
This reverts commit 64e7ad9.

We've are very close to the release and have multiple pull requests still open
for Designate:

* crowbar#2095
* crowbar#2104
* crowbar#2105
* SUSE-Cloud/doc-cloud#931

There are way too many question marks on this so I am
switching the barclamp back to invisible mode. Lets get these
pull requests squared away carefully and without the rush of
imminent release.
sjamgade pushed a commit to sjamgade/crowbar-openstack that referenced this pull request May 16, 2019
This reverts commit 64e7ad9.

We've are very close to the release and have multiple pull requests still open
for Designate:

* crowbar#2095
* crowbar#2104
* crowbar#2105
* SUSE-Cloud/doc-cloud#931

There are way too many question marks on this so I am
switching the barclamp back to invisible mode. Lets get these
pull requests squared away carefully and without the rush of
imminent release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants