Modeling environments for VMware vCenter

To model a VMware vCenter environment, log in with a VCenter cloud project and specify the VCenter-specific information in a blueprint.

Before you begin

Procedure

  1. Create the blueprint:
    1. Click Blueprints.
    2. Click New.
    3. In the Add a New File window, specify a name for the blueprint.
    4. To set the repository in which the blueprint is saved, select a project from the Project list. The project list contains the default project and a project for each team. Each project except the default project corresponds to both a team and a Git repository of the same name. The default project is not associated with a team, and blueprints that are associated with the default project cannot be shared with other users.
    5. In the Type list, select Blueprint, and then click Save.
  2. Add resources from the palette to the blueprint, such as virtual images. The palette shows resources from the currently connected cloud, which is shown at the upper right of the page. For more information on working with the blueprint designer, see Editing blueprint diagrams and Editing blueprint source code.
  3. Optional: To provision the images in a specific folder on the cloud, add a destination_folder metadata property to each image, as in the following example code. The target folder must already exist on the vCenter system.
    linux_image_A:
      type: OS::Nova::Server
      properties:
        name: "My image A"
        image: "MyImage123"
      metadata:
        vmware_properties:
          destination_folder: "/MyImageFolder/MyNewImages"
  4. Optional: If you configured your provisioned virtual image for SSH, to access to the virtual image through SSH, you must add resources to the blueprint source code.
    • If your virtual image does not contain a component, add the OS::Heat::MultipartMime and OS::Heat::CloudConfig resources:
        multipart:
          type: OS::Heat::MultipartMime
          properties:
            parts:
              - config: {get_resource: cloud_config}
              subtype: cloud-config
      
        cloud_config:
          type: OS::Heat::CloudConfig
          properties:
            cloud_config:
              users:
                - default
                - name: "user_ID"
                  lock-passwd: true
                  sudo: ALL=(ALL) NOPASSWD:ALL
                  ssh-authorized-keys:
                    - { get_param: key_name }
      • For the user_ID, specify the login ID for the virtual image.
      • Ensure that the resource name of the OS::Heat::CloudConfig resource is specified in the - config: {get_resource: cloud_config} property in the OS::Heat::MultipartMime resource.
      • The key_name parameter must be in the following form:
        parameters:
          key_name: "ssh-rsa s1AAB3Nza45yc2EA27AADAQADDABAQC jsmith@example.com"
      Additionally, the OS::Nova::Server resource must contain the user_data_format and user_data properties. For example, if your virtual image name is linux_image_B, the OS::Nova::Server resource contains the following code:
      linux_image_B:
        type: OS::Nova::Server
        properties:
          user_data_format: SOFTWARE_CONFIG
          user_data: {get_resource: multipart}

      Ensure that the resource name of the OS::Heat::MultipartMime resource is specified in the user_data: {get_resource: multipart} property in the OS::Nova::Server resource.

    • If your virtual image does contain a component, add the OS::Heat::CloudConfig resource:
        cloud_config:
          type: OS::Heat::CloudConfig
          properties:
            cloud_config:
              users:
                - default
                - name: "user_ID"
                  lock-passwd: true
                  sudo: ALL=(ALL) NOPASSWD:ALL
                  ssh-authorized-keys:
                    - { get_param: key_name }
                  
      • For the user_ID, specify the login ID for the virtual machine.
      • The key_name parameter must be in the following form:
        parameters:
          key_name: "ssh-rsa s1AAB3Nza45yc2EA27AADAQADDABAQC jsmith@example.com"
      Additionally, the OS::Heat::MultipartMime must contain the - config: {get_resource: cloud_config} resource. For example, if your virtual image name is linux_image_B, the OS::Heat::MultipartMime resource resembles the following code:
        linux_image_B_cloudinit_mime:
          type: OS::Heat::MultipartMime
          properties:
            parts:
              - config: {get_resource: ucd_agent_install_linux }
              - config: {get_resource: cloud_config}
              subtype: cloud-config
    • If you configured a virtual image for SSH and later added a component to it, you must add the following property to the OS::Heat::MultipartMime resource: - config: {get_resource: ucd_agent_install_linux }

      The OS::Heat::MultipartMime resource resembles the following code:

        multipart:
          type: OS::Heat::MultipartMime
          properties:
            parts:
              - config: {get_resource: cloud_config}
              subtype: cloud-config
              - config: {get_resource: ucd_agent_install_linux }
  5. If your blueprint contains a Windows image, take the following actions:
    1. Add a user with administrative permissions to run the agent. If your user name is user_name and your password is password, include the following lines of code in the ucd_agent_install_win resource:
      $userAdd = "net user user_name password/add"
      $adminGroupAdd = "net localgroup Administrators user_name/add"
      Invoke-Expression "$userAdd"
      Invoke-Expression "$adminGroupAdd"
      You can select another user name and password. The ucd_agent_install_win resource begins with the following code:
        ucd_agent_install_win:
           type: OS::Heat::SoftwareConfig
           properties:
              config:
                str_replace:
                  template: |
                    #ps1_sysnative
                      $userAdd = "net user user_name password/add"
                      $adminGroupAdd = "net localgroup Administrators cloud-user/add"
                      Invoke-Expression "$userAdd"
                      Invoke-Expression "$adminGroupAdd"
    2. Add an argument to the powershell script to install the agent. In the section of the ucd_agent_install_win resource that defines $args, add the following line of code: $args += ("-x", "install-service").
    3. Configure the image resource to use cloudbase-init, a set of scripts and utilities that cloud systems use to initialize and configure instances: In the OS::Nova::Server resource for the Windows image, set the user_data property to user_data: {get_resource: ucd_agent_install_win}.

      The Windows_image_name resource begins with the following code:

      Windows_image_name:
       type: OS::Nova::Server
       properties:
        networks:
         - port: { get_resource: Windows_image_port  }     
        user_data_format: RAW
        user_data: {get_resource: ucd_agent_install_win}
  6. Create a configuration file and externalize properties to the file. See Editing configuration files.
  7. In the configuration file, ensure that the core OpenStack types are mapped to VMware vCenter types. The configuration file must have mapping similar to the following code:
    resource_registry:
      OS::Nova::Server : IBM::VCenter::Server
      OS::Neutron::Port : IBM::VCenter::Port
      OS::Neutron::Net : IBM::VCenter::Network

What to do next

Add the components of your application to the blueprint. See Deploying components with blueprints.


Feedback