aboutsummaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0035-m1.micro-Increase-profile-RAM-size-to-128MB.patch
blob: 89720a2bca09bea1da307a21b4369afb430c2212 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Sat, 11 Jun 2016 23:34:48 +0200
Subject: [PATCH] m1.micro: Increase profile RAM size to 128MB.

TestVM (cirros) on aarch64 requires more than 64MB RAM.
Keep profiles uniform across all archs.

Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 .../f_bootstrap/post-scripts/80_prepare_cross_builds.sh   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh b/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
index 0435a28..078f117 100755
--- a/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
+++ b/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
@@ -66,6 +66,21 @@ if which dpkg > /dev/null 2>&1; then
         ${PYTHON_SITEPKGS_DIR}/fuel_bootstrap/consts.py
       echo "INFO: [xz] => [gzip] updated bootstrap initrd / rootfs compression."
     fi
+
+    # TestVM (cirros) adjustments for cross-arch
+    #
+    # TestVM (cirros) on aarch64 requires more than 64MB RAM.
+    # Keep profiles uniform across all archs by bumping micro flavor specs.
+    # m1.micro: Increase profile RAM size to 128MB.
+    OPENSTACK_VERSION=$(cat /etc/fuel_openstack_version)
+    CONTROLLER_PP="/etc/puppet/${OPENSTACK_VERSION}/modules/openstack_tasks"
+    CONTROLLER_PP+="/manifests/openstack_controller/openstack_controller.pp"
+    if [ -f ${CONTROLLER_PP} ]; then
+      sed -i.bak -r \
+        's/^(.*flavor-create.*m1\.micro auto)\s+[[:digit:]]+(.*)$/\1 128\2/' \
+        ${CONTROLLER_PP}
+      echo "INFO: [64] => [128] updated m1.micro profile RAM size (MB)."
+    fi
   fi
 fi
 
ld; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# certain initialization steps (run in a container) will occur
# on the role marked as primary controller or the first role listed
{%- set primary_role = [roles[0]] -%}
{%- for role in roles -%}
  {%- if 'primary' in role.tags and 'controller' in role.tags -%}
    {%- set _ = primary_role.pop() -%}
    {%- set _ = primary_role.append(role) -%}
  {%- endif -%}
{%- endfor -%}
{%- set primary_role_name = primary_role[0].name -%}
# primary role is: {{primary_role_name}}
{% set deploy_steps_max = 6 -%}

heat_template_version: pike

description: >
  Post-deploy configuration steps via puppet for all roles,
  as defined in ../roles_data.yaml

parameters:
  servers:
    type: json
    description: Mapping of Role name e.g Controller to a list of servers
  stack_name:
    type: string
    description: Name of the topmost stack
  role_data:
    type: json
    description: Mapping of Role name e.g Controller to the per-role data
  DeployIdentifier:
    default: ''
    type: string
    description: >
      Setting this to a unique value will re-run any deployment tasks which
      perform configuration on a Heat stack-update.
  EndpointMap:
    default: {}
    description: Mapping of service endpoint -> protocol. Typically set
                 via parameter_defaults in the resource registry.
    type: json
  DockerPuppetDebug:
    type: string
    default: ''
    description: Set to True to enable debug logging with docker-puppet.py
  ctlplane_service_ips:
    type: json

conditions:
{% for step in range(1, deploy_steps_max) %}
  WorkflowTasks_Step{{step}}_Enabled:
    or:
    {%- for role in roles %}
      - not:
          equals:
            - get_param: [role_data, {{role.name}}, service_workflow_tasks, step{{step}}]
            - ''
      - False
    {%- endfor %}
{% endfor %}

resources:

  RoleConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: ansible
      options:
        modulepath: /usr/share/ansible-modules
      inputs:
        - name: step
        - name: role_name
        - name: update_identifier
        - name: bootstrap_server_id
        - name: docker_puppet_debug
      config: {get_file: deploy-steps-playbook.yaml}

{%- for step in range(1, deploy_steps_max) %}
# BEGIN service_workflow_tasks handling
  WorkflowTasks_Step{{step}}:
    type: OS::Mistral::Workflow
    condition: WorkflowTasks_Step{{step}}_Enabled
    depends_on:
    {%- if step == 1 %}
    {%- for dep in roles %}
      - {{dep.name}}PreConfig
      - {{dep.name}}ArtifactsDeploy
    {%- endfor %}
    {%- else %}
    {%- for dep in roles %}
      - {{dep.name}}Deployment_Step{{step -1}}
    {%- endfor %}
    {%- endif %}
    properties:
      name: {list_join: [".", ["tripleo", {get_param: stack_name}, "workflowtasks", "step{{step}}"]]}
      type: direct
      tasks:
        yaql:
          expression: $.data.where($ != '').select($.get('step{{step}}')).where($ != null).flatten()
          data:
          {%- for role in roles %}
            - get_param: [role_data, {{role.name}}, service_workflow_tasks]
          {%- endfor %}

  WorkflowTasks_Step{{step}}_Execution:
    type: OS::Mistral::ExternalResource
    condition: WorkflowTasks_Step{{step}}_Enabled
    depends_on: WorkflowTasks_Step{{step}}
    properties:
      actions:
        CREATE:
          workflow: { get_resource: WorkflowTasks_Step{{step}} }
          params:
            env:
              service_ips: { get_param: ctlplane_service_ips }
              role_merged_configs:
                {%- for r in roles %}
                {{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
                {%- endfor %}
            evaluate_env: false
        UPDATE:
          workflow: { get_resource: WorkflowTasks_Step{{step}} }
          params:
            env:
              service_ips: { get_param: ctlplane_service_ips }
              role_merged_configs:
                {%- for r in roles %}
                {{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
                {%- endfor %}
            evaluate_env: false
      always_update: true
# END service_workflow_tasks handling
{% endfor %}

{% for role in roles %}
  # Post deployment steps for all roles
  # A single config is re-applied with an incrementing step number
  # {{role.name}} Role steps
  {{role.name}}ArtifactsConfig:
    type: ../puppet/deploy-artifacts.yaml

  {{role.name}}ArtifactsDeploy:
    type: OS::Heat::StructuredDeploymentGroup
    properties:
      servers:  {get_param: [servers, {{role.name}}]}
      config: {get_resource: {{role.name}}ArtifactsConfig}

  {{role.name}}HostPrepConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: ansible
      options:
        modulepath: /usr/share/ansible-modules
      config:
        str_replace:
          template: _PLAYBOOK
          params:
            _PLAYBOOK:
              - hosts: localhost
                connection: local
                vars:
                  puppet_config: {get_param: [role_data, {{role.name}}, puppet_config]}
                  docker_puppet_script: {get_file: docker-puppet.py}
                  docker_puppet_tasks: {get_param: [role_data, {{role.name}}, docker_puppet_tasks]}
                  docker_startup_configs: {get_param: [role_data, {{role.name}}, docker_config]}
                  kolla_config: {get_param: [role_data, {{role.name}}, kolla_config]}
                  bootstrap_server_id: {get_param: [servers, {{primary_role_name}}, '0']}
                  puppet_step_config: {get_param: [role_data, {{role.name}}, step_config]}
                tasks:
                  # Join host_prep_tasks with the other per-host configuration
                  yaql:
                    expression: $.data.host_prep_tasks + $.data.template_tasks
                    data:
                      host_prep_tasks: {get_param: [role_data, {{role.name}}, host_prep_tasks]}
                      template_tasks:
{%- raw %}
                        # Write the manifest for baremetal puppet configuration
                        - name: Create /var/lib/tripleo-config directory
                          file: path=/var/lib/tripleo-config state=directory
                        - name: Write the puppet step_config manifest
                          copy: content="{{puppet_step_config}}" dest=/var/lib/tripleo-config/puppet_step_config.pp force=yes
                        # this creates a JSON config file for our docker-puppet.py script
                        - name: Create /var/lib/docker-puppet
                          file: path=/var/lib/docker-puppet state=directory
                        - name: Write docker-puppet-tasks json files
                          copy: content="{{puppet_config | to_json}}" dest=/var/lib/docker-puppet/docker-puppet.json force=yes
                        # FIXME: can we move docker-puppet somewhere so it's installed via a package?
                        - name: Write docker-puppet.py
                          copy: content="{{docker_puppet_script}}" dest=/var/lib/docker-puppet/docker-puppet.py force=yes
                        # Here we are dumping all the docker container startup configuration data
                        # so that we can have access to how they are started outside of heat
                        # and docker-cmd.  This lets us create command line tools to test containers.
                        # FIXME do we need the docker-container-startup-configs.json or is the new per-step
                        # data consumed by paunch enough?
                        - name: Write docker-container-startup-configs
                          copy: content="{{docker_startup_configs | to_json}}" dest=/var/lib/docker-container-startup-configs.json force=yes
                        - name: Write per-step docker-container-startup-configs
                          copy: content="{{item.value|to_json}}" dest="/var/lib/tripleo-config/docker-container-startup-config-{{item.key}}.json" force=yes
                          with_dict: "{{docker_startup_configs}}"
                        - name: Create /var/lib/kolla/config_files directory
                          file: path=/var/lib/kolla/config_files state=directory
                        - name: Write kolla config json files
                          copy: content="{{item.value|to_json}}" dest="{{item.key}}" force=yes
                          with_dict: "{{kolla_config}}"
                        ########################################################
                        # Bootstrap tasks, only performed on bootstrap_server_id
                        ########################################################
                        - name: Clean /var/lib/docker-puppet/docker-puppet-tasks*.json files
                          file:
                            path: "{{item}}"
                            state: absent
                          with_fileglob:
                            - /var/lib/docker-puppet/docker-puppet-tasks*.json
                          when: deploy_server_id == bootstrap_server_id
                        - name: Write docker-puppet-tasks json files
                          copy: content="{{item.value|to_json}}" dest=/var/lib/docker-puppet/docker-puppet-tasks{{item.key.replace("step_", "")}}.json force=yes
                          with_dict: "{{docker_puppet_tasks}}"
                          when: deploy_server_id == bootstrap_server_id
{%- endraw %}

  {{role.name}}HostPrepDeployment:
    type: OS::Heat::SoftwareDeploymentGroup
    properties:
      servers: {get_param: [servers, {{role.name}}]}
      config: {get_resource: {{role.name}}HostPrepConfig}

  # BEGIN CONFIG STEPS

  {{role.name}}PreConfig:
    type: OS::TripleO::Tasks::{{role.name}}PreConfig
    depends_on: {{role.name}}HostPrepDeployment
    properties:
      servers: {get_param: [servers, {{role.name}}]}
      input_values:
        update_identifier: {get_param: DeployIdentifier}

  {% for step in range(1, deploy_steps_max) %}
  {{role.name}}Deployment_Step{{step}}:
    type: OS::Heat::StructuredDeploymentGroup
    depends_on:
      - WorkflowTasks_Step{{step}}_Execution
    # TODO(gfidente): the following if/else condition
    # replicates what is already defined for the
    # WorkflowTasks_StepX resource and can be remove
    # if https://bugs.launchpad.net/heat/+bug/1700569
    # is fixed.
    {%- if step == 1 %}
    {%- for dep in roles %}
      - {{dep.name}}PreConfig
      - {{dep.name}}ArtifactsDeploy
    {%- endfor %}
    {%- else %}
    {%- for dep in roles %}
      - {{dep.name}}Deployment_Step{{step -1}}
    {%- endfor %}
    {%- endif %}
    properties:
      name: {{role.name}}Deployment_Step{{step}}
      servers: {get_param: [servers, {{role.name}}]}
      config: {get_resource: RoleConfig}
      input_values:
        step: {{step}}
        role_name: {{role.name}}
        update_identifier: {get_param: DeployIdentifier}
        bootstrap_server_id: {get_param: [servers, {{primary_role_name}}, '0']}
        docker_puppet_debug: {get_param: DockerPuppetDebug}
  {% endfor %}
  # END CONFIG STEPS

  # Note, this should be the last step to execute configuration changes.
  # Ensure that all {{role.name}}ExtraConfigPost steps are executed
  # after all the previous deployment steps.
  {{role.name}}ExtraConfigPost:
    depends_on:
  {%- for dep in roles %}
      - {{dep.name}}Deployment_Step5
  {%- endfor %}
    type: OS::TripleO::NodeExtraConfigPost
    properties:
        servers: {get_param: [servers, {{role.name}}]}

  # The {{role.name}}PostConfig steps are in charge of
  # quiescing all services, i.e. in the Controller case,
  # we should run a full service reload.
  {{role.name}}PostConfig:
    type: OS::TripleO::Tasks::{{role.name}}PostConfig
    depends_on:
  {%- for dep in roles %}
      - {{dep.name}}ExtraConfigPost
  {%- endfor %}
    properties:
      servers:  {get_param: servers}
      input_values:
        update_identifier: {get_param: DeployIdentifier}


{% endfor %}