Last active
August 29, 2015 14:05
-
-
Save jeffrey4l/f07a67655d55c6b9ac30 to your computer and use it in GitHub Desktop.
nova flavor init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add following line to the local_settings.py file to order the flavor | |
| def flavor_sort_key(flavor): | |
| order_prefix = { | |
| 'micro': '1', | |
| 'standard': '2', | |
| 'compute': '3', | |
| 'memory': '4', | |
| } | |
| name = flavor.name | |
| try: | |
| prefix, _type = name.split('-') | |
| return "{}-{}-{:02}".format(order_prefix.get(prefix,'0'), prefix, int(_type)) | |
| except: | |
| return name | |
| CREATE_INSTANCE_FLAVOR_SORT = { | |
| 'key': flavor_sort_key, | |
| 'reverse': False, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| nova-manage flavor create --name micro-1 --cpu 1 --memory 512 --root_gb 40 --is_public True | |
| nova-manage flavor create --name micro-2 --cpu 1 --memory 1024 --root_gb 40 --is_public True | |
| nova-manage flavor create --name standard-1 --cpu 1 --memory 2048 --root_gb 40 --is_public True | |
| nova-manage flavor create --name standard-2 --cpu 2 --memory 4096 --root_gb 40 --is_public True | |
| nova-manage flavor create --name standard-4 --cpu 4 --memory 8192 --root_gb 40 --is_public True | |
| nova-manage flavor create --name standard-8 --cpu 8 --memory 16384 --root_gb 40 --is_public True | |
| nova-manage flavor create --name standard-12 --cpu 12 --memory 24576 --root_gb 40 --is_public True | |
| nova-manage flavor create --name memory-1 --cpu 1 --memory 4096 --root_gb 40 --is_public True | |
| nova-manage flavor create --name memory-2 --cpu 2 --memory 8192 --root_gb 40 --is_public True | |
| nova-manage flavor create --name memory-4 --cpu 4 --memory 16384 --root_gb 40 --is_public True | |
| nova-manage flavor create --name memory-8 --cpu 8 --memory 24576 --root_gb 40 --is_public True | |
| nova-manage flavor create --name compute-2 --cpu 2 --memory 2048 --root_gb 40 --is_public True | |
| nova-manage flavor create --name compute-4 --cpu 4 --memory 4096 --root_gb 40 --is_public True | |
| nova-manage flavor create --name compute-8 --cpu 8 --memory 8192 --root_gb 40 --is_public True | |
| nova-manage flavor create --name compute-12 --cpu 12 --memory 16384 --root_gb 40 --is_public True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment