Monday, November 28, 2016

vCenter Host Gateway … more than meets the eye vCenter Host Gateway

While going through the download motion like many of you when vSphere 6.0 was generally available, something that caught my eye in the vCenter Server download area was something called the vCenter Host Gateway (vCHG) virtual appliance. At first, I did not know what that was and until I spoke to a few colleagues did I realize that vCHG is the evolution of the Multi-Hypervisor Management (MHM) Plugin which provides vSphere Administrators a way to natively manage Hyper-V hosts within the vCenter Server UI. MHM was originally released as a Fling and later then productized within the vCenter Server product. At the time, it made sense for the plugin to be Windows based as it needed to connect to Hyper-V which obviously ran on Microsoft Windows.
It looks like the folks over in the MHM team have been quite busy as they have gotten rid of the Windows installer and have now provided a Virtual Appliance which uses winrm to directly communicate to the Hyper-V hosts. In addition, you can now manage Hyper-V hosts within the vSphere Web Client where as previously it was only available using the vSphere C# Client. vCHG works with both vCenter Server for Windows as well as the vCenter Server Appliance, there are no additional Windows host required for this new solution. Deploying and configuring vCHG is relatively straight forward and you can find all the instructions here. There were a few minor gotchas that I ran into and I thought it would be worth sharing, especially figuring out what was needed on the Hyper-V hosts which was mainly due to my lack of familiarity with winrm.
You have the option of configuring winrm to go over standard HTTP (port 5985) or HTTPS (port 5986) on the Hyper-V host but the latter requires you to setup SSL Certificates which you can find more details here. For that reason, I just went with the default HTTP method to quickly get going. To configure winrm, you will need to run following command and accept the default with "y":
winrm quickconfig
Next, you will need to enable winrm listener as shown in the screenshot below by running the following command:
winrm e winrm/config/listener
vcenter-host-gateway-1
At this point, you can now login to your vSphere Web Client and to add a Hyper-V host, you will need to add at the vSphere Datacenter level. This was another thing that I missed and though could be added into its own vSphere Cluster. As you can see from the screenshot below, we have extended our "Add Host" workflow to natively support Hyper-V hosts, so that it is intuitive and familiar for our vSphere Administrators.
vcenter-host-gateway-0
You will need to specify both the Hostname/IP Address of Hyper-V host followed by the winrm port (e.g. hostname:5985) and then select the Type to be "Hyper-V" and in a just a few seconds, you will be able to see your Hyper-V hosts within vCenter Server and perform basic power operations as well as creating/managing VMs running on Hyper-V. Below is a screenshot of my Hyper-V host and I just finished created a new VM using the vSphere Web Client and you can see it seamless integrated into a single view.
vcenter-host-gateway-2
This is great enhancement for customers who have to run a mix workload between vSphere and Hyper-V (I do apologize to those in advance ;)) but at least you now truly now have a single integrated pane of glass to manage all your workloads. I also do want to stress the word "integrated" beyond just the UI component that vCHG provides. I have found that all the operations through the vSphere Web Client is also exposed through our rich vSphere API, for example the AddHost_Task() method now includes a new hostGateway spec. This also means you will be able to use all the existing power operations and create VMs methods against your Hyper-V hosts, again tightly integrated into the existing tools you are familiar with such as PowerCLI for example for Automation. How freaking cool is that!?
but wait ... there's more! 😀
While going through the exercise of deploying vCHG and adding Hyper-V host, I could not help but wonder why we named this feature "Host Gateway", especially since we only supported a single third party hypervisor, did not really make sense to me? Well, it turns out there is a lot more coming! When you select the "Type" from the drop down menu, I notice there were a few more options: KVM and vCloud Air!
vcenter-host-gateway-4
I of course I tried to add a KVM host as well as my vCloud Air account but looks like those providers are not available just yet. I am actually quite excited to see support for vCloud Air. This has always been something I felt should have been available natively within the vSphere Inventory so that an administrator could deploy their workloads either locally on-premises or hosted on vCloud Air without having to jump around. It should align with the existing vSphere Administrator workflows and I am glad to see this change. This is definitely an area that I recommend keeping an eye out on and hopefully we will see vCloud Air support soon!

Tuesday, November 22, 2016

HOW TO ALLOW SHELL AND SCP ACCESS IN VCENTER 6 APPLIANCE WINSCP

https://vmexpo.wordpress.com/2015/06/05/how-to-allow-shell-and-scp-access-in-vcenter-6-appliance/

Few days back. I had installed vCenter 6 appliance and configured it. Today I need to copy Microsoft sysprep files into the vcenter appliance to configure guest customization. But when I tried to connect using winscp client. I got the following error.
vCenterApplianceShellAccess-01
If you click on “Abort” Button then the actual error displayed. Which tells you why there is no access on appliance. Click “OK”
vCenterApplianceShellAccess-02
Solution 1:
This solution does not required any configuration in vCenter Appliance side. From “WinSCP” Client. Choose “SFTP” File protocol from drop down and enter vCenter credentials -> Click “Advanced” Button ->in Advance Site Settings-> Under “Environment -> SFTP -> In “Protocol options” Section -> Enter below command in “SFTP Server” settings.
shell /usr/lib64/ssh/sftp-server
Click “Save” and “Connect” the Client.it should work.
vCenterApplianceShellAccess-03
Without doing above settings. If you try to connect using SFTP .you will get following error.
vCenterApplianceShellAccess-04
Solution 2.
This solution required changes on vCenter appliance Side.
Option 1: From vCenter Appliance:
Using Classic Client:
Here is the 2nd solution of the problem. Access the vCenter appliance using vSphere classic Client.
vCenterApplianceShellAccess-05
Click “F2” and enter the “root user credentials” then again click “F2” to access the Customize System options.
In “System Customization” -> Select “Troubleshooting Mode Options” -> Press“Enter”
vCenterApplianceShellAccess-07
In Troubleshooting Mode options -> Select “Bash Shell” option and Press “enter”. Optionally you can enable “SSH” as well. Press “ESC twice” to “save” the setting and “exit” from the settings.
vCenterApplianceShellAccess-08
Using Web Client:
You can enable both options SSH and Bash from web client as well.
From Web Client home->Administration->Under Deployment->System Configuration -> Click On “Nodes” -> Click on Node Name “vCenter” -> Under vCenter settings -> Manage -> Settings -> Firewall -> Click “Edit”.
In “Edit Setting” -> Access ->Verify both check box are checked.
vCenterApplianceShellAccess-17
At this stage, if you are not in vCenter appliance console then go their and Press “ALT+F1” to access Appliance Shell. Next enter your “root” credentials and login. Of course you can go back to the vCenter Appliance Main Screen using “ALT+F2”
vCenterApplianceShellAccess-09
Once you logged in. enter “Shell” command to go in bash shell.
vCenterApplianceShellAccess-10
Above command temporarily change the shell. Even at this stage you shell changed at appliance. But you still not able to use winscp client to copy the files at appliance.
To enable the scp access. You have to change the shell by using the below command at bash shell on vCenter appliance.
#chsh –s /bin/bash
vCenterApplianceShellAccess-11
Now try to acces the vCenter appliance using winscp and it should work as shown below.
vCenterApplianceShellAccess-12
By changing the shell using above command.Now every time when you logged it. you will directly login into bash shell.
vCenterApplianceShellAccess-14
If you want to change the shell back to appliance default from bash shell. Use the below command.
#chsh –s /bin/appliancesh
vCenterApplianceShellAccess-15
Option 2: From Shell
If you do not want to enable appliance bash shell from vCenter appliance using vSphere clients as I did in above steps.
Then Either you “SSH” on the appliance using putty, if you have already enabled it or press “ALT+F1” to access the appliance shell directory from appliance.
Run the below commands on vCenter Appliance Shell.
#shell.set –enable True

#Shell
vCenterApplianceShellAccess-16

HOW TO ALLOW SHELL AND SCP ACCESS IN VCENTER 6 APPLIANCE WINSCP

https://vmexpo.wordpress.com/2015/06/05/how-to-allow-shell-and-scp-access-in-vcenter-6-appliance/

Few days back. I had installed vCenter 6 appliance and configured it. Today I need to copy Microsoft sysprep files into the vcenter appliance to configure guest customization. But when I tried to connect using winscp client. I got the following error.
vCenterApplianceShellAccess-01
If you click on “Abort” Button then the actual error displayed. Which tells you why there is no access on appliance. Click “OK”
vCenterApplianceShellAccess-02
Solution 1:
This solution does not required any configuration in vCenter Appliance side. From “WinSCP” Client. Choose “SFTP” File protocol from drop down and enter vCenter credentials -> Click “Advanced” Button ->in Advance Site Settings-> Under “Environment -> SFTP -> In “Protocol options” Section -> Enter below command in “SFTP Server” settings.
shell /usr/lib64/ssh/sftp-server
Click “Save” and “Connect” the Client.it should work.
vCenterApplianceShellAccess-03
Without doing above settings. If you try to connect using SFTP .you will get following error.
vCenterApplianceShellAccess-04
Solution 2.
This solution required changes on vCenter appliance Side.
Option 1: From vCenter Appliance:
Using Classic Client:
Here is the 2nd solution of the problem. Access the vCenter appliance using vSphere classic Client.
vCenterApplianceShellAccess-05
Click “F2” and enter the “root user credentials” then again click “F2” to access the Customize System options.
In “System Customization” -> Select “Troubleshooting Mode Options” -> Press“Enter”
vCenterApplianceShellAccess-07
In Troubleshooting Mode options -> Select “Bash Shell” option and Press “enter”. Optionally you can enable “SSH” as well. Press “ESC twice” to “save” the setting and “exit” from the settings.
vCenterApplianceShellAccess-08
Using Web Client:
You can enable both options SSH and Bash from web client as well.
From Web Client home->Administration->Under Deployment->System Configuration -> Click On “Nodes” -> Click on Node Name “vCenter” -> Under vCenter settings -> Manage -> Settings -> Firewall -> Click “Edit”.
In “Edit Setting” -> Access ->Verify both check box are checked.
vCenterApplianceShellAccess-17
At this stage, if you are not in vCenter appliance console then go their and Press “ALT+F1” to access Appliance Shell. Next enter your “root” credentials and login. Of course you can go back to the vCenter Appliance Main Screen using “ALT+F2”
vCenterApplianceShellAccess-09
Once you logged in. enter “Shell” command to go in bash shell.
vCenterApplianceShellAccess-10
Above command temporarily change the shell. Even at this stage you shell changed at appliance. But you still not able to use winscp client to copy the files at appliance.
To enable the scp access. You have to change the shell by using the below command at bash shell on vCenter appliance.
#chsh –s /bin/bash
vCenterApplianceShellAccess-11
Now try to acces the vCenter appliance using winscp and it should work as shown below.
vCenterApplianceShellAccess-12
By changing the shell using above command.Now every time when you logged it. you will directly login into bash shell.
vCenterApplianceShellAccess-14
If you want to change the shell back to appliance default from bash shell. Use the below command.
#chsh –s /bin/appliancesh
vCenterApplianceShellAccess-15
Option 2: From Shell
If you do not want to enable appliance bash shell from vCenter appliance using vSphere clients as I did in above steps.
Then Either you “SSH” on the appliance using putty, if you have already enabled it or press “ALT+F1” to access the appliance shell directory from appliance.
Run the below commands on vCenter Appliance Shell.
#shell.set –enable True

#Shell
vCenterApplianceShellAccess-16

Wednesday, November 16, 2016

Packaging Server images with Packer.IO

Link


INTRODUCTION TO PACKER

Welcome to the world of Packer! This introduction guide will show you what Packer is, explain why it exists, the benefits it has to offer, and how you can get started with it. If you're already familiar with Packer, the documentation provides more of a reference for all available features.

What Is Packer?

Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image.
machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc.

Monday, November 14, 2016

Windows Server 2012 on ESXi 4.1

Windows Server 2012 on ESXi 4.1

My I.T infrastructure at home has 4 ESXi 4.1 servers which host a number of VMs that are used for home and work purposes.  However, my organically grown infrastructure has now reached the point where it needs re-organising.  As part of that I’m installing new A/D controllers and decided to use Server 2012.
And then found that ESXi 4.1 doesn’t support it.  Try it and you’ll get the Server 2012 sad face appearing.  I don’t have time just now to update to ESX5.X on my servers, so I hunted around the Internet to see if there was a workaround.
I found these set of instructions ( really don’t do this for a production environment )
    • Create a  new VM over the vSphere Client.
    • As “Guest Operating System” use Microsoft Windows Server 2008 R2 (64-bit)
    • After VM has been created but before first power on, download the following  bios file and upload it to your ESXi datastore into the folder of the VM
    • Now open the .vmx file of the new VM and add the follwing lines
bios440.filename = "bios.440.rom"
mce.enable = TRUE
cpuid.hypervisor.v0 = FALSE
vmGenCounter.enable = FALSE

Vmware NSX SSL creation 

Using OpenSSL for NSX Manager SSL import: Creates CSR and 4096 bit KEY Creating NSX 6.4.2 SSL    openssl req -out nsxcert.csr -newkey rsa:40...