Tuesday, August 30, 2016

We had a situation here on a cisco c240 server where the mac to vmnic number was different and not in series.

The pic that you see is after we fixed it. Earlier the vmnic numbering wasIntel I350
vmnic0
vmnic1
vmnic2
vmnic3

Intel 82599 10 Gig ethernet
vmnic4
vmnic6

Intel ethernet x540
vmnic5
vmnic7

where it should have been how it is in the picture. What my colleague and mentor kung fu panda aka ravi sutrave did was pretty simple, he renamed these last 4 suckers (vmnics) with some temporary names like this in the esx.conf file,

and then renamed them back to the way they should have been in the first place.

:%s/vmnicx/vmnic7/g:%s/vmnicy/vmnic6/g

:%s/vmnicp/vmnic4/g:%s/vmnicq/vmnic5/g

Yes we did reboot the hosts few times and these settings were persistent across reboots. If you want to do the same on multiple hosts then you can use the plink and push these commands to all hosts at once.
I have handy dandy tool which will take care of it (enable ssh, push commands via ssh, disable ssh), try it and let me know if it doesnt work on twitter.
Here is the https://raw.githubusercontent.com/MrAmbiG/vmware/master/vTool/vTool_2016aug.ps1 vtool and in one of its menus it contains WinSSH. Run that and it will take you through the process of pushing any ssh commands to esxi hosts.
https://raw.githubusercontent.com/MrAmbiG/vmware/master/vTool/vTool_2016aug.ps1

Friday, August 12, 2016

It is quite normal for anyone wanting to extract as much as
they can from a hardware that they have bought. Make optimal use of it. When
you are looking at Esxi hosts you are looking at a certified hardware which has
been tested and tasted by experts at VMware and the vendor. If you have put
some thousands or crores of money into your hardware, then you might well make
the best use of it. If you are a biological being, then you want to live longer
but if you are hardware then you want to do the best before you become
obsolete.

VMware itself supports 3 types of performance or power
modes.

1.High Performance

2.Balanced

3.Low power

I myself would put my hosts in high performance mode but your
scenarios might differ. I mean does it make sense to put your bike always on
high throttle or wheelie mode (if you have any of the newer street bikes with
different riding modes coz I don’t) in a city traffic? No. Below is a glimpse of
where you can do it via GUI.

I would however want to do this via Powercli where you can
get this done to all your esxi hosts at once. High performance mode as the name suggests, the operating system
assumes that your workload’s requirement of resources keeps changing
drastically and it always needs the resources to be ready. It does however
comes at the cost of more power consumption. The main goal here is the
performance and power consumption is of no concern to the esxi host.

Balanced as the
name itself suggests will maintain a balance between the power consumption and
the performance. Here esxi will still give priority to the performance but not
at the cost of too much power consumption.

Low Power is the
most energy saving mode where esxi will prioritize on power saving against
performance. This can be used for failover hosts in a cluster if your HA
settings are such that you have reserved hosts for failover.

Combine this with the BIOS settings of your esxi hosts and
you will have some amazing performance for your hosts.

I would suggest the following for your environment if you
are wondering what is the right one for your environment. I suggest 2 ways of
deciding it.

Method 1: Flactuation

You can approximately consider the following values per day
or week.

Lowerst % of resource Usage

Highest % of Resource Usage

Flactuation [H-L]

Performance Setting

L

H

30 - 40

High Performance

L

H

20 - 30

Balanced

L

H

20 - 10

Low Power

Method 2: Maximum Resource Usage

-+70% to -+90% à
High performance

-+50% to -+70% à
Balanced

50% or lessà Low Power

Here -+ stands for plus or minus, meaning an approximation
or round figure.

You would however may not remember the above 3 options
against their numbers. So it might be better to do a write-host for this
function where it will inform about it and asks you to choose.

Write-Host"choose a number from below

1. High performance

2. Balanced

3. LowPower

"-BackgroundColorWhite-ForegroundColorBlack

And take the user input after this with

$option=Read-Host"?"

It is also annoying that this won’t tell you the real
progress or won’t tell you currently on which host is it running. That is why
we might want to create a loop for each host and display the name of the host
before it runs.

Friday, August 5, 2016

Okay i know i know, i am re using the same title from alan renouf's
[http://www.virtu-al.net/2013/01/07/ssh-powershell-tricks-with-plink-exe/ ]
site but this is in actuality the same content too.
The original scriptlet from alan renouf served me well so far untill i
realized it won't do the 2 things that I want
1. There is no time out for the plink download, if it is blocked in your
environment then it will just hang there and you have to close your
powershell/powercli/ise to restart the whole process.
2. It won't wait for the user to manually copy the plink in that folder.
I thus decided to go with

Invoke-RestMethod

Instead of

net.webclient

Since the former offers a time out period.

I also did a small do loop to keep asking for plink if it is
not present in the folder. Another good thing about

Invoke-RestMethod

is, it will download it to the root directory of the script
without you mentioning it. Nice han!

as you can see the line one is the location of the plink
(root directory of the script).

2nd line creates a variable to check whether that
plink’s path is true or not. The rest is pretty straight forward from then
onwards.
You can always get it from my github page.
github.com/mrambig/vmware

About Me

A passionate IT Professional with an endless fetish for innovative Science & Technology.I am a lot of things and a few among them areAn avid gamer,loves photography(not anymore),love a lot of variety of music, movies (foreign),like a lot of manga, anime series and most importantly love life.