Optionally deploy undercloud node with OVB

this allows us to deploy and boot an additional node which we can have
ready along side the undercloud node itself.

Change-Id: I352de761841568e2820ba334757496702980d65a
This commit is contained in:
Juan Antonio Osorio Robles 2016-12-19 18:44:51 +02:00
parent 0c72c92718
commit 79273c51dc
3 changed files with 21 additions and 2 deletions

View File

@ -4,6 +4,7 @@ set -ex
ENVNUM=${1:-$(date +%s)}
NODECOUNT=${2:-2}
UCINSTANCE=${3:-}
CREATE_UNDERCLOUD=${4:-""}
PROVISIONNET=provision-${ENVNUM}
PUBLICNET=public-${ENVNUM}
ENVFILE=env-${ENVNUM}.yaml
@ -28,7 +29,17 @@ sed -i -e "s/os_tenant:.*/os_tenant: $OS_TENANT_NAME/" $ENVFILE
sed -i -e "s/os_user:.*/os_user: $OS_USERNAME/" $ENVFILE
sed -i -e "s/provision_net_shared:.*/provision_net_shared: true/" $ENVFILE
sed -i -e "s/public_net_shared:.*/public_net_shared: true/" $ENVFILE
echo -e 'resource_registry:\n OS::OVB::UndercloudEnvironment: OS::Heat::None' >> $ENVFILE
if [ -n "$CREATE_UNDERCLOUD" ]; then
sed -i -e "s/undercloud_name:.*/undercloud_name: extra-node/" $ENVFILE
sed -i -e "s/undercloud_flavor:.*/undercloud_flavor: m1.small/" $ENVFILE
fi
echo -e 'resource_registry:\n' >> $ENVFILE
if [ -z "$CREATE_UNDERCLOUD" ]; then
echo ' OS::OVB::UndercloudEnvironment: OS::Heat::None' >> $ENVFILE
fi
echo ' OS::OVB::UndercloudFloating: templates/undercloud-floating-none.yaml' >> $ENVFILE
echo ' OS::OVB::BaremetalNetworks: templates/baremetal-networks-all.yaml' >> $ENVFILE
echo ' OS::OVB::BaremetalPorts: templates/baremetal-ports-all.yaml' >> $ENVFILE

View File

@ -126,7 +126,12 @@ class TEWorkerThread(threading.Thread):
with tempfile.NamedTemporaryFile('r') as fp:
os.environ["TE_DATAFILE"] = fp.name
logger.info(
subprocess.check_output([self.scriptfiles[0], self.num, arguments.get("envsize","2"), arguments.get("ucinstance","")], stderr=subprocess.STDOUT))
subprocess.check_output([self.scriptfiles[0],
self.num,
arguments.get("envsize","2"),
arguments.get("ucinstance",""),
arguments.get("create_undercloud", "")],
stderr=subprocess.STDOUT))
clientdata = fp.read()
except subprocess.CalledProcessError as e:
logger.error(e.output)

View File

@ -153,6 +153,8 @@ def main(args=sys.argv[1:]):
parser.add_argument('--ucinstance',
help='uuid for the undercloud instance (where an '
'interface on the provisioning net is attached')
parser.add_argument('--create-undercloud', action='store_true',
help='deploy the undercloud node.')
parser.add_argument('--debug', '-d', action='store_true',
help='Set to debug mode.')
opts = parser.parse_args(args)
@ -172,6 +174,7 @@ def main(args=sys.argv[1:]):
"timeout": opts.timeout,
"envsize":opts.envsize,
"ucinstance":opts.ucinstance,
"create_undercloud": "true" if opts.create_undercloud else "",
}
job = gear.Job('lockenv', json.dumps(job_params))
client.submitJob(job)