Update local mirrors

Update local mirrors

If you use local mirrors in the MCP cluster, you must update the local mirror VM before updating DriveTrain to a minor release version. Otherwise, skip this section and proceed with Update DriveTrain.

You can update local mirrors either manually or by replacing the existing local mirror VM with the latest version.

To replace the existing local mirror VM:

Warning

This procedure implies recreation of the apt01 VM. Therefore, all existing customizations applied to the local mirror VM will be lost. To keep the existing customizations, use the manual procedure below instead.

  1. Log in to the Salt Master node.

  2. Download the latest version of the prebuilt http://images.mirantis.com/mcp-offline-image-<BUILD-ID>.qcow2 image for the apt01 node from http://images.mirantis.com.

  3. Copy the new image to /var/lib/libvirt/images/apt01/.

  4. Power off the existing apt01 VM instance:

    virsh shutdown apt01.<CLUSTER_DOMAIN>
    
  5. If the local mirror VM is connected to the Salt Master node, temporarily remove it from the available minions:

    salt-key
    salt-key -d <local-mirror-node-name>
    

    Note

    The local mirror VM will be automatically connected back to the Salt Master node once the updated VM is deployed.

  6. Deploy the apt01 VM instance with the new image as described in MCP Deployment Guide: Deploy the APT node.

  7. Once the local mirror VM with the new image is up and running, verify that your current Reclass system model has the correct origin set:

    cd /srv/salt/reclass/classes/system
    git remote -v
    

    Optional. You may set origin to your local mirror VM as it now has the latest update version of the Reclass system model:

    git remote remove origin
    git remote add origin http://<local_mirror_vm_ip>:8088/reclass-system.git
    
  8. For an OpenContrail-based MCP cluster with the Build ID 2019.2.5 or earlier:

    1. Verify whether the MCP cluster uses internal_proxy:

      salt -C 'I@docker:host' pillar.get docker:host:proxy:enabled
      

      Depending on the system output, add the corresponding pillar in the next step.

    2. Add the following pillar to /opencontrail/control.yml and opencontrail/analytics.yml:

      • For MCP clusters with internal_proxy enabled:

        parameters:
          ...
          docker:
            host:
              proxy:
                enabled: true
                http: ${_param:http_proxy}
                https: ${_param:http_proxy}
                no_proxy: ${linux:system:proxy:noproxy}
              insecure_registries:
                - ${_param:aptly_server_hostname}:5000
        
      • For MCP clusters with internal_proxy disabled:

        parameters:
          ...
          docker:
            host:
              insecure_registries:
                - ${_param:aptly_server_hostname}:5000
        
    3. Commit the changes to your local repository.

    4. Apply the changes:

      salt -C 'I@opencontrail:database' state.sls docker.host
      

Now, you can proceed with the step 2 of the Update DriveTrain procedure.


To update the local mirror VM manually:

Note

The procedure below requires access to the Internet.

  1. Log in to the Salt Master node.

  2. Verify the availability of the local mirror VM. For example:

    salt 'apt01.local-deployment.local' test.ping
    

    If the VM does not respond, enable the management of the offline mirror VM through the Salt Master node as described in MCP Deployment Guide: Enable the APT node management in the Reclass model.

  3. Update the system level of the Reclass model. For example, using the Git submodule:

    Note

    If the Reclass system model has git origin set to the internal mirror repository, update it first.

    cd /srv/salt/reclass/ && git submodule foreach git fetch
    cd /srv/salt/reclass/classes/system && git checkout origin/release/2019.2.0
    
  4. Open the cluster level of your Reclass model.

  5. In /infra/mirror/init.yml:

    • Add the Git server parameters:

      git:
        server:
          directory: /srv/git/
          repos: ${_param:default_local_mirrror_content:git_server_repos}
      
    • Include the debmirror content class:

      - system.debmirror.mirror_mirantis_com
      
    • Include the Docker registry class:

      docker:
        client:
          registry:
            target_registry: ${_param:default_local_mirrror_content:docker_client_registry_target_registry}
            image: ${_param:default_local_mirrror_content:docker_client_registry_image}
      
    • Include the static files class:

      linux:
        system:
          file: ${_param:default_local_mirrror_content:linux_system_file}
      
    • Include the MAAS mirror class:

      maas:
        mirror:
          enabled: true
          image:
            sections: ${_param:default_local_mirrror_content:maas_mirror_image_sections}
      
  6. For an OpenContrail-based MCP cluster with the Build ID 2019.2.5 or earlier:

    1. Verify whether the MCP cluster uses internal_proxy:

      salt -C 'I@docker:host' pillar.get docker:host:proxy:enabled
      

      Depending on the system output, add the corresponding pillar in the next step.

    2. Add the following pillar to /opencontrail/control.yml and opencontrail/analytics.yml:

      • For the MCP clusters with internal_proxy enabled:

        parameters:
          ...
          docker:
            host:
              proxy:
                enabled: true
                http: ${_param:http_proxy}
                https: ${_param:http_proxy}
                no_proxy: ${linux:system:proxy:noproxy}
              insecure_registries:
                - ${_param:aptly_server_hostname}:5000
        
      • For the MCP clusters with internal_proxy disabled:

        parameters:
          ...
          docker:
            host:
              insecure_registries:
                - ${_param:aptly_server_hostname}:5000
        
  7. Commit the changes to your local repository.

  8. Synchronize the Salt modules:

    salt '<offline_node_name>' saltutil.sync_all
    
  9. Apply the following states:

    salt '<offline_node_name>' state.sls git.server
    salt '<offline_node_name>' state.sls debmirror
    salt '<offline_node_name>' state.sls docker.client.registry
    salt '<offline_node_name>' state.sls linux.system.file
    salt '<offline_node_name>' state.sls maas.mirror
    
  10. For an OpenContrail-based MCP cluster, apply the changes made in the step 6:

    salt -C 'I@opencontrail:database' state.sls docker.host
    

Now, you can proceed with the step 2 of the Update DriveTrain procedure.