Friday 12 June 2015

HP Cloud Service Automation - Part 5

HP Cloud Service Automation - Part 5

Customizing a Topology Design requires a degree of realism. Yes, you can push the design a bit but do you really want to?!! I've created a Topology Design previewed below that allows you a drop down list view during selection but you lose the ability to request multiple numbers of these at once and also you can't modify it afterwards! So there are drawbacks when you move away from using profiles in this way but gain individual flexibility over CPU / Memory / OS options.

The are 3 sets of options above, each fully priced and very flexible. I selected two vCPU nad deployed the VM below quite easily (although I've experienced issues with deployment/undeployment so this Post is more for curiosity than anything else - see end of post):

This also shows that the generated name in VMware is also used as the Computer Name. You get to choose the prefix but that's all.

So how to go about getting the list view? We've to start by editing the Provider Components for VMware vCenter. Creating a custom one to give us the options we need.

Note: You can't hide individual values within a list, the entire list is always shown so it's harder to add in more options later. We can't use Profiles as we have done earlier.

Profiles in the Topology designer are much like Openstack flavors. That's because the Topology Designer was written with Openstack in mind! It is easy to use Profiles but when you're trying to offer granular choices, all the permutations and combinations can get crazy! Each one needs a Profile and price. The list view is more flexible but it's reduces the overall flexibility of the Offering.

So to begin let's find the component we need to edit.
Go to Providers, select VMware vCenter on the left and click Components on the right.

Click on the vCenter Server component and then click the Save As button at the bottom.

Enter a name for the component and Click Save.

Click on the Properties Tab to edit the required properties. The ones I edited are cpuCount, vmTemplateReference and memorySize.

Click on the cpuCount edit button on the far right. Change the Type to List and enter in the list of values you wish to use!

Unfortunately if return here to add a new one AFTER referencing the component in a published design you will get an error like this:

You might consider creating versions of these components to allow you to distinguish them.
 
Add them to your List Palette if in use or the design won't see them.
 
Now edit the other two component properties.

And next, memorySize.

Finally, vmTemplateReference.

Pay attention to the Visible and Required fields. "Can be Modified" should be set to Yes (checked by default) which will save a small bit of time in the Design later. Although by not using profiles as we are here I haven't found a way to modify a deployed VM with this customization as yet!

Now if you were to try to use this straight away you would be frustrated by the fact that you can't link up the network with the server in the new Design view. It's because we need to tell the network component that it should be linkable with the new server list view component. So, save this component and go back to the list of components and open the one "vCenter Network Interface"

Click on Relationships. You will only have one listed, I've already created some more. Once you create them here and go to the vCenter List View component, Relationships select you should see it listed there to but as incoming. So when you drag a link between the two components in the designer it will work.
Click Create and select the Target Component "vCenter Server List View" modified earlier. Enter a Display Name (unique) such as "vCenter Network Interface To vCenter Server - List View" Click Create.

And check it's listed as above. You can now create a new design to reference it.
 
Click on Designs, Topology, Designer and create a layout as follows (it should be easy by now?!):
 
Then Save and Publish the Design.
 
You can now create an offering and set the Marketplace views and pricing

I've renamed some of the options to make them easier to understand

The pricing can be more granular now. Ensure you click "Show All Properties" or you won't see all your options which will end up un-priced in the Marketplace and very cheap to order as a result!!

If you check the modification pricing you will see as there's no Profiles, there's no way to set pricing!

Even if you add in a Profile you don't get the list options again! You could create a load of profiles I guess to provide some post deployment options but it's not as snazzy!

FYI - the VM deploys but I get an error in OO on the network side of things. So while you can certainly play around with the steps above you need to test and watch out for unexpected results. Again Topology is a good approach but now is a good time to look at the Sequence Designer as it's there that the full range of options expands but there's a LOT more to learn and the need to spend some time in OO Studio becomes necessary.

I hope this post has shown some of the possibilities you can reach with Topology Designer to give you ideas about customization. A Lab setup is essential I feel as the number of extra objects etc becomes unwieldy and harder to clean up over time. It's easier to wipe a Lab and start from scratch than repairing a live customer's cloud if something goes wrong!!

Note: Test Deploying and UnDeploying a server via Marketplace to ensure everything works as expected and look for any errors in CSA/OO. My custom VM deployed fine but with OO errors and undeployed fine without errors but the VM was left behind in vCenter! I tried creating a second custom network property but got similar results. There may be some embedded code / options I'm running into that is causing issues so I wouldn't recommend the above in Production, Test/Lab ONLY at this point.

I'll post this under "curiosity but venture no farther"! There is a way to get this working I'm told but I've not had time to experiment further. If I find the solution I'll gladly share!