Merge "Create default flavors in nova"

This commit is contained in:
Jenkins 2016-04-06 17:53:35 +00:00 committed by Gerrit Code Review
commit cb1b506d99
2 changed files with 20 additions and 0 deletions

View File

@ -932,6 +932,25 @@ function stop_nova {
stop_nova_compute stop_nova_compute
} }
# create_instance_types(): Create default flavors
function create_flavors {
if ! openstack flavor list | grep -q ds512M; then
# Note that danms hates these flavors and apologizes for sdague
openstack flavor create --id c1 --ram 256 --disk 0 --vcpus 1 cirros256
openstack flavor create --id d1 --ram 512 --disk 5 --vcpus 1 ds512M
openstack flavor create --id d2 --ram 1024 --disk 10 --vcpus 1 ds1G
openstack flavor create --id d3 --ram 2048 --disk 10 --vcpus 2 ds2G
openstack flavor create --id d4 --ram 4096 --disk 20 --vcpus 4 ds4G
fi
if ! openstack flavor list | grep -q m1.tiny; then
openstack flavor create --id 1 --ram 512 --disk 1 --vcpus 1 m1.tiny
openstack flavor create --id 2 --ram 2048 --disk 20 --vcpus 1 m1.small
openstack flavor create --id 3 --ram 4096 --disk 40 --vcpus 2 m1.medium
openstack flavor create --id 4 --ram 8192 --disk 80 --vcpus 4 m1.large
openstack flavor create --id 5 --ram 16384 --disk 160 --vcpus 8 m1.xlarge
fi
}
# Restore xtrace # Restore xtrace
$_XTRACE_LIB_NOVA $_XTRACE_LIB_NOVA

View File

@ -1251,6 +1251,7 @@ fi
if is_service_enabled nova; then if is_service_enabled nova; then
echo_summary "Starting Nova" echo_summary "Starting Nova"
start_nova start_nova
create_flavors
fi fi
if is_service_enabled cinder; then if is_service_enabled cinder; then
echo_summary "Starting Cinder" echo_summary "Starting Cinder"