By Andrea Siviero, VMware Senior Solutions Architect
In my recent post “Look Mom, no Mouse!” I introduced an amazing new way to interact with your SDDC without a mouse, but now, using a command-line with simple mnemonic instructions you can “Talk” with your SDDC to “Automate the Management of the Management Portal”.
VMware has just announced vRealize CloudClient 3.0 released for general availability (GA) (http://developercenter.vmware.com/web/dp/tool/cloudclient/3.0.0).
So now that it’s GA, I’m excited to explore with you more deeply how to use CloudClient, and also to share its benefits.
What commands do I want to show you today?
– Create a brand new tenant and service catalog and entitle them to administrators
– Import an existing blueprint into the brand new CloudClient-made tenant
– Deploy blueprints from the catalog of services
So wake up your SDDC — it’s time for a lovely chat. 🙂
Log in and create a tenant
CloudClient allows you to log in in an interactive way:
CloudClient> vra login userpass --server vcac-l-01a.corp.local --tenant pse --user email@example.com --password ****** --iaasUser corp\\Administrator --iaasPassword ******
Or to edit the CloudClient.properties file to fill in all the details, just type this command to create an empty configuration:
CloudClient> login autologinfile
NOTE: IaaS credentials need to be passed with double back-slash i.e. corp\\Administrator
Figure 1: Login
Create a new tenant, identity-store and admins
When you are logged in as firstname.lastname@example.org, creating a tenant is just three commands away. To set the name of the tenant, how users will get authenticated (AD or LDAP) and who will be the adminstrators:
CloudClient> vra tenant add --name "PSE" --url "PSE"
CloudClient> vra tenant identitystore add --name "PSE AD" --type AD --url ldap://controlcenter.corp.local --userdn "CN=Administrator,CN=Users,DC=corp,DC=local" --password "****" --groupbasedn "OU=Nephosoft QE,DC=corp,DC=local" --tenantname "PSE" --alias "gts.local" --domain "corp.local"
CloudClient> vra tenant admin update --tenantname "PSE" --addtenantadmins email@example.com --addiaasadmins firstname.lastname@example.org,email@example.com
Figure 2: Create Tenant
Create a fabric group and business group and assign resources
Now let’s annotate the returned IDs so they can be used in further commands. (They can be scripted using variables.)
CloudClient> vra fabricgroup add --name "GTS Fabric Group" --admins "firstname.lastname@example.org,email@example.com"
Figure 3: Create Fabric Group
Search for the suitable compute resources. We will select the “Cluster Site A”:
CloudClient> vra computeresource list
Figure 4: Compute Resources
Let’s finalize the “trivial” steps of assigning the compute resources to the fabric group and creating a business group wth a pre-determined machine prefix.
CloudClient> vra fabricgroup update --id f8bbfcd5-79c0-43db-a382-2473b91862e6 --addcomputeresource c47e3332-bdef-4391-9f93-269dcf14f2c5
CloudClient> vra machineprefix add --prefix gts- --numberOfDigits 3 --nextNumber 001
CloudClient> vra businessgroup add --name "GTS Business Group" --admins "firstname.lastname@example.org,email@example.com" --adContainer "cn=computers" --email firstname.lastname@example.org --description "GTS Group" --machinePrefixId 1c1d20c3-ba91-443e-beb0-b9b0728ee29c
Figure 5: Assign Resources
Here comes the fun: import/export blueprints
Until now, CloudClient commands used are merely a reproduction of what normally happens on the GUI.
Let me show where the power of it comes out: let’s assume you already created a good blueprint in a tenant with a blueprint profile and you just want to “copy&paste” it to another tenant. You cannot do it in the GUI — you need to manually recreate it — but hey, here comes the CloudClient magic: log in to the source tenant and export the blueprint in a JSON format:
CloudClient> vra iaas blueprint list
CloudClient> vra iaas blueprint detail --id 697b8302-b5a9-4fbf-8544-2f19d4e8a220 --format JSON --export CentOS63.json
Figure 6: Export Blueprint to JSON file
Now log back to the brand new PSE tenant and import the blueprint like this:
CloudClient> vra iaas blueprint add vsphere --inputfile CentOS63.json --name "CentOS 6.3 x64 Base" --cpu 1 --memory 512
Figure 7: Import Blueprint from JSON
Request the blueprint from the catalog
The remaining steps will be trivial as before: Create a service, an entitlement, and actions and assign the blueprint to catalog. Reading the documentation will help you to get familiar with it.
Note: “Reservations” verbs are not yet implemented, so at some point you need to use the GUI to complete the process.
So please let me fast forward to the final moment when you can successfully deploy a blueprint and see it live. 🙂
CloudClient> vra catalog list
Figure 8: Listing the Catalog
Using the ID returned from catalog list, make the request:
CloudClient> vra catalog request submit --id c8a850d2-a089-4afb-b5d8-b298580cf9f9 --groupid 2c220523-60bb-419e-80c8-c5bfd81aa805 --reason fun
Figure 9: Checking the Requests
And here it is, our little VM, happy and running. 🙂
Figure 10: Happy and Running
The Occam’s Razor principle: “Entities must not be multiplied beyond necessity.”
In my humble opinion: Please don’t waste lot of time doing everything (Coffe/Tea?) from a command-line. vRealize Automation 6.1 has a nicely improved UI and is very intuitive to work with.
Keep the solutions as simple as possible and use vRealize CloudClient when some real “black magic” is needed.
Andrea Siviero is an eight-year veteran of VMware and a senior solutions architect member of Professional Services Engineering (PSE) for the Software-Defined Datacenter (SDDC), a part of the Global Technical Solutions (GTS) team. Prior to PSE, Andrea spent three years as pre-sales system engineer and three years as a post-sales consultant architect for cloud computing and desktop virtualization solutions focusing on very large and complex deployments, especially for service providers in the finance and telco sectors.