...
The same information is also available through the CLI:
Code Block | ||||
---|---|---|---|---|
| ||||
$ openstack stack show Common +-----------------------+-----------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------------------------------------------------+ | id | 2abc3c47-044a-4075-a1f6-422ee49376d8 | | stack_name | Common | | description | A template to create common base infrastructure for the heat-guide at | | | https://www.ntnu.no/wiki/display/skyhigh/Openstack+Heat | | | | | creation_time | 2022-08-30T13:51:20Z | | updated_time | None | | stack_status | CREATE_COMPLETE | | stack_status_reason | Stack CREATE completed successfully | | parameters | OS::project_id: 74729572aad24d93b9a4cac7301ef9d1 | | | OS::stack_id: 2abc3c47-044a-4075-a1f6-422ee49376d8 | | | OS::stack_name: Common | | | | | outputs | - description: The security-group allowing generiv VM access. | | | output_key: secgroup_generic | | | output_value: 30586c14-7bc1-4ef4-91dc-2089eb32ec23 | | | - description: The network created by the template | | | output_key: network | | | output_value: db265ea1-1d85-47f1-ba3a-714174da114e | | | | | links | - href: https://api.stack.it.ntnu.no:8004/v1/74729572aad24d93b9a4cac7301ef9d1/stacks/Common/2abc3c47-044a-4075- | | | a1f6-422ee49376d8 | | | rel: self | | | | | deletion_time | None | | notification_topics | [] | | capabilities | [] | | disable_rollback | True | | timeout_mins | 60 | | stack_owner | eigilo | | parent | None | | stack_user_project_id | 9865a03e9eb042bc9de03578a9eca6ed | | tags | [] | | | | +-----------------------+-----------------------------------------------------------------------------------------------------------------+ |
Student Lab
The second template we are going to create two virual machies; one fileserver connected to an extra volume and one client connecting to this fileserver. This template should be possible to start multiple times to create multiple machines. It will also demonstrate how to configure machines using both cloud-config and shell-scripts.
Parameters
This template should be able to recieve parameters when it is created, to allow variations of the template being created. Parameters can in heat be defined like so:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
parameters:
flavor:
type: string
label: Fileserver flavor
description: The flavor used to spawn the fileserver
constraints:
- custom_constraint: nova.flavor
ubuntu:
type: string
label: Fileserver image
description: The image used to spawn the fileserver
constraints:
- custom_constraint: glance.image
admin-ssh-key:
type: string
label: SSH Key admin
description: The SSH-key to inject in the fileserver for admin-purposes.
user-ssh-key:
type: string
label: SSH Key User
description: The SSH-key to inject in the fileserver for the user user.
secgroup_generic:
type: string
network:
type: string
volume_type:
type: string
label: Volume type
description: The cinder-type used to create the volume for the fileserver
default: 'HDD-300'
constraints:
- custom_constraint: cinder.vtype
volume_size:
type: number
label: Volume size
default: 2
description: The size of the exported volume from the fileserver |
The parameters for this template would thus be:
- flavor: An openstack flavor defining the specifications for the two virtual machines we are going to make
- ubuntu: The ID of the openstack-image which we are using to create our VM's
- admin-ssh-key: An ssh-key to be injected into the "administrator" user of the machines
- user-ssh-key: An ssh-key to be injected into the "user" user of the machines
- secgroup_generic: The ID of the security-group to use
- network: The ID of the network to connect the machines to
- volume_type: The name of the Openstack volume type to use. This one defaults to "HDD-300", and you do not need to specify it unless you want another type.
- volume_size: The size og the volume attached to the fileserver. This one defaults to "2", an you do not need to specify it unless you want another size.