This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Showing posts with label VMware. Show all posts
Showing posts with label VMware. Show all posts

Thursday, October 19, 2017

How to Power on a virtual machine from the command line?

Thursday, October 19, 2017 0
ESXi 4.x, 5.x and 6.0

To power on a virtual machine from the command line:

    List the inventory ID of the virtual machine with the command:

    vim-cmd vmsvc/getallvms |grep <vm name>Note: The first column of the output shows the vmid.   

    Check the power state of the virtual machine with the command:

    vim-cmd vmsvc/power.getstate <vmid>   

    Power-on the virtual machine with the command:

    vim-cmd vmsvc/power.on <vmid>


ESX 4.0 and ESX 4.1

To power on a virtual machine from the command line:

    To list the path of all the virtual machines on the host:

    vmware-cmd -l   

    Get the state of the virtual machine with the command:

    vmware-cmd <path to the VMX file> getstate

    Power on the virtual machine with the command:

    vmware-cmd <path to the VMX file> start

ESXi 3.5

To power on a virtual machine from the command line:

    List the inventory ID of the virtual machine with the command:

    vim-cmd vmsvc/getallvms |grep <vm name>

    Check the power state of the virtual machine with the command:

    vim-cmd vmsvc/power.getstate <vmid>

    Power on the virtual machine with the command:

    vim-cmd vmsvc/power.on <vmid>

ESX 3.5
To power on a virtual machine from the command line:

    To list the path of all the virtual machines on the host:

    vmware-cmd -l

    Get the state of the virtual machine with the command:

    vmware-cmd <path to the VMX file> getstate

    Power on the virtual machine with the command:

    vmware-cmd <path to the VMX file> start

Wednesday, October 18, 2017

How to solve "Cannot vMotion virtual machines with physical mode RDM"

Wednesday, October 18, 2017 0

1.  Open the vSphere PowerCLI command-line.

2.  Run the command:

Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl

This command produces a list of virtual machines with RDMs, along with the backing SCSI device for the RDMs.

    An output looks similar to:

    Parent              Virtual Machine Display Name
    Name                Hard Disk n
    DiskType            RawVirtual
    ScsiCanonicalNamenaa.60123456789abcdef0123456789abcde
    DeviceName            vml.020000000060123456789abcdef0123456789abcde1234567890ab

    If you need to save the output to a file the command can be modified:

Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl | Out-File –FilePath RDM-list.txt
    
  3.  Identify the backing SCSI device from either the ScsiCanonicalName or DeviceName identifiers.

How to Identify Raw Device Mappings (RDMs) using the vSphere Client?

Wednesday, October 18, 2017 0

To identify RDMs using the vSphere Client:

1. Connect to vCenter Server or a host using the vSphere Client.
2. Select a virtual machine in the inventory.
3. Right-click the virtual machine and click Edit Settings.
4. Select each hard disk in the Virtual Hardware list with a summary Mapped Raw LUN. The path to the RDM virtual disk mapping file and the name of the backing SCSI device are listed.

Tuesday, October 17, 2017

How to check the vMotion Count by using PowerCLI

Tuesday, October 17, 2017 0

Below script can help you to get the count of all vMotion events that has happened in the past 24 hrs.

If you want to calculate the count for longer period then change the number AddDays.

Get-VIEvent -Entity (Get-VM -Location $_) -MaxSamples ([int]::MaxValue) -Start (Get-Date).AddDays(-1) |Where { $_.GetType().Name -eq “TaskEvent” -and $_.Info.DescriptionId -eq “VirtualMachine.migrate”} | Measure-Object | Select-Object -ExpandProperty Count

Monday, October 16, 2017

Brief explai about - Modes in esxtop - Vmware

Monday, October 16, 2017 0
ESXTOP

ESXTOP is the utility only for ESX host to examine real-time resource usage for ESX and resxtop for ESX & ESXi hosts.esxtop can only be used for the local ESX machine but resxtop can be used remotely to view the resource utilization of ESX/ESXi hosts from other ESX/ESXi servers or VMA.

There are 3 different types of Modes in esxtop/resxtop

Interactive Mode

Batch Mode

Replay Mode.

Interactive mode (the default mode) – All statistics are displayed  are in real time

Batch mode – Statistics can be collected so that the output can be saved in a file (csv) and can be viewed & analyzed using windows perfmon & other tools in later time.

Replay mode – It is similar to record and replay operation. Data that was collected by the vm-support command is interpreted and played back as esxtop statistics. We can view the captured performance information for a particular duration or time period as like real time to view what was happening during that time. It is perfectly used for the VMware support person to replay the stats to understand what was happening to the server during that time.


Thanks for reading!!!!