In case you missed the previous article, have a read here which goes into greater detail behind the new VCSA bootstrap installer (also known as vSAN Easy Install) which is part of the new vSAN 6.6 release. As I hinted at the end of the previous post, customers not only have a simplified way of bootstrapping the VCSA on vSAN from a UI standpoint but they can also completely automate this leveraging some of the new vSAN Management 6.6 APIs, which are the same APIs that the UI uses.
A new Managed Object called VsanVcsaDeployerSystem is now available when connecting to either a standalone ESXi host as well as a vCenter Server. It contains the following three methods:
- VsanPostConfigForVcsa() - Used to bootstrap the vSAN datastore on the ESXi host
- VsanPrepareVsanForVcsa() - Used to setup the vCenter Server once it is deployed
- VsanVcsaGetBootstrapProgress() - Used to retrieve progress from the two methods above
Here is the workflow for automating the VCSA bootstrap installer:
Step 1 - Connect directly to the ESXi host which you wish to bootstrap vSAN. You will use the VsanPrepareVsanForVcsa() API which accepts a list of disks for either a Hybrid or All-Flash vSAN datastore.
Step 2 - Deploy the VCSA like you normally would using the CLI Installer. You will specify the ESXi host that you had just prepared in Step 1 which includes the vSAN Datastore that was setup as part of that process.
Step 3 - Once the VCSA has been successfully deployed, you will connect to the vCenter Server and use the VsanPostConfigForVcsa() API which will create a vSphere Datacenter, vSphere Cluster and enable it with vSAN (which can also include Dedupe/Compression if you are using an All-Flash setup) and then automatically add the ESXi host that you had just bootstrapped. If you have provisioned other ESXi hosts that have not been configured with vSAN, you can also include that into the API request. The really nice thing about this "post" API is that rather than having to call into several existing vSphere APIs to setup vCenter Server, you can do all of that just using this single API!
To help demonstrate the use of the these new vSAN Management APIs, I have created a simple Python script which exercises these new APIs called vsan-vcsa-deployer-sample.py The script supports three operations: listdisk, prepare and post.
Here is an example of running the listdisk operation which will list all available disks that are currently not in use and can be used by vSAN:
python vsan-vcsa-deployer-sample.py -s 192.168.1.100 -u root -p VMware1! --operation listdisk
Once you have the disks information, you can then use the prepare operation as shown below to bootstrap your ESXi host:
python vsan-vcsa-deployer-sample.py -s 192.168.1.100 -u root -p VMware1! --operation prepare --cache "SAMSUNG MZVPV128" --capacity "Samsung SSD 850"
At this point, you are now ready to deploy the VCSA using the CLI Installer. Once that has completed, you can complete the process by using the post operation and provide the required parameters to setup vCenter Server including the ESXi host that you had just bootstrapped so it can be added to the vCenter Server inventory as shown below:
python vsan-vcsa-deployer-sample.py -s 192.168.1.200 -u '*protected email*' -p VMware1! --operation post --datacenterName "VSAN-Datacenter" --clusterName "VSAN-Cluster" --esxName 192.168.1.100 --esxUsername root --esxPassword VMware1!
Once the post operation has completed, you will have a fully configured vCenter Server which you can check by logging into the vSphere Web Client. Pretty slick, if you ask me!
cspnanda says
Wiiliam, after bootstraping the node1, I tried to deploy the PSC and VCSA. While deploying the PSC using OVFTool I get the error
Failed to deploy OVA : Opening OVA source: http://192.168.48.15/images/vcsa65/vcsa/VMware-vCenter-Server-Appliance-6.5.0.5200-4944578_OVF10.ova\nOpening VI target: vi://[email protected]:443/\nError:\n - Cannot complete file creation operation.\nCompleted with errors\n"}
Any idea what is going on.
cspnanda says
I found in hostd.log that "There are currently 1 usable fault domains. The operation requires 2 more usable fault domains.". I added following flag to ovftool to get it going.
--defaultStorageRawProfile=(("hostFailuresToTolerate" i1) ("forceProvisioning" i1))
jeffbroderick says
Great post, as always...the examples above use Python, is same functionality available is PowerCLI? Thanks, Jeff
luminos says
Hi,
I have to deploy two PSC (external ) and VCSA on VSAN datastore.
If I follow below steps, will it solve my problem? Kindly suggest.
Step 1) Call VsanPostConfigForVcsa()
Step 2) Deploy primary and secondary PSC (CLI installer)
Step 3) Deploy VCSA with external PSC (CLI installer)
npothen says
Hi,
I'm seeing the following error more often than not while using this sample against an esxi host. Any ideas on causes/how to fix it ? Thanks
taskid = vvds.VsanPrepareVsanForVcsa(spec=spec)
File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 580, in
self.f(*(self.args + (obj,) + args), **kwargs)
File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 386, in _InvokeMethod
return self._stub.InvokeMethod(self, info, args)
File "/usr/lib/python2.7/site-packages/pyVmomi/SoapAdapter.py", line 1369, in InvokeMethod
raise http_client.HTTPException("{0} {1}".format(resp.status, resp.reason))
HTTPException: 503 Service Unavailable (Failed to connect to endpoint: [N7Vmacore4Http16LocalServiceSpecE:0x04b185b8] _serverNamespace = /vsan action = Allow _port = 9096)
SRI NARAYANAN says
Hi npothen , did u find the root cause , I get the same error when accessing https://10.196.x.x/vsan
clay says
Hi Sri, from my testing in 6.7 I've found that you can do a simple check before hand, if you get http:///vsan and it returns a 404 then you can run automate a remote ssh call with paramiko and run "esxcli vsan debug mob status" and then continue.
mike says
how we can bypass ssl error
clay says
Just as a note, if you're trying to script the entire bootstrap process and the VCSA deploy, after VCSA is deployed and port 443 of VCSA is up, you need to add a delay for the VsanVcsaDeployerSystem to fully initialize (I give it 5 minutes) otherwise vvds.VsanPostConfigForVcsa(spec=spec) will error out with "http.client.HTTPException: 400 Bad Request".
wvo says
Hi Clay,
What do you mean by add a delay?
Do you mean "time.sleep(300)" or something else?
Can you please provide a code snippet?
Thanks in advance for the assistance!