diff options
| author | Andy Ning <andy.ning@windriver.com> | 2014-06-13 11:21:16 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-06-18 15:08:37 -0400 |
| commit | c030ef7f8c2a15f7c7d0faa7122d99b853133e9f (patch) | |
| tree | c45413abdf3bf0e703614c4f5ff6df2317a432d4 /meta-openstack/recipes-devtools/python/python-neutron_git.bb | |
| parent | d4843bbf0b3d2c7019be1d67c174a9826e69e41a (diff) | |
| download | meta-cloud-services-c030ef7f8c2a15f7c7d0faa7122d99b853133e9f.tar.gz | |
Add metadata service support to controller node
The metadata service is working as the following:
- metadata is being served by nova-api on controller at port 8775.
- VM instance requests metadata by 169.254.169.254 (eg, curl http://169.254.169.254/latest/meta-data)
- metadata request comes to neutron-ns-metadata-proxy on controller in dhcp network name space.
- neutron-ns-metadata-proxy forwards the request to neutron-metadata-agent through a unix domain socket (/var/lib/neutron/metadata_proxy).
- neutron-metadata-agent sends the request to nova-api on port 8775 to be serviced.
To support metadata service, neutron-ns-metadata-proxy is baked into the controller image. Also neutron-metadata-agent startup script
(/etc/init.d/neutron-metadata-agent) and config file (/etc/neutron/metadata_agent.ini) are added to start up metadata agent at system
initialization. dhcp_agent.ini and nova.conf are updated as well.
A README.metadata is added in the Documentation/ directory.
Signed-off-by: Andy Ning <andy.ning@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-neutron_git.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-neutron_git.bb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index 4cf4751..2a581ca 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb | |||
| @@ -14,6 +14,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ | |||
| 14 | file://neutron-agent.init \ | 14 | file://neutron-agent.init \ |
| 15 | file://l3_agent.ini \ | 15 | file://l3_agent.ini \ |
| 16 | file://dhcp_agent.ini \ | 16 | file://dhcp_agent.ini \ |
| 17 | file://metadata_agent.ini \ | ||
| 17 | file://neutron-dhcp-agent-netns-cleanup.cron \ | 18 | file://neutron-dhcp-agent-netns-cleanup.cron \ |
| 18 | " | 19 | " |
| 19 | SRCREV="a8417d78c2675a2ceb5dbfcee70948a88d69e747" | 20 | SRCREV="a8417d78c2675a2ceb5dbfcee70948a88d69e747" |
| @@ -84,6 +85,22 @@ do_install_append() { | |||
| 84 | install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent | 85 | install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent |
| 85 | install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/ | 86 | install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/ |
| 86 | fi | 87 | fi |
| 88 | |||
| 89 | AGENT=metadata | ||
| 90 | ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/metadata_agent.ini" | ||
| 91 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 92 | sed "s:@suffix@:$AGENT:;s:@args@:$ARGS:" < ${WORKDIR}/neutron-agent.init >${WORKDIR}/neutron-$AGENT.init.sh | ||
| 93 | install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent | ||
| 94 | install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/ | ||
| 95 | fi | ||
| 96 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | ||
| 97 | -i ${NEUTRON_CONF_DIR}/metadata_agent.ini | ||
| 98 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" \ | ||
| 99 | -i ${NEUTRON_CONF_DIR}/metadata_agent.ini | ||
| 100 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 101 | -i ${NEUTRON_CONF_DIR}/metadata_agent.ini | ||
| 102 | sed -e "s:%METADATA_SHARED_SECRET%:${METADATA_SHARED_SECRET}:g" \ | ||
| 103 | -i ${NEUTRON_CONF_DIR}/metadata_agent.ini | ||
| 87 | 104 | ||
| 88 | cp run_tests.sh ${NEUTRON_CONF_DIR} | 105 | cp run_tests.sh ${NEUTRON_CONF_DIR} |
| 89 | } | 106 | } |
| @@ -175,8 +192,9 @@ FILES_${SRCNAME}-l3-agent = "${bindir}/neutron-l3-agent \ | |||
| 175 | " | 192 | " |
| 176 | 193 | ||
| 177 | FILES_${SRCNAME}-metadata-agent = "${bindir}/neutron-metadata-agent \ | 194 | FILES_${SRCNAME}-metadata-agent = "${bindir}/neutron-metadata-agent \ |
| 195 | ${bindir}/neutron-ns-metadata-proxy \ | ||
| 178 | ${sysconfdir}/${SRCNAME}/metadata_agent.ini \ | 196 | ${sysconfdir}/${SRCNAME}/metadata_agent.ini \ |
| 179 | ${sysconfdir}/init.d/metadata_agent \ | 197 | ${sysconfdir}/init.d/neutron-metadata-agent \ |
| 180 | " | 198 | " |
| 181 | 199 | ||
| 182 | FILES_${SRCNAME}-extra-agents = "${bindir}/*" | 200 | FILES_${SRCNAME}-extra-agents = "${bindir}/*" |
| @@ -226,7 +244,7 @@ RDEPENDS_${SRCNAME}-setup = "postgresql sudo" | |||
| 226 | 244 | ||
| 227 | RRECOMMENDS_${SRCNAME}-server = "${SRCNAME}-plugin-openvswitch" | 245 | RRECOMMENDS_${SRCNAME}-server = "${SRCNAME}-plugin-openvswitch" |
| 228 | 246 | ||
| 229 | INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge ${SRCNAME}-dhcp-agent ${SRCNAME}-l3-agent" | 247 | INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge ${SRCNAME}-dhcp-agent ${SRCNAME}-l3-agent ${SRCNAME}-metadata-agent" |
| 230 | INITSCRIPT_NAME_${SRCNAME}-server = "neutron-server" | 248 | INITSCRIPT_NAME_${SRCNAME}-server = "neutron-server" |
| 231 | INITSCRIPT_PARAMS_${SRCNAME}-server = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 249 | INITSCRIPT_PARAMS_${SRCNAME}-server = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
| 232 | INITSCRIPT_NAME_${SRCNAME}-plugin-openvswitch = "neutron-openvswitch-agent" | 250 | INITSCRIPT_NAME_${SRCNAME}-plugin-openvswitch = "neutron-openvswitch-agent" |
| @@ -237,3 +255,5 @@ INITSCRIPT_NAME_${SRCNAME}-dhcp-agent = "neutron-dhcp-agent" | |||
| 237 | INITSCRIPT_PARAMS_${SRCNAME}-dhcp-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 255 | INITSCRIPT_PARAMS_${SRCNAME}-dhcp-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
| 238 | INITSCRIPT_NAME_${SRCNAME}-l3-agent = "neutron-l3-agent" | 256 | INITSCRIPT_NAME_${SRCNAME}-l3-agent = "neutron-l3-agent" |
| 239 | INITSCRIPT_PARAMS_${SRCNAME}-l3-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 257 | INITSCRIPT_PARAMS_${SRCNAME}-l3-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
| 258 | INITSCRIPT_NAME_${SRCNAME}-metadata-agent = "neutron-metadata-agent" | ||
| 259 | INITSCRIPT_PARAMS_${SRCNAME}-metadata-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | ||
