OVA deployment from ESXi local datastore

I wrote one basic script for  OVA deployment from ESXi hosts local data store. This idea came to my mind after working on one project where i had to deploy OVAs on around 250 ESXi clusters.

Here i used VMware OVFTool and Selenium webdriver. You can Download  both software from the links mentioned below. Import-Vapp command from powercli doesn’t support HTTPS source for OVA deployment from ESXi local data store. You can check its help section for more information.

Import-v App script can be found here OVA Deployment via PowerCLI

OVFTOOL Download

Selenium

Explanation Line by Line-

1 – Path to OVFtool exe.

3-5 –  I have added Selenium binary or DLL using Add-type method.

7 – Path to chrome driver to open ESXi local data store webpage and fetch the HTTPS link

8 -9  – We would need ESXi root credentials here

11- Enter the v Center details

13 – Location of the OVA which needs to be uploaded to local data store

15 – Folder which we will create inside local data store to store OVA

17-30 – Code to upload OVA on local data store of first ESXi inside Cluster

30 -36 – v Switch and port group information to create VMKernel on ESXi hosts.

42-52 – Collecting IP setting for the OVAs

54 – 60 – Collect Names for the OVAs

63 – 68 – Port group and local data store information.

72-83 –  Use of Selenium and Chrome driver to access ESXi local datastore and fetch HTTPS source path

86 – 115 –  Commands to deploy OVA on ESXi hosts with OVFTOOL and VMKernel creation commands.

Hope this helps..!!  Please change the script based on your requirements. Please do share your thoughts.

VxRail – VSAN Software Component

I am starting new blog series on VxRail (Hyper Converged Product). To start with this, i thought about writing VxRail  – VSAN Software component which will help in better understanding of VxRail and VSAN.

VSAN Software Component

Cluster Level Object Manager (CLOM)

•An instance of CLOM runs on all the vSAN nodes
•/etc/init.d/clomd [start | stop | restart | status]  (Need to check on VxRail Appliance)
•Checks if object can be created based on available resources
•Ensures policy compliance of an object
•Is responsible for initial placement, migration and replacement of components
•Distributes the load equally across all the hosts

Distributed Object Manager (DOM)

•An instance of DOM runs on all the vSAN nodes
•Creates local components of an object once CLOM agrees to create an object
•Instructs DOM on other nodes to create the remaining components
•Resyncs the objects during recovery
•Defines three roles: Owner, Client and Component Manager

DOM Owner 

•Provides distributed access path to the Object
•There is one owner assigned to each DOM Object
•Owner also determines who is allowed to send I/Os to the object

DOM Client

•DOM Client performs I/Osto the object on behalf of a VM
•It runs on every host that runs a VM
•Typically resides with DOM Owner

Local Log-Structured Object Manager (LSOM)

•Performs SSD log recovery when the host boots
•Interacts with the MD and SSD directly
•Provides persistence of storage for the components
•Provides read and write buffering
•Reports unhealthy drives
•Performs I/O retries to the failing drives

•Reliable Datagram Transport (RDT)

•Network protocol for the transmission of vSAN traffic

•Cluster Membership, Monitoring and Directory Services (CMMDS)

•DOM, CLOM may use CMMDS database to learn about the topology and object configuration
•Requires multicast network to be able to form a cluster (pre vSAN 6.6)
•CMMDS is used to elect owners for objects
•It maintains inventory of items such as hosts, devices and networks
•Stores object metadata info such as policies, distributed RAID etc. in             an in-memory database
•CMMDS discovers, maintains and establishes a cluster of networked node members
•Defines four cluster roles: Master, Backup, Agent and witness host(forstretched clusters)
•The roles have nothing to do with managing objects in the cluster or doingI/Os to the objects
•The backup speeds up the process of convergence if master fails
•The roles are decided at the time of cluster discovery
•Updates are exchanged with the help of RDT
•Master to other hosts – > 224.1.2.3:12345  (Every second)
•Other hosts to Master -> 224.2.3.4:23451 (Updates)

For more information about VSAN, please refer VMware VSAN



PTE – Speaking and writing – Part 1

PTE Introduction – Introduction.This section will help you with PTE Speaking and writing information.

To assess speaking your skills will be tested by your ability to produce spoken English in an academic environment and writing section will require you to write response in academic English using correct Grammar and spelling.

Speaking 1.1 – Personal Introduction

The personal introduction is an opportunity for you to give some information about yourself. You will get 25 second to read the prompt and prepare your response, and 30 second to give response. This section will not be scored. You can give introduction in below format

  • Your name, where are you working currently
  • Your hobbies, what is importance of English in your life
  • Why did you choose PTE

Speaking 1.2  – Read a loud

You have 30-40 seconds to prepare, depending on the length of the passage. You hear a short tone. After the tone, start speaking immediately. Do not start speaking before the microphone opens because your voice will not be recorded. You should speak clearly. There is no need to rush.

Finish speaking before the progress bar reaches the end. The word “Recording” changes to “Completed”.

Tip -You can record only once and if you pause for 3 second then recording will be stopped.

Scoring –  You will be scored based on Content, Pronunciation and oral fluency

Content is not about what you do, it is about what you should not do.

You should not  – 

Be careful with

  • Articles –   a / an / the
  • Preposition –  in / on / at / to / for / with
  • Plural – Nouns –> Its very IMP to correctly pronounce plural forms, don’t skip “s”

Top Score

Top score “5” means – all “44” sounds of English are made correctly. Accent is fine but PTE focus on if you are capable of making all 44 sounds.

Understand what you are reading, if you understand what you are reading then you will read it naturally like pause at right place, correct pronunciation.

Read a loud means – Express the meaning as much as you can, as if you are giving speech or conveying a message.

Do’s (Read) –

  1. Loud a possible and with confidently
  2. Moderate pace, not quietly
  3. Meaning
  4. If you don’t know word, you can pretend.

Don’t –

  1. skip, misread or add a word
  2. Hesitate, repeat word
  3. Restart sentence
  4. “um” and “ahh”

For practice you can refer   E2Language  or  Tutorials  

Speaking 1.3 – Repeat Sentence

In this section,you need to repeat the sentence you hear.The audio begins to plays automatically. When the audio finishes, the microphone opens and the recording status box shows “Recording”. Speak into the microphone immediately (there is no short tone) and repeat exactly what you heard. You should speak clearly. There is no need to rush.

Finish speaking before the progress bar reaches the end. The word “Recording” changes to “Completed”. You are not able to replay the audio and only able to record your response once.

You will get 3 sec to prepare to listen, please take a deep breath. Question will have single sentence and repeated one time only so you must listen carefully. There are chances you might get 10-12 repeat a sentence question.

Scoring

Content – It has max 3 points per sentence. If you repeat every word in correct sequence, you will get 3 points. You get 2 points if you can repeat more than 50% of words in the correct sequence and 1 point if you repeat less than 50 % word in correct sequence.You should repeat the sentence with correct grammar.

Pronunciation and oral fluency –  You get 5 points for native like pronunciation and oral fluency.

Tip  –

  • Try to copy the rhythm and speed from the audio.
  • Sentence will generally have 10-15 words.
  • Take care of pronouncing “s” at correct place.
  • Sentence will last for 3-4 sec, you should be able to finish in same time with no errors.

Speaking 1.4 :  Describe image

You will get one graph / diagram or image in this question. 25 seconds will be provided to prepare and 40 seconds for answer.

Types of images –

  1.  Bar chart
  2. Double Bar chart
  3. Two bar chart
  4. Pie chart
  5. Double pie chart
  6. Diagram or process
  7. Table
  8. Map
  9. Multiple graph

You might get 5-6 images on test day. You will be judges or marked based on below 3 main points

  1.  Content  – You should describe the image and not label it.
  2. Pronunciation – How clearly describe image
  3. Oral Fluency – How smoothly you describe image

Use below method to describe the image –

 a. Introductory sentence ( in 5 Sec ) –

You should start like   ” This —– represents “the title” + x-axis.”

lets take above bar chart example –

“This bar chart represents the top oil reserves in various countries like Venezuela, Saudi, Canda,Iran, Russia, UAE, US and China in Million barrels.

We have to arrange the title, so it makes grammatical sense. First we have to identify the type of graph, then looks at the title and X and Y axis.

 b. Image Description (in 25 Sec)-

You should describe image in such a way that it cover all aspects of image.  We can describe above image in following way

“Venezuela has the most amount of oil at close to 300,000. This is followed closely bySaudi Arabia, Canada and then Iran. The US and China have the least amount ofoil – well below 1 million barrels each”

c. Conclusion (in 10 sec) –  

Actually you will get 10 Sec, but i would suggest to do it in 5 sec. You can start like  “Overall we can say that ……..” to show it as we are concluding the image description

We can conclude above image like  “Overall, this graph shows a steep and gradual decline in the amount of oil that each country has and Venezuela has far more oil than the US and China.”

How to Prepare Pearson Test of English (PTE)

This time i have decided to write a non-technical stuff. Recently i cleared my PTE and thought of writing what is PTE and how to prepare for it.

What is PTE?

PTE Academic is a computer-based academic English language test aimed at non-native English speakers wanting to study abroad and for immigration purpose. It tests reading, writing, Speaking and Listening.

Questions often test 2 skills together, such as listening and reading or reading and speaking. The whole test is done in a single session, lasting 3 hours and is taken sitting at a computer in a secure test environment. The speaking part of the exam is done at the computer. Your voice is recorded and sent for marking. One advantage of this test is that you get your results very quickly; in about 5 days.

More detailed information about PTE academic Here

Who accept PTE

PTE is accepted by number of university worldwide and countries like Australian and New Zealand for Visa application.

More information can be found Here

Test Format

There are twenty different question formats, ranging from multiple choice through to essay writing and interpreting information.PTE Academic assesses real-life, academic English, so you will hear excerpts from lectures and view graphs and charts. You will hear a range of accents in the test, from British and American to non-native speakers, so you will be exposed to the type of accents you will encounter in everyday life.

PTE Academic assesses real-life, academic English, so you will hear excerpts from lectures and view graphs and charts. You will hear a range of accents in the test, from British and American to non-native speakers, so you will be exposed to the type of accents you will encounter in everyday life.

Part 1: Speaking & Writing (77 – 93 minutes)

  • Personal introduction
  • Read aloud
  • Repeat sentence
  • Describe image
  • Re-tell lecture
  • Answer short question
  • Summarize written text
  • Essay (20 mins)

Part 2: Reading (32 – 41 minutes)

  • Multiple choice, choose single answer
  • Multiple choice, choose multiple answers
  • Re-order paragraphs
  • Reading: Fill in the blanks
  • Reading & writing: Fill in the blanks

Part 3: Listening (45 – 57 minutes)

  • Summarize spoken text
  • Multiple choice, choose multiple answer
  • Fill in the blanks
  • Highlight correct summary
  • Multiple choice, choose single answer
  • Select missing word
  • Highlight incorrect words
  • Write from dictation

Please check Part 1 Speaking and writing

How to use plink to run command from windows

Recently i had to run some commands on 250 linux servers in one of my project. So i decided to use plink.exe from windows machine. This section will help you how to use plink to run linux command from windows on multiple server

plink.exe without sudo privilege 

plink.exe -ssh -t -pw <password> -l <user>@<host>  -m <script> <IP Address of host>

syntax –
-m – create filename called “script.txt” or the name you want and place it under folder where plink.exe is located
-pw – password of remote host
-l – user id to login to remote host
ip address of host
-t – it will open pseudo shell

lets say script.txt include,
hostname
pwd
ls /tmp

Above command will show output on your local windows machines cmd.exe or powershell

if the host key was not cached in the registry yet, you would get an interactive prompt saying “Store key in cache? (y/n)” which would not be conducive to a batch script.
And once again, the way around this is to pipe a “y” to stdin, which makes the command:
cmd.exe /c echo y | plink.exe -ssh -t -pw myP4ss -l myuser@trusty1 -m script.txt <IP Address of host?


plink and sudo with password prompt

In the above example we dealt with simple commands that required no input and no privilege escalation with sudo (hostname, pwd).  But many times the commands we want to run in batch processes require sudo, which throws up an interactive prompt for a password.

Sudo password echoed and embedded inside plink script

Make sure you call plink with “-t” so that a tty is setup.  Then sudo to a shell and echo the password into stdin before running the command you want with sudo.

Or you can echo the password directly to the command you want to run as sudo

Run the command on number of hosts using powershell

First you need to create one text file with list of remote server IPS or FQDN (if DNS is configured properly) in the text file and place it under same folder where plink.exe is located

get-content .\linux_Server.txt | foreach {invoke-command -command {& echo y | .\plink.exe $_ -l <username> -pw <password> -m <file with list of command>; write-host -fore “$_ host finished”}}

This command will ssh in to each host under .\linux_Server.txt and execute set of commands defined in <file with list of command>

Hope this helps… feel free to comment with  suggestion,

PowerCLI Script to assign IP on each host in ESX Cluster

Recently i came across a situation where i had to create and assign IP to vmkernel portgroup (for vmotion) for 3300 ESX host. So i wrote one basic powercli script to assign IP on each host in ESX Cluster.

============================================================

PowerCLI Script to create VMKernel portgroup and assign IP on each host in cluster 

#  Note – Replace respective name wherever applicable.  Below sample is for one cluster, you can customize for all cluster in vcenter.

$vmhost = get-cluster 0000 | get-vmhost | sort Name

$pg = $vmhost[0] | get-virtualportgroup | where {$_.name -like ‘vSphere*’}

$subnetprefic=’xxxx’     # e.g. ‘192.168.10’
$ipperserver = 1
$startip = 4

foreach ($esx in $vmhost){

0..$($ipperserver-1)|%{
$ipaddress = “$subnetprefix.$($startip + $_)”
$startip += $ipperserver

new-vmhostnetworkadapter -vmhost $esx -virtualswitch $vdswitch -ip $ipaddress -subnet $subnet -portgroup $pg
}
}

Hope this short script helps.. Happy reading!!

OVA Deployment via PowerCLI

Recently i was working on project where i had to deploy RP4VM OVA on more than 400 ESXi hosts. So i decided to write article for  OVA deployment via PowerCLI

Initially i faced a lot of issue like  Deployment was stuck during ‘validation’, i couldn’t run simultaneous deployment in vcenter because of existing vcenter issue etc.

We used naming convention like VxRAIL(DC name)_vRPA1. You can change it if required.

We had to create VMKernel port on esxi hosts for other use, this is also included in last section of the script.

Here is the powercli code which i wrote, explained line by line

1 –  It will load all PowerCLI module if you want to run script from PowerShell

3- Enter the vCenter name and username, password

5 – Please mention path to ova

 7 – Please mention cluster name where you want to deploy OVA

11 – 19 – We used naming convention e.g . VxRail(Clustername)_vRPA1.

You can change as per your need.

23-26 – IP Settings for VMKernel port on ESXi hosts

29-51 – IP setting for OVA

54-81 –  Loop for OVA deployment on ESXi host in cluster

85-99 – Port group and switch info  for VMkernel assignment on ESXi.

Newer version of script available here

Hope this helps… feel free to comment !!

vCenter 6.5 upgrade issue and troubleshooting

This post will give you an overview of vcenter 6.5 upgrade issue and its troubleshooting steps.

Issues Encountered during 6.0 to 6.5 Upgrade

Issue1:- Invalid Appliance (OS) root password

Description: – While Upgrading PSC appliance we need to provide OS *root* password and it was failing with invalid password.

Resolution1: – Reset PSC OS *root* password through web-console and try again.

  • Login to PSC URL <https://PSC_FQDN or IP Address:5480>
  • Go to Administration tab
  • Change Password

Most Important – I have noticed this issue while upgrading or migrating from vCenter 6.5 U3D to 6.5.  For other release i didn’t faced this issue.

Issue2:- VUM Extension blocking Migration

Description: – If VUM Extension is not in use un-register VUM from the vCenter server.

Resolution:- Follow this KB Article https://kb.vmware.com/s/article/1025360

  • Power- Off VUM server 

Issue3:- Unable to detect Network at Step 8

Description: – If vCenter server Management N/W is configured in Distributed Switch and if we provide ESXi host details at step 3 & 4 we are unable to select N/W option at Step8.

Because, “When ESXi is used as the deployment target, non-ephemeral distributed virtual port groups are not supported and hence, not shown drop-down list.

Resolution:- At Step 3 provide – Target Host details & Select Host, At Step4 provide vCenter server details for Appliance deployment.

Note:- If we provide At setep3 & step4 both vCenter details it will fails to migrate data.

Issue4:- AD users unable to access after PSC upgrade, In disjoint domain namespace the domain users might fail to authenticate after you update to vSphere 6.5

Description:- After PSC 6.0 to 6.5 Upgrade AD users unable to access vCenter server.

Resolution: – Delete AD with integrated windows authentication and Add again

Note:- To perform below activity requires AD rights.

  • Remove PSC’s from AD Object
  • Login to PSC <https://PSC_FQDN or IP Address/PSC>
  • Login with “administrator@vsphere.local”
  • Go to Appliance Settings –> Manage and Rejoin Server to AD Domain.
  • Enterprise AD Domain admin credentials requires from customer.
  • Reboot PSC’s.
  • Validate vCenter authentication with AD credentials.

Issue 5:- Re-Register VUM with vCenter server

Description:- If VUM extension error triggers then follow this procedure to Re-Register VUM with vCenter server.

Resolution: – Follow below steps

  • Login to VUM VM
  • Navigate to C:\Program Files (x86)\VMware\Infrastructure\Update Manager
  • Find ‘ VMwareUpdateManagerUtility.exe’, double click on it
  • Login to the update manager Utility using previously used SSO credentials.
  • Navigate to Re-register to vCenter Server –> enter the SSO credentials and new vCenter IP/FQDN and click Apply. This will re-register VUM to newly deployed VC
  • Once done, close the wizard, and restart the VMware vSphere update Manager Service
  • Login to vCenter and click on plug-ins and enable the VUM plug-in
  • Once you enable ‘update manager’ will appear in vCenter

Issue 6:- Error could not reach the given source vCenter server on “Port 22”

Description: – If SSH is disabled on PSC’s/Appliance vCenter server then this error triggers.

Resolution: – Enable SSH on PSC/Appliance vCenter prior to upgrade.

  • Login to PSC/Appliance vCenter through Web with port 5480
  • Go to Access
  • Click on Edit Option
  • Enable SSH

Issue 7 – Windows Migration to 6.5 appliance fails 

Description – If source database size is large, then migration pre-check will fail with below error

Resolution – Please check the source database, which table is utilizing more space. Once you find it, either shrink it or compress.  

Note – Please refer VMware KB 51589 here.

Reconfigure PSC from embedded to External

Re-configure PSC from Embedded to External

This article will guide you steps to, Reconfigure PSC from embedded to External. To achieve this, first of all you need to install new PSC (it could be windows based or appliance based) in same SSO domain.

Scenario – VMware vCenter 6.0 U3D is setup with embedded PSC.

Go to Cd-rom –> open vcsa-setup.html and choose install

Provide the required information. You can give vcenter name or ESXi name on which this PSC needs to be deployed.

Select the cluster where PSC needs to be deployed

Give the name of PSC and setup the password

 

Select the existing  SSO Domain name.

Most important – Similarly you can verify SSO site name and domain by below method , if you have multiple SSO site and domains then this steps will help you to cross check correct SSO site.

For VCSA appliance

/usr/lib/vmware-vmafd/bin/vmafd-cli get-domain-name –server-name localhost

/usr/lib/vmware-vmafd/bin/vmafd-cli get-site-name –server-name localhost

Please refer David blog’s for more info SSO Site Name and Domain check

For windows embedded PSC

C:\ProgramData\VMware\vCenterServer\cfg\install-defaults\vmdir.domain-name

“C:\Program Files\VMware\vCenter Server\vmafdd\vmafd-cli.exe” get-ls-location –server-name localhost

Note – Installation path might very based on your environment setup

Please refer William Lam Blogs for More info SSO Site Name and Domain check

Select existing SSO Site name

 

Select the datastore where PSC  needs to be deployed

Enter the appropriate network settings and click finish to start installation.

Please go to the below path

“vcenter installation directory\bin” folder and run below command to see PSC replication partner

vdcrepadmin.exe -f showservers -h localhost -u administrator -w “password”

Note – User should be SSO user.

Here you can see, new PSC is configured as partner with embedded PSC now.

Lets cross check if replication is happening between Embedded PSC and new PSC or not.

 

Step-3 Now we come to the most important steps, to reconfigure PSC from embedded to external

Go to below path

“vcenter installation directory\bin” and run below command

cmsso-util reconfigure –repoint-psc “New PSC FQDN or IP” –username administrator -passwd “password” -domain-name “sso domain name”

Lets verify if new vcenter is pointing to new PSC or not.

Go to advanced setting of vcenter server

Under config.vpxd.sso.sts.uri  — you will see new PSC name

Or go to below path to verify

        VCSA:

         /usr/lib/vmware-vmafd/bin/vmafd-cli get-ls-location –server-name localhost

        Windows VC:

        C:\Program Files\VMware\vCenter Server\vmafdd\vmafd-cli get-ls-location –server-name localhost

       Hope this helps, feel free to comment  🙂

 

vCenter Upgrade Troubleshooting

This article will guide you through various vcenter upgrade troubleshooting steps for windows based vcenter.

  1. You may see below error while upgrading virtual center

2.  To solve this,

a. Ensure tasks mentioned in point 5  Pre-check  are taken care.    Anti-virus / backup software may block VMware DLL / process and                  upgrade will fail.

b. Try the upgrade one more time, if it fails once again then download the “Process explorer” from Microsoft web site

Process Explorer

      c. Check if DLLs mentioned in below KBs are blocked by any process using Process explorer

https://kb.vmware.com/s/article/2149266

                                                                                       

If you find any process using DLL mentioned in above  KB,  kill those process and retry the upgrade.

 3. If it upgrade fails then follow steps 5 to 8 as mentioned in above VMware KB.   (Please ensure snapshot is taken before trying this               step   and all vcenter related services are stopped to delete the files mentioned in steps 5 to 8)

4. You may get different errors, like

Installation of component VCSServiceManager failed with error code ‘1603’. Check the logs for more details

Follow KB- https://kb.vmware.com/s/article/2119768    or  https://kb.vmware.com/s/article/2127284