From 81ccadf4cc9a48d32d197dbb3213d790c09d42cc Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Wed, 17 Jul 2024 03:22:37 -0400 Subject: [PATCH] these have moved to content --- provision-sm-md-lg/README.md | 120 ------------------ .../provision-vm-small-med-large.asl | 100 --------------- 2 files changed, 220 deletions(-) delete mode 100644 provision-sm-md-lg/README.md delete mode 100644 provision-sm-md-lg/provision-vm-small-med-large.asl diff --git a/provision-sm-md-lg/README.md b/provision-sm-md-lg/README.md deleted file mode 100644 index 9dcdd13..0000000 --- a/provision-sm-md-lg/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# Example: Provisioning a VM service - -The following example shows how to create a Provisioning Dialog that modifies the parameters for provisioning a small, medium, or large service. - -## Architecture - -The `provision-vm-small-med-large.asl` workflow runs for every provisioned VM and is responsible for modifying the VM size. This workflow is the `` service Provisioning Entry Point. - -You need to set the ManageIQ Provisioning service entry point to workflow script. For example, this workflow is run for every provisioned Virtual Machine (VM), and modifies the VM size. - -Use the following sections and follow them in order to provision a VM service and modify the paramaters. - -## Create a workflow (optional) - -**Note**: If you want to use the existing `provision-vm-small-med-large.asl` workflow script without any changes, you can skip this section and proceed to `Add a Workflow Repository` section. - -1. Fork `https://github.com/ManageIQ/workflows-examples` repository or create your own repository. -2. Clone the repo locally by using the clone command: - - ```bash - git clone https://github.com//workflows-examples - ``` - Where `` is the owner of the repository. - -3. Create a new branch: - - ```bash - git checkout -b sm-md-lg - ``` -3. Create your own script or edit the existing script that is provided. The script used in this example is `provision-vm-small-med-large.asl`. -4. Push code changes to your branch. - -## Add a Workflow Repository - -Use the following steps to add a Workflow Repository. - -1. Click **Automation** > **Embedded Workflows** > **Repositories**. -2. Click **Configuration** > **Add new Repository**. -3. Provide the **Name** and **URL** for the repository: - - **Name**: Local name to identify this repository. For example, `Example Workflows`. - - **Url**: Git repository URL. For example, `https://github.com/ManageIQ/workflows-examples`. - - **SCM Branch**: Git repository branch name. For example, leave this field blank if you want to use the existing `provision-vm-small-med-large.asl` script blank or use a branch name like `sm-md-lg` if you have edited or created your own workflow script. -4. Click **Save**. - -## Create a Provisioning Dialog - -Use the following steps to create a Provisioning Dialog. - -1. Click **Automation** > **Embedded Automate** > **Customization**. -2. Click **Service Dialogs** > **All Dialogs**. -3. Click **Configuration** > **Add a new Dialog**. -4. Provide a **Name** and **Description** for the dialog: - - **Name**: Name used in the Service Catalog. For example, `sm-med-lg dialog`. - - **Description**: Description for the dialog. For example, `Dialog choosing vm size`. -5. Add a text box named **vm_name**. -6. Add a dropdown named **size**. -7. Click the edit pencil icon for the **size** dropdown. -8. Under **Options** > **Entries** enter the following values: - - Enter the following for the first row: - - For **Name** field, choose **Large**. - - For **Value** field, choose **large**. - - Enter the following for the second row: - - For **Name** field, choose **Medium**. - - For **Value** field, choose **medium**. - - Enter the following for the third row: - - For **Name** field, choose **Small**. - - For **Value** field, choose **small**. -9. Click **Save**. - -## Create a Service Catalog Item - -Use the following steps to create a Service Catalog Item. - -1. Click **Service** > **Catalogs**. -2. Click **Catalogs** > **All Catalogs**. -3. Click **Configuration** > **Add a New Catalog**. -4. Provide a **Name** and **Description**: - - **Name**: Name displayed in the catalog. For example, `Provision VM`. - - **Description**: Desription of the catalog. For example, `Provisioning VM by size`. -5. Click **Save**. -6. Click **Catalog Items** > **All Catalog Items** > **Provisioning**. -7. Click **Configuration** > **Add a New Catalog Item**. -8. Provide a value for `Catalog Item Type`: - - **Catalog Item Type**: The functionality of this catalog item. Choose **VmWare**. -9. Under the **Basic Information** tab, provide the values for the following fields: - - **Name**: Name displayed in the catalog. For example, `Provision VM with Size`. - - **Description**: Description of the catalog. For example, `Provision a VM choosing size`. - - **Display in Catalog**: Check to display this catalog item. - - **Catalog**: Organization concept. For example, `My Company/Provisioning`. - - **Dialog**: The dialog created previously. For example, `sm-med-lg dialog`. - - **Provisioning Entry Point**: - - For **endpoint type**, choose **Embedded Workflow**. - - For the **endpoint value** choose the workflow script. For example, `provision-vm-small-med-large.asl`. -17. Under the **Request Info** > **Catalog** tab enter the following values: - - **VM Name**: Name that is overwritten by the **VM name** in the dialog. Enter anything here. -20. Under the **Environment** tab, choose an appropriate **Host** and **Datastore**: - - **Host**: Host that runs the VM. - - **Datastore**: Disk that stores the VM. -22. Under the **Networking** tab, choose an appropriate **Network Adapter**. -24. Click **Add**. - -## Provisioning a Virtual Machine - -1. Click **Services** > **Catalogs** > **Service Catalogs**. -2. Click **Order** under the newly created service, **Vm with Size**. -3. Provide the following fields: - - **VM name**: Name for the newly created vm. For example `demo-1`. - - **size**: The desired VM size. You can choose `small`, `medium` or `large`. For example, choose **small**. -1. Click **Submit** - -## Iterate - -If the provisioning did not go as planned use the following steps: - -1. Edit the workflow script. -2. Push code changes to your branch. -3. Refresh the Workflow repository. -4. You can follow the workflows link to view the version of the script is stored on the server. -5. If you changed the script name, edit the Service Catalog Item that you previously created. -6. Provision the Virtual Machine. diff --git a/provision-sm-md-lg/provision-vm-small-med-large.asl b/provision-sm-md-lg/provision-vm-small-med-large.asl deleted file mode 100644 index 569068a..0000000 --- a/provision-sm-md-lg/provision-vm-small-med-large.asl +++ /dev/null @@ -1,100 +0,0 @@ -{ - "Comment": "Provision VM with choice for small medium large", - "StartAt": "DetermineSize", - "States": { - "DetermineSize": { - "Comment": "Determine dialog value", - "Type": "Choice", - "Choices": [ - { - "Variable": "$.size", - "StringEquals": "small", - "Next": "SmallSizeState" - }, - { - "Variable": "$.size", - "StringEquals": "medium", - "Next": "MediumSizeState" - }, - { - "Variable": "$.size", - "StringEquals": "large", - "Next": "LargeSizeState" - } - ], - "Default": "SmallSizeState" - }, - "SmallSizeState": { - "Type": "Pass", - "Next": "SmallSetMemory" - }, - "SmallSetMemory": { - "Comment": "set vm_memory=2GB for small", - "Type": "Pass", - "ResultPath": "$.vm_memory", - "Result": "2048", - "Next": "SmallSetCpus" - }, - "SmallSetCpus": { - "Comment": "1 cpu for small", - "Type": "Pass", - "ResultPath": "$.number_of_sockets", - "Result": "1", - "Next": "Provision" - }, - "MediumSizeState": { - "Type": "Pass", - "Next": "MediumSetMemory" - }, - "MediumSetMemory": { - "Comment": "set vm_memory=4GB for medium", - "Type": "Pass", - "ResultPath": "$.vm_memory", - "Result": "4096", - "Next": "MediumSetCpus" - }, - "MediumSetCpus": { - "Comment": "2 cpus for medium", - "Type": "Pass", - "ResultPath": "$.number_of_sockets", - "Result": "2", - "Next": "Provision" - }, - "LargeSizeState": { - "Type": "Pass", - "Next": "LargeSetMemory" - }, - "LargeSetMemory": { - "Comment": "set vm_memory=8GB for large", - "Type": "Pass", - "ResultPath": "$.vm_memory", - "Result": "8192", - "Next": "LargeSetCpus" - }, - "LargeSetCpus": { - "Comment": "4 cpus for large", - "Type": "Pass", - "ResultPath": "$.number_of_sockets", - "Result": "4", - "Next": "Provision" - }, - "Provision": { - "Type": "Task", - "Resource": "manageiq://provision_execute", - "Next": "SendEmail" - }, - "SendEmail": { - "Type": "Task", - "Resource": "manageiq://email", - "Parameters": { - "To": "user@example.com", - "Title": "Your provisioning has completed", - "Body": "Your provisioning request has completed" - }, - "Next": "Finished" - }, - "Finished": { - "Type": "Succeed" - } - } -}