Monday, 28 March 2016

Deploying External Proxy for VDP

Written by Suhas Savkoor



With VDP, you get 8 internal proxy by default. Using this, you can backup up to 8 VMs concurrently. 
The moment you configure an external proxy for the VDP, the internal proxy is disabled. So with external proxies you can deploy up to 8 external proxy VM. And each external proxy again supports up to 8 concurrent backups. However, with for example 2 external proxies, you can have 16 concurrent backups. This does not mean that we go ahead and deploy all 8 external proxies and have 64 backups running concurrently. This will have a huge performance impact on your environment. Hence, choose the external proxies as required based on your environment. 

To deploy an external proxy:

1. Login to your VDP management page.
https://vdp-IP:8543/vdp-configure

2. Click the Gear icon on the Proxy row and select Add External Proxy


2. Provide the host where this proxy virtual machine should reside, the storage and the network. Please provide a Standard vSwitch Port Group and make sure the underlying ESXi host has 4 CPU cores. If it is deployed on a DVS or on a host less than 4 CPUs, then you will run into the error "VDP: Failed to find CIM service on VM Image Proxy"


3. Enter the network configuration details for the proxy virtual machine


4. Enter the name for the proxy virtual machine


5. Click Finish and wait for the deployment to be completed. You will come across the following message for a successful deployment. 


Click Close and now under the proxy list, you will see the external proxy in a working status. 

To delete an external proxy:

1. Click the gear icon again and select Manage Proxies. Check Review information and proceed to remove the proxy.


Now, once the external proxy is removed the internal proxy is not enabled automatically. We will have to perform this step manually. Click the gear icon again and select Enable internal proxy

Check box the Enable internal proxy and click Finish.


The proxy status will be in warning state. Refresh the proxy using the refresh button next to it in about 5-10 minutes and we should be good to go. 

Tuesday, 15 March 2016

Client Integration Plugin 6.0 Not Working With IE 11 / Chrome 45 and above

Written by Suhas Savkoor



There are always issues regarding Client Integration Plugin not working as expected is logged with VMware. At least, I handle one on a weekly basis. 

The main thing what happens here is, you download and install CIP from the download option you see at the bottom when you open a Web Client session. Once the installation wizard starts, you close out all the browser sessions and complete the install. After the installation, you open up a browser and you still see the download CIP message and the Use Windows Session Credentials is grayed out, always!

There are couple of steps that we take into account before we proceed with the troubleshooting. Go through and validate all the steps. (If I find any more workarounds, I will update this article)
Since, CIP is based on each workstation where web client is accessed from, this has to be checked on each of the machines

1. If there is UAC enabled on the Windows machine from where you are accessing web client, disable it
2. Check if the below entry is there in host file on the same machine. 

127.0.0.1 vmware-localhost 
::1 vmware-localhost 

3. Open the task manager, if you find vmware-csd.exe, kill this process and continue with Step 4 
4. Uninstall Client Integration Plugin from Control Panel. 
5. Re-install by using the download link from this KB article here

Once the plugin is reinstalled, follow the below steps:

1. On the required browser, clear the cache/cookies
2. In Chrome / IE 11 add the https://vcenter_FQDN:9443 (Web Client URL) in the trusted site list.
3. Refresh the browser and open web client again. 

If the Client integration plugin still does not work, then:

1. In IE 11 change the trusted site exception to Local Intranet (For the same vCenter FQDN)
2. In Chrome add the exception to the Plugin as well (All options are in settings and advanced settings of chrome)
3. Refresh the browser and load the web client again

If it still fails, then implement the above 2 sections (adding exception and clearing browser cache) with vCenter IP as well along with FQDN. 

Even after all this, if it still fails, please contact VMware Support, and maybe me or someone else will get to further troubleshooting. 

Cheers!

Friday, 11 March 2016

Changing Logging Location For vCenter 6.0

Written by Suhas Savkoor



By default your vCenter 6.0 logs are in the install directory.
C:\ProgramData\VMware\vCenterServer\logs\vmware-vpx
Now, if you do not want to have this location for logging, but a custom location, then you will have to make a few changes.

Perform the below steps:

1. Navigate to the below directory:
C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx
2. Make a copy of the vpxd.cfg file so that you can quickly restore if something goes wrong.
3. Stop VMware Virtual Center service from services.msc
4. Open the vpxd.cfg file using a notepad/wordpad
5. There are two "<log> </log>" tags that are available. Add the below line between <log> and </log> [<log> represents the start of the xml code of log function and </log> determines the end]
<directory>[Directory:\Name\configured]</directory>
**Make sure that this is added under both <log></log> tags**

6.Save the vpxd.cfg file
7. Start the VMware Virtual Center service.

Your new logging will take place in the custom directory that was defined.


Wednesday, 2 March 2016

Customize Web Client Login Page

Written by Suhas Savkoor



Bored of the same blue screen login for vSphere Web Client? Well, don't be bored any more. If you are running 6.0 VMware, then there's a bunch of good news. You can have your own welcome screen for Web Client. Yes, you heard me right!

Web Client login page for 6.0, is designed using HTML and CSS, and when you have this, you can tweak around a little to customize your own page. With the help of William Lam's article, I was able to tweak my Web Client Appearance.

This is how it looks now!



So, here is the bigger story of how to get this done:

>> The first thing is, you need to be on 6.x vCenter, this is not going to work with any other versions of vCenter.
>> There are three files to be altered: the img file, the login.css file and the unpentry.jsp file

Location of these files:

Windows vCenter:

  • C:\ProgramData\VMware\vCenterServer\runtime\VMwareSTSService\webapps\websso\WEB-INF\views\unpentry.jsp
  • C:\ProgramData\VMware\vCenterServer\runtime\VMwareSTSService\webapps\websso\resources\css\login.css
  • C:\ProgramData\VMware\vCenterServer\runtime\VMwareSTSService\webapps\websso\resources\img

VCSA 6.0
  • /usr/lib/vmware-sso/vmware-sts/webapps/websso/WEB-INF/views/unpentry.jsp
  • /usr/lib/vmware-sso/vmware-sts/webapps/websso/resources/css/login.css
  • /usr/lib/vmware-sso/vmware-sts/webapps/websso/resources/img

>> This has to be modified on the machine where your Platform Services Controller is installed. If it is an embedded installation, then you can find it all in one machine. If it is an external PSC deployment, then all these file locations are on the PSC machine.

>> I am using a 6.0 vCenter Appliance with External PSC, so I used WinSCP to transfer files from my desktop to the appliance. 

>> If you are using appliance with WinSCP, then you need to set the bash shell to be opened as default. To do this, you can use this article here

**Have a backup of all these three above files before you make any changes**

The procedure:

>> Download a required image and save it as "AppBgPattern.png" (PNG format), as this naming convention would eliminate editing certain lines in the CSS/JSP file. 

>> Login to WinSCP and browse to the "img" directory as mentioned above and paste this copied image

This takes care of the background image for the Web Client. 

Now, you will have to edit the unpentry.jsp file to reflect the text message. 

>> Once the backup of unpentry.jsp file is made from it's location, open the file and copy paste the below text into it:


<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html class="base-app-style">
<!--[if lte IE 8]>
   <link rel="stylesheet" type="text/css" href="../../resources/css/loginIE8-7.css" />
 <![endif]-->
 <!--[if (gte IE 9)|!(IE)]><!-->
   <!--<link href="../../resources/css/login.css" rel="stylesheet"> -->
 <!--<![endif]-->
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=5, IE=8, IE=10" >
   <title>Login</title>

   <script type="text/javascript">
    // copying JSP variables to JS
    var tenant_brandname="${tenant_brandname}";
    var searchString ="${searchstring}";
    var replaceString ='${replacestring}';
    var error = '${error}';
    var errorSSPI = '${errorSSPI}'
   </script>

   <script type="text/javascript" src="../../resources/js/assets/csd_api_common.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_connection.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_base.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_factory.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_config.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_logging.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_session.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_sspi.js"></script>
   <script type="text/javascript" src="../../resources/js/assets/csd_api_sso.js"></script>

   <script type="text/javascript" src="../../resources/js/Base64.js"></script>
   <script type="text/javascript" src="../../resources/js/VmrcPluginUtil.js"></script>
   <script type="text/javascript" src="../../resources/js/CspPluginInstance.js"></script>
   <script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
   <script type="text/javascript" src="../../resources/js/websso.js"></script>

   <link rel="icon" type="image/x-icon" href="../../resources/img/favicon.ico" />
   <link rel="SHORTCUT ICON" href="../../resources/img/favicon.ico" />
</head>
<body>

<script type="text/javascript">
    // regex to check for internet explorer 11 and below
    var isInternetExplorer = /MSIE (\d+\.\d+);/.test(navigator.userAgent) || /Trident\/(\d+\.\d+);.*rv:(\d+\.\d+)/.test(navigator.userAgent);
    if (!isVCLogin()) {
        document.write('<link rel="stylesheet" type="text/css" href="../../resources/css/login_generic.css">');
    }
    else {
        document.write('<link rel="stylesheet" type="text/css" href="../../resources/css/login.css">');
    }
</script>


<script type="text/javascript">
//createProbes();
//createVmrcPluginObject();
//var _cspId = createCspPluginObject();
if (isVCLogin()) {
    //document.write("<img id=\"topSplash\" src=\"../../resources/img/AppBgPattern.png\"/>");
    document.write("<img id=\"brand\" src=\"../../resources/img/vmwareLogoBigger.png\" />");
}
else {
    document.write("<p id=\"tenantBrand\">"+tenant_brandname+"</p>");
}
</script>

<div id="loginForm">
   <p class="loginRow" >
      <span class="loginLabel">${username}:</span>
      <input id="username" class="margeTextInput" type="text" />
    </p>
    <p class="loginRow" >
      <span class="loginLabel">${password}:</span>
      <input id="password" class="margeTextInput" type="password" />
    </p>
    <p id="sessionID">
       <label id="checkboxLabel"><input id="sspiCheckbox" disabled="true" type="checkbox" onchange='enableSspi(this);'/>${winSession}</label>
    </p>
    <p id="loginButtonRow">
       <input id="submit" class="button blue" type="submit" value=${login} onclick="submitentry()"/>
    </p>
</div>

<div id="productName">
Welcome To South Park</br></br>
   <script type="text/javascript">
        if (isVCLogin()) {
           document.write("<img id=\"VCSSO-Title\" src=\"../../resources/img/VCSSO-title.png\" />");
           }
   </script>
   </br></br>
   <div id="response" style="display:none"></div>
   <div id="progressBar" style="display:none"><img src="../../resources/img/Marge-anim-progressbar.gif"></div>
</div>

<div id="footer" class="footer">
    <span id="downloadCIPlinkBox" style="display:none">
       <a id="downloadCIPlink" target="_blank">${downloadCIP}</a>
    </span>
</div>
<div id="postForm"></div>

<div class="browser-validation-banner" style="visibility: hidden">
   <span class="validation-message-text">${unsupportedBrowserWarning}</span>
</div>

<script type="text/javascript">
   if (isVCLogin() && !isBrowserSupportedVC()) {
      $(".browser-validation-banner").css("visibility","visible");
   }
</script>

</body>
</html>



The text highlighted in "Red" can be edited to display the required message. 

>> Save this file


Next, we will have to edit the CSS file to apply colors and font size to this field or any other field as per requirement:

>> Go to the directory where the CSS file is and simply paste the below code:


@charset "utf-8";
/* CSS Document Login.css */

.base-app-style {
   min-width: 1024px;
   min-height: 612px;
   position: relative;
   height: 100%;
   width: 100%;
}

body {
   background: #3075ab; /* Old browsers */
   background: -moz-linear-gradient(top,  #3a8dc8 0%, #183a62 100%); /* FF3.6+ */
   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#3a8dc8), color-stop(100%,#183a62)); /* Chrome,Safari4+ */
   background: -webkit-linear-gradient(top,  #3a8dc8 0%,#183a62 100%); /* Chrome10+,Safari5.1+ */
   background: -o-linear-gradient(top,  #3a8dc8 0%,#183a62 100%); /* Opera 11.10+ */
   background: -ms-linear-gradient(top,  #3a8dc8 0%,#183a62 100%); /* IE10+ */
   background: linear-gradient(to bottom,  #3a8dc8 0%,#183a62 100%); /* W3C */
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3a8dc8', endColorstr='#183a62',GradientType=0 ); /* IE6-9 */
   background-image: url(../../resources/img/AppBgPattern.png);
   background-repeat:no-repeat;
   margin: 0;
   font-size:12px;
   font-family:Arial, Helvetica, sans-serif;
   color: #87ceff;
}

.browser-validation-banner {
   padding: 6px 12px 6px 10px;
   margin: 0px;
   position: absolute;
   line-height: 20px;
   top: 0px;
   left: 0px;
   right: 0px;
   z-index: 100;
   background-color: #ffffcc;
   border: 1px solid #efe69b;
   border-top-style: none;
   border-radius: 0 0 5px 5px;
   color: #333333;
   box-shadow: 0 3px 3px rgba(0, 0, 0, 0.15);
}

.validation-message-text {
   margin-left: 25px;
   display: block;
   font-weight: bold;
   font-size: 11px;
}

#topSplash {
   position: absolute;
   top:0;
   left:0;
   z-index:1;
}

#brand {
   position: absolute;
   top: 55px;
   left: 120px;
   z-index:2;
}

#loginForm {
   position: absolute;
   top: 320px;
   width: 405px;
   padding-left: 44px;
   z-index:3;

   background-image:url(../img/divider.png);
   background-position:right;
   background-repeat:repeat-y;
}

.margeTextInput {
   float:right;
   margin-right: 44px;
   width:200px;

}

.loginLabel {
   font-weight:bold;
    color: #FFFFFF;

   text-align:left;
   display:block;
   padding-top:4px;

   float:left;
}

.loginRow {
   display:block;
   padding-top:20px;
}

#sessionID {
   clear:both;
   float:right;
   width:248px;
   text-align:left;
   margin-top:8px;
}

#checkboxLabel {
    display: block;
    padding-left: 20px;
    text-indent: -20px;
}

#sspiCheckbox {
    width: 13px;
    height: 13px;
    padding: 0;
    margin:0;
    margin-right:10px;
    vertical-align: bottom;
    position: relative;
    top: -1px;
    left: 5px;
    *overflow: hidden;
}

#loginButtonRow {
   clear: both;
   float:right;
   margin-right:40px;
   margin-top:0px;
}

.button {
   display: inline-block;
   zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
   *display: inline;
   vertical-align: baseline;
   margin: 0 2px;
   outline: none;
   cursor: pointer;
   text-align: center;
   text-decoration: none;
   padding: 0px 30px;
   height:24px;
   font-size:12px;
}
.button:hover {
   text-decoration: none;
}
.button:active {
   position: relative;
   top: 1px;
}

.blue {
   color: #fff;
   border: solid 2px #1d4772;
   background: #0095cd;
   background: -webkit-gradient(linear, left top, left bottom, from(#0c6fb9), to(#014781));
   background: -moz-linear-gradient(top,  #0c6fb9,  #014781);
   filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#0c6fb9', endColorstr='#014781');
}
.blue:hover {
   background: #007ead;
   background: -webkit-gradient(linear, left top, left bottom, from(#0d84dc), to(#004d88));
   background: -moz-linear-gradient(top,  #0d84dc,  #004d88);
   filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#0d84dc', endColorstr='#004d88');
}
.blue:active {
   color: #fff;
   background: -webkit-gradient(linear, left top, left bottom, from(#035a9d), to(#086fba));
   background: -moz-linear-gradient(top,  #035a9d,  #086fba);
   filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#035a9d', endColorstr='#086fba');
}

#username:disabled,
#password:disabled,
#submit:disabled,
#sspiCheckbox:disabled {
   opacity:0.3;
   filter:alpha(opacity=30); /* For IE8 and earlier */
}


#productName {
   position: absolute;
   top: 345px;
   left:499px;
   color:#F88017;
   font-size:23px;
}

#response {
    background:url(../../resources/img/error.png) left center no-repeat;
    margin-top: 20px;
    font-size: 12.5px;
    padding-left: 20px;
    color: #87CEFF;
}

#rolo {
    font-weight: bold;
    margin-top: 20px;
    font-size: 16px;
    padding-left: 10px;
    color: #FF3333;
}

#progressBar {
   display: none;
}

.footer {
   background-color: black;
   position: absolute;
   left: 0px;
   right: 0px;
   bottom: 0px;
   font-weight: bold;
   padding: 10px;
   color: #7B7E81;
   padding-left: 44px
}

.footer a {
   color : #7B7E81;
   text-decoration: none;
}

.footer a:hover{
   text-decoration: underline;
}

.info-icon {
   display: inline-block;
   width: 16px;
   height: 16px;
   line-height: 16px;
   vertical-align: middle;
   background-repeat: no-repeat;
   margin: 0px 4px 0;
   position: relative;
   background-image: url(../../resources/img/infoOver.png);
   cursor: pointer;
}



The text highlighted in red, is the part to Edit the Product area text. if you want to change the colors of the remaining sections, find the appropriate ones in the CSS file and change them. 

>> Save this file as well. 

>> Reload your Web Client

And that's it, you have your own custom Web Client Login Page.
You can find more samples on GitHub, click here

Enjoy!

WinSCP with a 6.x vCenter Appliance

Written by Suhas Savkoor



With 6.x you have two shells. Appliance shell and the bash shell. When you take a SSH session to the appliance, you will enter the appliance shell and you will have to enable the bash shell manually by running two commands that is displayed during the session.

Now, with this setup, if you try to use the WinSCP then the login will fail, as it will not be able to open the bash shell.
So here, we need to set the appliance to open with bash shell as default. To do this, login to the appliance with bash shell access and run the below command:
# chsh -s "/bin/bash" root
You will see the output

Changing login shell for root.
Shell changed.

Now you can WinSCP into your appliance machine.