aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-10-02 09:12:43 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-10-03 01:15:42 -0400
commite575ce2c01028a2b4c0273ca04fd6dbb8d9ece76 (patch)
tree6e4472c8c2a81d2fedb8320fd7de62bf743bb279
parentdfead22088d47a052d2170e126a5c52d942b35d2 (diff)
downloadmeta-cloud-services-e575ce2c01028a2b4c0273ca04fd6dbb8d9ece76.tar.gz
meta-cloud-services-e575ce2c01028a2b4c0273ca04fd6dbb8d9ece76.tar.bz2
meta-cloud-services-e575ce2c01028a2b4c0273ca04fd6dbb8d9ece76.zip
openstack: create simple deployment framework
To facilitate the creation of a simple OpenStack configuration with a single control and compute node, several things should be known at build time (since in this simple configuration, we are not using dhcp, or other name resolution techniques): - The IP of control node - The IP of the compute node - The IP of the node being built From these values, the OpenStack components and support applications (databases, access control, etc) are configured, as well as simple name resolution generated at build time. A single "hosts" bbclass should be provided with the following values: COMPUTE_IP ?= "192.168.7.4" COMPUTE_HOST ?= "compute" CONTROLLER_IP ?= "192.168.7.2" CONTROLLER_HOST ?= "controller" MY_IP ?= "${CONTROLLER_IP}" MY_HOST ?= "${CONTROLLER_HOST}" The above example is for a control node, using the runqemu default addresses. The openstack-base.bbclass is responsible for generating /etc/hosts and /etc/hostname. Any image type that requires these values at boot tiem, should inherit this class to allow its rootfs post population hooks to run and generate the required configuration. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--meta-openstack-compute-deploy/classes/compute.bbclass2
-rw-r--r--meta-openstack-compute-deploy/classes/hosts.bbclass6
-rw-r--r--meta-openstack-controller-deploy/classes/controller.bbclass2
-rw-r--r--meta-openstack-controller-deploy/classes/hosts.bbclass7
-rw-r--r--meta-openstack/classes/compute.bbclass2
-rw-r--r--meta-openstack/classes/controller.bbclass2
-rw-r--r--meta-openstack/classes/hosts.bbclass1
-rw-r--r--meta-openstack/classes/openstack-base.bbclass12
8 files changed, 26 insertions, 8 deletions
diff --git a/meta-openstack-compute-deploy/classes/compute.bbclass b/meta-openstack-compute-deploy/classes/compute.bbclass
deleted file mode 100644
index 46749b1..0000000
--- a/meta-openstack-compute-deploy/classes/compute.bbclass
+++ /dev/null
@@ -1,2 +0,0 @@
-CONTROLLER_IP ?= "192.168.7.2"
-CONTROLLER_HOST ?= "192.168.7.2"
diff --git a/meta-openstack-compute-deploy/classes/hosts.bbclass b/meta-openstack-compute-deploy/classes/hosts.bbclass
new file mode 100644
index 0000000..5376b02
--- /dev/null
+++ b/meta-openstack-compute-deploy/classes/hosts.bbclass
@@ -0,0 +1,6 @@
+COMPUTE_IP ?= "192.168.7.4"
+COMPUTE_HOST ?= "compute"
+CONTROLLER_IP ?= "192.168.7.2"
+CONTROLLER_HOST ?= "controller"
+MY_IP ?= "${COMPUTE_IP}"
+MY_HOST ?= "${COMPUTE_HOST}"
diff --git a/meta-openstack-controller-deploy/classes/controller.bbclass b/meta-openstack-controller-deploy/classes/controller.bbclass
deleted file mode 100644
index 1db2714..0000000
--- a/meta-openstack-controller-deploy/classes/controller.bbclass
+++ /dev/null
@@ -1,2 +0,0 @@
-CONTROLLER_IP = "0.0.0.0"
-CONTROLLER_HOST = "localhost"
diff --git a/meta-openstack-controller-deploy/classes/hosts.bbclass b/meta-openstack-controller-deploy/classes/hosts.bbclass
new file mode 100644
index 0000000..3b83aa5
--- /dev/null
+++ b/meta-openstack-controller-deploy/classes/hosts.bbclass
@@ -0,0 +1,7 @@
+# controller hosts file
+COMPUTE_IP ?= "192.168.7.4"
+COMPUTE_HOST ?= "compute"
+CONTROLLER_IP ?= "192.168.7.2"
+CONTROLLER_HOST ?= "controller"
+MY_IP ?= "${CONTROLLER_IP}"
+MY_HOST ?= "${CONTROLLER_HOST}"
diff --git a/meta-openstack/classes/compute.bbclass b/meta-openstack/classes/compute.bbclass
deleted file mode 100644
index 3ed38e0..0000000
--- a/meta-openstack/classes/compute.bbclass
+++ /dev/null
@@ -1,2 +0,0 @@
-CONTROLLER_IP = "192.168.7.2"
-CONTROLLER_HOST = "192.168.7.2"
diff --git a/meta-openstack/classes/controller.bbclass b/meta-openstack/classes/controller.bbclass
deleted file mode 100644
index 1db2714..0000000
--- a/meta-openstack/classes/controller.bbclass
+++ /dev/null
@@ -1,2 +0,0 @@
-CONTROLLER_IP = "0.0.0.0"
-CONTROLLER_HOST = "localhost"
diff --git a/meta-openstack/classes/hosts.bbclass b/meta-openstack/classes/hosts.bbclass
new file mode 100644
index 0000000..4258d46
--- /dev/null
+++ b/meta-openstack/classes/hosts.bbclass
@@ -0,0 +1 @@
+# to be overriden
diff --git a/meta-openstack/classes/openstack-base.bbclass b/meta-openstack/classes/openstack-base.bbclass
new file mode 100644
index 0000000..565470b
--- /dev/null
+++ b/meta-openstack/classes/openstack-base.bbclass
@@ -0,0 +1,12 @@
+inherit hosts
+
+ROOTFS_POSTPROCESS_COMMAND += "openstack_configure_hosts ; "
+
+openstack_configure_hosts() {
+ bbnote "openstack: identifying hosts"
+
+ echo "${CONTROLLER_IP} controller" >> ${IMAGE_ROOTFS}/etc/hosts
+ echo "${COMPUTE_IP} compute" >> ${IMAGE_ROOTFS}/etc/hosts
+ echo "${MY_HOST}" > ${IMAGE_ROOTFS}/etc/hostname
+}
+