Friday, 11 October 2019

Disk lock error in VMware


Issue :

You encounter below error while consolidating VM or powering ON a VM :

An error occurred while consolidating disks: msg.snapshot.error-DISKLOCKED

An error occurred while consolidating disks: msg.fileio.lock.

Consolidation failed for disk node 'scsi0:0': msg.fileio.lock

Unable to access a file filename since it is locked

Unable to access virtual machine configuration

A general system error occurred: vim.fault.G-enericVmC-onfigFault

Cause :
  • The common reason would be a powered on virtual machine contains locks on all files in use by the owning ESXi host to facilitate read and write access.
  • Other locks may be created by hot-adding disks to snapshot based backup appliances during the backup process.
  • Failure to create a lock / start a virtual machine can occur if an unsupported disk format is used or if a lock is already present.
Solutions

Solution 1 : vMotion the virtual machine

vMotion the virtual machine to a different host and try to consolidate/power on.

If the above is not successful storage vMotion the virtual machine to a different datastore.

Solution 2 : Restart the management agents on the particular host the VM is running on.

SSH into the ESXi host and run the command services.sh restart

Solution 3 : Restart the ESXi host.

Shutdown the affected VM. vMotion all other working VMs to a different host and restart the ESXi host.

Solution 4 : Unregister the virtual machine from the host & re-register the virtual machine on the host holding the lock.

Solution 5 : Clone the VMDK files to a different datastore using PowerCLI, create new Virtual Machine, attach the cloned VMDKs’.


Thursday, 19 September 2019

Get Cluster Resources using PowerCLI : VMware

Requirement : You need to extract CPU, Memory and Datastore size from a vCenter cluster.

Procedure:

Open PowerCLI

Enter the command Connect-VIServer <yourvcenterserver>

Now enter the below script after connecting your vCenter in PowerCLI:

Get-Cluster -Name  | get-vmhost | select Name, NumCpu, CpuUsageMhz, CPUTotalMhz, MemoryUsageGB, MemoryTotalGB | Export-Csv -NoTypeInformation -UseCulture -Path c:\temp\cluster.csv

You will get result similar to below 



This will extract the CPU, Memory total allocated and usage details.

Now to get a high level capacity details of all clusters in a vCenter please follow the below.

1. Create a PowerCLI profile and add the below code.

 a. To create a profile use the below code in PowerCLI

if (!(test-path $profile))
           {new-item -type file -path $profile -force}
notepad $profile

Now paste the below code in the notepad which has just opened, save and close it.

function Get-ClusterCapacityCheck {

[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=$true,HelpMessage="Name of the cluster to test",
ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)]
[System.String]
$ClusterName
)

begin {
$Finish = (Get-Date -Hour 0 -Minute 0 -Second 0)
$Start = $Finish.AddDays(-1).AddSeconds(1)

New-VIProperty -Name FreeSpaceGB -ObjectType Datastore -Value {
param($ds)
[Math]::Round($ds.FreeSpaceMb/1KB,0)
} -Force

}

process {

$Cluster = Get-Cluster $ClusterName

$ClusterCPUCores = $Cluster.ExtensionData.Summary.NumCpuCores
$ClusterEffectiveMemoryGB = [math]::round(($Cluster.ExtensionData.Summary.EffectiveMemory / 1KB),0)

$ClusterVMs = $Cluster | Get-VM

$ClusterAllocatedvCPUs = ($ClusterVMs | Measure-Object -Property NumCPu -Sum).Sum
$ClusterAllocatedMemoryGB = [math]::round(($ClusterVMs | Measure-Object -Property MemoryMB -Sum).Sum / 1KB)

$ClustervCPUpCPURatio = [math]::round($ClusterAllocatedvCPUs / $ClusterCPUCores,2)
$ClusterActiveMemoryPercentage = [math]::round(($Cluster | Get-Stat -Stat mem.usage.average -Start $Start -Finish $Finish | Measure-Object -Property Value -Average).Average,0)

$VMHost = $Cluster | Get-VMHost | Select-Object -Last 1
$ClusterFreeDiskspaceGB = ($VMHost | Get-Datastore | Where-Object {$_.Extensiondata.Summary.MultipleHostAccess -eq $True} | Measure-Object -Property FreeSpaceGB -Sum).Sum

New-Object -TypeName PSObject -Property @{
Cluster = $Cluster.Name
ClusterCPUCores = $ClusterCPUCores
ClusterAllocatedvCPUs = $ClusterAllocatedvCPUs
ClustervCPUpCPURatio = $ClustervCPUpCPURatio
ClusterEffectiveMemoryGB = $ClusterEffectiveMemoryGB
ClusterAllocatedMemoryGB = $ClusterAllocatedMemoryGB
ClusterActiveMemoryPercentage = $ClusterActiveMemoryPercentage
ClusterFreeDiskspaceGB = $ClusterFreeDiskspaceGB
}
}
}

b. Close and re-open PowerCLI to get the above change effective.

2. Run the below script to extract the details.

Get-Cluster | Get-ClusterCapacityCheck | Select-Object Cluster,ClusterCPUCores,ClusterAllocatedvCPUs,ClustervCPUpCPURatio,ClusterEffectiveMemoryGB,ClusterAllocatedMemoryGB,ClusterActiveMemoryPercentage,ClusterFreeDiskspaceGB

You will get result similar to below



Wednesday, 27 March 2019

Java Update tab missing


Issue : You could not find Update tab in Java Control Panel


Solution :

For 32 bit OS:  Go to HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy and change the value of EnableJavaUpdate to 1

For 64 bit OS : Go to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy and change the value of EnableJavaUpdate to 1



Cheers! 


Migrate option grayed out while trying to vMotion a VM


You may face the below issue on a vSphere environment:


Fix:

(Caution: Before performing these steps, make a note of the datastore where the virtual machine resides.)

1. In the vSphere Client, right-click the powered-off virtual machine and click Remove from Inventory.
2. Click Yes when prompted to confirm the removal.
3. Click Home > Storage
4. Open the Datastore and folder where the VM’s vmx file is stored
5. Right-click the .vmx file and click “Add to Inventory” (or “Register VM” in some verisons).
6. Follow the steps in the wizard to add the virtual machine back to the Inventory.
7. Click Home > Hosts and Clusters.
8. Right-click the virtual machine. The migrate option is now available.

Cheers!


An error occurred while taking a snapshot: msg.snapshot.error-QUIESCINGERROR

We are using Veritas NetBackup solution and encounter the above error frequently on our network.

There are multiple causes for this issue and you need to apply separate fix for each issue.

Solution 1 

The first and foremost thing we do is to search the VMware KB. So let's first work through the following article and see if it resolve the issue: https://kb.vmware.com/s/article/2069952

Solution 2 

Root cause : Though VMware snapshot provider service was disabled it was causing backup failure.

Fix : Upgrade VMware tools and remove Volume Shadow Copy Service Support during the upgrade (reboot is not required). This will remove the VMware snapshot provider service from server.


Solution 3

Root cause : Symantec Backup Exec Remote Agent is stopping the Virtual Disk Service

Fix : Un-install Symantec Backup Exec Remote Agent for Windows Systems from Programs and Features.


Cheers!


Remote Registry Query for Multiple Computers in a Domain


You may use this method to query any registry information from a batch of servers/computers in your network.

In this example I have queried the Symantec Endpoint Protection version currently installed on the servers and it's reporting servers.

Basically I need to query the value of the below registry keys in the remote server.

Location : HKLM\SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion\Public-Opstate

Reg Key : LastServerIP

Location : HKLM\SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion

Reg Key : PRODUCTVERSION

Basic Requirement

a. Make sure that you have admin privilege on the machine you are running the query.

b. Make sure that Remote Registry Service is started on the target machines.

Method

1. Create a .bat file and paste the below script

@echo off
set file=c:\serverlist.txt
for /f "Tokens=*" %%g in (%file%) do (
echo %%g>> c:\regquery.txt
reg query "\\%%g\HKLM\SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion\Public-Opstate" /v LastServerIP>> c:\regquery.txt
reg query "\\%%g\HKLM\SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion" /v PRODUCTVERSION>> c:\regquery.txt
echo.>> c:\regquery.txt
echo.>> c:\regquery.txt
)

{Note :  The one I marked in red is what you need to modify in your case
            Also if you have multiple reg queries please add them one by one on the script}


2. Create a text file c:\serverlist.txt and paste the name of server you need to check.

3. Run the script in cmd with admin access.


4. Results will be present in c:\regquery.txt and is similar to below :


Cheers !

Meru WLAN Basic Configuration Guide

Meru

Meru Networks is a supplier of wireless local area networks (WLANs) to various industries. Meru Networks was founded in 2002 and headquartered in Sunnyvale, California, United States. Meru formulated many innovative approaches to wireless networking. It has used virtualization technology to create an intelligent and self-monitoring wireless network to allow enterprises to become all wireless, while smoothly migrating their business-critical applications from wired to wireless networks.

Major Products of Meru

Hardware

Controllers - For small enterprise to large enterprise use various models of controllers are available. Eg: MC1550, MC6000 etc.

Access Points - Different models of Access Points are available for various deployment scenarios.

Software 

Meru System Director Operating System - The operating system which runs on all Meru controllers and access points

Meru E(z)RF Network Manager - Manages multiple controllers and thousands of access points providing real-time location tracking and location firewall.

Meru Spectrum Manager - A spectrum analysis solution.

Meru Identity Manager - Allows businesses to provide access to thousands of Wi-Fi devices in the “bring your own device” (BYOD) workplace.

Meru Virtual Controller - Provides the same functionality as that of the hardware controller. It can be downloaded as OVF template and can be loaded to Esxi server.

To know more about the products visit http://www.merunetworks.com/products/index.html

Wireless LAN - The Meru Difference

Some of Meru’s key technology innovations include:

- Single Channel Architecture (SCA) for pervasive Wi-Fi coverage without the hassle of costly site surveys

- Channel layering to maximize client density without sacrificing pervasive coverage

- Intelligent network control traffic management

- Robust on-boarding and monitoring solution for BYOD

Basic Meru WLAN setup

This setup includes the following components:

1.) Meru MC3200v Virtual LAN Controller

2.) Meru 320i access points.

3.) Windows domain. 

4.) RADIUS server for AAA (Windows NPS).

Network Diagram






















In this example I have used Meru Virtual LAN controller instead of a hardware controller. When it comes to the configuration part there will not be any difference between a hardware controller and virtual controller, except the system director is loaded to a hardware box in the former and to a virtual machine in latter.

Step by step configuration

This configuration includes the following:

A.) Deploying the controller, Access Point to an existing wired network consist of a Windows Domain

B.) Basic Controller and Access Point Configuration

C.) Basic Wireless Profile setup for  domain users with RADIUS authentication

D.) Basic Wireless Profile for guest users

E.) Configuring TACACS+ Authentication for Administrators (Optional)

A.) Deploying the controller, Access Point to an existing wired network consist of a Windows Domain.

1.) Meru Controller Installation. Download the Controller Installation guide and follow the steps outlined to deploy either a hardware controller or virtual controller. 

2.) The next step is to perform the basic configuration of the controller which you have deployed earlier. 

3.) Access the Controller console (if it is a hardware controller, connect it using a console cable and virtual controller - connect through vSphere client console )

3.)  Login to the controller with user name as admin and password admin. Type setup to launch the initial configuration script.

4.) Perform the rest of the configuration using the guide which is available for download from the following link Make sure that you followed the steps under the topic 'Setup Via CLI' only. We will configure the rest of the Controller setup via CLI latter in this blog.


5.) Once the initial setup is done via CLI. It's time to check whether the Meru WebUI is working. Connect the web interface of your controller via the IP address you configured during the setup i.e https://ipaddress Also check whether you are able to connect your controller using an SSH connection. Below screenshot shows the WebUI.































6.)  Install Meru Access Point using the Installation guide which is available for download from the below link. 

B.) Basic Meru Controller and Access Point Configuration

All the configurations are done using CLI. Meru CLI is very similar to Cisco and many of the Cisco commands will work here. If you are comfortable with Cisco routers I would recommend you use CLI for configuration. Also some CLI commands does not have a WebUI alternative. So in some point of time you will have to use CLI.

Like Cisco CLI, Meru have got different command modes - User EXEC Mode, Privileged EXEC Mode, Global Configuration mode. 

Setting the command history buffer size

Just in case you need to recall the commands you have typed previously, the default size is 10.

I am just setting it as 20. Use the command terminal history size 20 in Privileged EXEC Mode.

Meru Controller File System (CFS)

Using CFS you can manage the controller OS and its configuration files.

Below are the local directories present in a controller:

Images         - Directory where the current image resides
Backup         - Contain backup configuration
ATS/scripts  - Contain AP bootup scripts
Capture        - Contain the packet capture files

Some useful commands

Show current directory - pwd

List files inside directory - dir

Change to another directory - cd ATS/scripts

Configuration Files

Similar to Cisco router, Controller have got startup configuration and running configuration.

The command copy running-config startup-config (to save running config to startup config) is also applicable here.

Copy files to and from the Controller

In some situations you might need to transfer files to the controller or backup files from the controller. You can use the following protocols to do the same: FTP, SFTP, TFTP, SCP

If the server from/to which you perform the file transfer is using a password then you can globally set the username and passwod using the below command:

ip ftp user-name myusername

Ip ftp password mypassword

Replace ftp with sftp, scp according to the server you are using.

Copy files from Controller to FTP, TFTP, SFTP and SCP server

For example, to copy a file script.log from the local directory of the controller to a remote FTP server. The server IP is 192.168.1.100 and its remote directory is backup. The username of the server is administrator. (If you have set the credentials earlier using the ip ftp username/password command, use the second command to copy)

1.  Copy script.log ftp://administrator@192.168.1.100/backup/

2. Copy script.log ftp://192.168.1.100

Here replace ftp with scp, sftp, tftp etc.

Copy files to Controller from a remote server

Copy ftp://192.168.1.100/script.log .

Summary of the File System Commands

Show flash - Displays the version of the image files contained in the controller's  flash memory.

More running-config - Same as that of running-config. But there is a difference. Try to figure out the difference ;-)

Reload ap [id] | all | controller | default - To reload ap, controller or all.

[CAUTION :- The keyword default will reboot all Aps' and Controllers at the factory default startup configuration.]

Licensing

The following commands will display information about the license :

show license
show controller
show license-file active

To import a license file from ftp/sftp/tftp use the following command in global configuration mode:

License ftp://192.168.1.100/license3411.lic active

Configuring DHCP server in Controller 

You can configure DHCP server in Controller itself so that you might not want to rely on external DHCP servers to server the client devices. This is basically done in small environments. Deploying Controller based DHCP server in large environment may increase the Controller load.

In a controller you can configure multiple DHCP servers for different VLANs' in your network. You can map each VLAN with DHCP server.

Important : DHCP Relay Pass-through MUST be enabled for a Controller based DHCP to work. To enable DHCP Relay Passthrough globally, use the below command in global configuration mode:

ip dhcp-passthrough

To enable DHCP pass-through for a VLAN:

(config)#  vlan  TestVLAN tag  200
(config-vlan)# no  ip  dhcp-passthrough

Use the below code to configure DHCP server. Here I have tagged the DHCP server to vlan 'TestVLAN':

(config)# dhcp-server DHCP1
(config-dhcp-server)# enable
(config-dhcp-server)# vlan name TestVLAN
(config-dhcp-server)# lease-time 3600
(config-dhcp-server)#  ip-pool 192.168.1.10 192.168.1.100
(config-dhcp-server)# domain-name tony.com
(config-dhcp-server)# dns-server-primary 192.168.1.5
(config-dhcp-server)# dns-server-secondary 192.168.1.4
(config-dhcp-server)# enable

More options can be configured like below:


















 
Republishing with a notification : Product discontinued hence this post is not relevant anymore..