# 	   vCenter plugin for ACI
# =======================================

# 0. Archive content
# #################
/
|-> vcenter-plugin-x.x.x.x.zip 	The plugin zip file that will need to be registered into the vCenter to install the plugin
|-> deployPlugin.py		A python script to register the plugin to the vCenter. 
|-> deploy.cfg			Configuration file template for the python script, will need to be passed as argument of the python script
|-> README


# 1. Installation
# ###############

# 1.0 Requirements
# ----------------
- vCenter version 5.5 or 6.0
	* On 5.5, the root account will need to be used to register the plugin
	* On 6.0, the administrator@domain account will need to be used to register the plugin
- A web server that can be reached by the vCenter where the plugin needs to be installed
- Python 2.7.9 or higher installed
- Pyvmomi installed (vCenter Python API)
		To install using pip : pip install pyvmomi
		Make sure pyvmomi is up to date (change regarding SSL where recently introduced, Jan 14, 2016): pip install --upgrade pyvmomi

# 1.1 [STEP 1] Making the zip file available on your web server
# -------------------------------------------------------------
Put the vcenter-plugin-x.x.x.x.zip archive in a location from which it can be downloaded via HTTP or HTTPS
Example: https://myWebServer.local/vcenter-plugin-x.x.x.x.zip

IF WEB SERVER IS HTTP only (not HTTPS)
	By default, vCenter will not download any plugin from an http source. 
	In order to allow it, the configuration line 'allowHttp=true' needs to be added to the webclient.properties file on the vCenter.

	vCenter 5.5 Linux Appliance: /var/lib/vmware/vsphere-client/webclient.properties
	vCenter 6.0 Linux Appliance: /etc/vmware/vsphere-client/webclient.properties
	vCenter 5.5 Windows 2008: %ALLUSERSPROFILE%\VMware\vSphere Web Client\webclient.properties
	vCenter 6.0 Windwos 2008: C:\ProgramData\VMware\vCenterServer\cfg\vsphere-client\webclient.properties

	Then, the web client needs to be restarted (may take some time): 
		Linux Appliance: /etc/init.d/vsphere-client restart
		Windows 2008: Services > Restart the service called 'VMware vSphere Web Client'

# 1.2 [STEP 2] Editing the deploy.cfg file
# ----------------------------------------

Note: The configuration file is there to make it easier to deploy the plugin serveral time, the python script deployPlugin.py can be run without the configuration file, a wizzard will then ask all the information one by one.

This file is the configuration file where you will indicate the IP and credentials of your vCenter, and the URL where the vCenter will be able to find the plugin .zip archive.

'----- deploy.cfg [BEGIN] -----'
[vCenter]
host = my-vCenter.local		<-- FQDN or IP address of your vCenter
user = root			<-- Username of account with root privileges (root on 5.5, administrator@domain on 6.0)
password = vmware		<-- Password 

[plugin]
zipUrl = https://myWebServer.local/vcenter-plugin-x.x.x.x.zip 			<-- Full URL of where the zip archive is aivailable for the vCenter to download it
httpsThumbprint = D7:9F:07:61:10:B3:92:93:E3:49:AC:89:84:5B:03:80:C1:9E:2F:8B	<-- If the URL is HTTPS, SHA1 thumbprint of the web server (leave empty for http)       
'----- deploy.cfg [END] ------'  


# 1.3 [STEP 3] Running the deployPlugin.py script
# -----------------------------------------------
Run the deployPlugin.py script, passing the configuration file editing in step 1.2 as argument

	$ python deployPlugin.py deploy.cfg

# 1.4 [STEP 4] Login into the vSphere Web Client 
# -----------------------------------------------
The vCenter will not download the zip archive until a user loggin into the vSphere Web Client.
Some error message may appear at the first login after registering the plugin, just refresh the page.

If your browser was already logged-in the vSphere Web client, make sure to properly log out and log in again.

Some error message may appear on the first login after installing/updating the plugin. Ingore them and refresh the page, they will go away.

If the plugin was successfully registered, the new Category 'Cisco ACI Fabric' should appear in the left menu and middle shortcut homepage. 

If the plugin is not there, try looking at the logs to see what went wrong:
	
	Look for 'vcenter-plugin' or 'com.cisco.aciPlugin'
	Linux Appliance : /var/log/vmware/vsphere-client/logs/vsphere_client_virgo.log
	5.5 Windows 2008: C:\ProgramData\VMware\vSphere Web Client\serviceability\logs\vsphere_client_virgo.log
	6.0 Windows 2008: %ALLUSERSPROFILE%\VMWare\vCenterServer\logs\vsphere-client\logs\vsphere_client_virgo.log
	
	VMware Knowledge Base for vSphere logs:
		5.x : https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004090
		6.0 : https://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2110014	

/!\ Note that in case of error, you will have to follow the Uninstall procedure and restart the Web Client service before trying to install the plugin again /!\

# 2. Upgrade
# ##########

The upgrade procedure is the same as the installation one. The python script will take care of checking if there is already a previous version of the plugin installed.

# 3. Uninstall
# ############

To uninstall the plugin, follow theses steps:
	1. Go tho https://<YOUR-VCENTER-IP>/mob
	2. Login with root credentials
	3. Navigate to 'Content' > 'ExtensionManager'
	4. Click the 'UnregisterExtension' action
	5. On the popup that appear, type in 'com.cisco.aciPlugin' as the extension key, and click 'Invoke Method'

Restarting the Web Client is recommanded:
	Linux Appliance: /etc/init.d/vsphere-client restart
	Windows 2008: Services > Restart the service called 'VMware vSphere Web Client'
