To model an OpenStack environment, log in with an OpenStack
cloud project and use resources from your cloud system in a blueprint.
Procedure
- Create the blueprint:
- Click Blueprints.
- Click New.
- In the Add a New File window, specify a name
for the blueprint.
- 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.
- In the Type list, select Blueprint,
and then click
Save.
- 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.
- Optional: In the blueprint source code, in the metadata property for the resource,
specify any virtual image metadata. You provide the metadata as a series of name/value pairs. For example, to specify the tags cluster: blue and database_type:
mysql, the code looks like the following
example:
metadata:
cluster: blue
database_type: mysql
- If your blueprint contains a Windows image, take the
following actions:
- 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"
- 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").
- 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}
- Optional: Create a configuration file and externalize
properties to the file. See Editing configuration files.
What to do next
Add the components of your application to the blueprint. See Deploying components with blueprints.