Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 3. Using the heat service for autoscaling
After you deploy the services required to provide autoscaling in the overcloud, you must configure the overcloud environment so that the Orchestration service (heat) can manage instances for autoscaling.
Prerequisites
- A deployed overcloud. For more information, see Section 2.2, “Deploying the overcloud for autoscaling”.
Procedure
3.1. Creating the generic archive policy for autoscaling Link kopierenLink in die Zwischenablage kopiert!
After you deploy the services for autoscaling in the overcloud, you must configure the overcloud environment so that the Orchestration service (heat) can manage the instances for autoscaling.
Prerequisites
- You have deployed an overcloud that has autoscaling services. For more information, see Section 2.1, “Configuring the overcloud for autoscaling”.
Procedure
-
Log in to your environment as the
stack
user. For director environments source the
overcloudrc
overcloud credentials file:source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the archive policy defined in
$HOME/templates/autoscaling/parameters-autoscaling.yaml
:openstack metric archive-policy create generic \ --back-window 0 \ --definition timespan:'4:00:00',granularity:'0:01:00',points:240 \ --aggregation-method 'rate:mean' \ --aggregation-method 'mean'
$ openstack metric archive-policy create generic \ --back-window 0 \ --definition timespan:'4:00:00',granularity:'0:01:00',points:240 \ --aggregation-method 'rate:mean' \ --aggregation-method 'mean'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the archive policy was created:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Configuring a heat template for automatically scaling instances Link kopierenLink in die Zwischenablage kopiert!
You can configure an Orchestration service (heat) template to create the instances, and configure alarms that create and scale instances when triggered.
This procedure uses example values that you must change to suit your environment.
Prerequisites
- You have deployed the overcloud with the autoscaling services. For more information, see Section 2.2, “Deploying the overcloud for autoscaling”.
- You have configured the overcloud with an archive policy for autoscaling telemetry storage. For more information, see Section 3.1, “Creating the generic archive policy for autoscaling”.
Procedure
Log in to your environment as the
stack
user.source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a directory to hold the instance configuration for the autoscaling group:
mkdir -p $HOME/templates/autoscaling/vnf/
$ mkdir -p $HOME/templates/autoscaling/vnf/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create an instance configuration template, for example,
$HOME/templates/autoscaling/vnf/instance.yaml
. Add the following configuration to your
instance.yaml
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The
parameters
parameter defines the custom parameters for this new resource. -
The
vnf
sub-parameter of theresources
parameter defines the name of the custom sub-resource referred to in theOS::Heat::AutoScalingGroup
, for example,OS::Nova::Server::VNF
.
-
The
Create the resource to reference in the heat template:
$ cat <<EOF > $HOME/templates/autoscaling/vnf/resources.yaml resource_registry: "OS::Nova::Server::VNF": $HOME/templates/autoscaling/vnf/instance.yaml EOF
$ cat <<EOF > $HOME/templates/autoscaling/vnf/resources.yaml resource_registry: "OS::Nova::Server::VNF": $HOME/templates/autoscaling/vnf/instance.yaml EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the deployment template for heat to control instance scaling:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteOutputs on the stack are informational and are not referenced in the ScalingPolicy or AutoScalingGroup. To view the outputs, use the
openstack stack show <stack_name>
command.
3.3. Creating the stack deployment for autoscaling Link kopierenLink in die Zwischenablage kopiert!
Create the stack deployment for the worked VNF autoscaling example.
Procedure
Log in to the undercloud host with your overcloud administrator credentials, for example
overcloudrc
:source ~/overcloudrc
(undercloud)$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You must first launch the ephemeral Heat process to use the
openstack stack
commands:openstack tripleo launch heat --heat-dir /home/stack/overcloud-deploy/overcloud/heat-launcher --restore-db export OS_CLOUD=heat
(undercloud)$ openstack tripleo launch heat --heat-dir /home/stack/overcloud-deploy/overcloud/heat-launcher --restore-db (undercloud)$ export OS_CLOUD=heat
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the stack:
openstack stack create \ -t $HOME/templates/autoscaling/vnf/template.yaml \ -e $HOME/templates/autoscaling/vnf/resources.yaml \ vnf
$ openstack stack create \ -t $HOME/templates/autoscaling/vnf/template.yaml \ -e $HOME/templates/autoscaling/vnf/resources.yaml \ vnf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the stack was created successfully:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the stack resources were created, including alarms, scaling policies, and the autoscaling group:
export STACK_ID=$(openstack stack show vnf -c id -f value)
$ export STACK_ID=$(openstack stack show vnf -c id -f value)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that an instance was launched by the stack creation:
openstack server list --long | grep $STACK_ID
$ openstack server list --long | grep $STACK_ID | 62e1b27c-8d9d-44a5-a0f0-80e7e6d437c7 | vn-dvaxcqb-6bqh2qd2fpif-hicmkm5dzjug-vnf-ywrydc5wqjjc | ACTIVE | None | Running | private=192.168.100.61, 192.168.25.99 | fedora36 | a6aa7b11-1b99-4c62-a43b-d0b7c77f4b72 | m1.small | 5cd46fec-50c2-43d5-89e8-ed3fa7660852 | nova | host-80.localdomain | metering.server_group='cb082cbd-535e-4779-84b0-98925e103f5e' |
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the alarms were created for the stack:
List the alarm IDs. The state of the alarms might reside in the
insufficient data
state for a period of time. The minimal period of time is the polling interval of the data collection and data storage granularity setting:Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the resources for the stack and note the
physical_resource_id
values for thecpu_alarm_high
andcpu_alarm_low
resources.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The value of the
physical_resource_id
must match thealarm_id
in the output of theopenstack alarm list
command.
Verify that metric resources exist for the stack. Set the value of the
server_group
query to the stack ID:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that measurements exist for the instance resources created through the stack:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the ephemeral Heat process from the undercloud:
openstack tripleo launch heat --kill
(undercloud)$ openstack tripleo launch heat --kill
Copy to Clipboard Copied! Toggle word wrap Toggle overflow