Showing posts with label vmware. Show all posts
Showing posts with label vmware. Show all posts

Friday, April 15, 2022

How to configure SSL in vCenter 6.7

First take vCenter VM snapshot for backup purpose.

Take note of host where the vCenter VM resides while starting the activity.

Take Access of vCenter Shell to create a certificate CSR request.

root@prod-vcsa71 [ ~ ]# /usr/lib/vmware-vmca/bin/certificate-manager

Now copy the CSR file content in notepad file and save as .txt or .csr

Once have the CSR, generate a certificate by using this CSR.



Now copy the certificate file to the vcenter along with the RootCA certificate.


Start process for Import the certificate.

root@prod-vcsa71 [ ~ ]# /usr/lib/vmware-vmca/bin/certificate-manager



Provide certificate file location as per below the snip, Once all details provided it will take around 20-30 mins depending on the vCenter performance.



Once all required services started properly it will give the status as mentioned below.



Now try to access the vCenter from WebGUI, It is now secure.



Also try to access the vCenter Appliance Management Interface, It will still show the certificate error, to resolve this, restart the vami https service as mentioned below.



root@prod-vcsa71 [ /opt ]# /sbin/service vami-lighttpd restart



Now again try to access the vCenter Appliance Management Interface, It will also start with SSL certificate.




To check service status: 

root@prodvcenter [ ~ ]# service-control --status --all

To check logs if anything fails.

root@prodvcenter [ ~ ]# tail -f /var/log/vmware/vmcad/certificate-manager.log

If Certificate import files due to content-library service fails to start, increase Start time in below mentioned file from 300 to 600sec.

root@prodvcenter [ ~ ]# vi /etc/vmware/vmware-vmon/svcCfgfiles/vdcs.json




Sunday, May 27, 2018

VMware script to get CPU core details.

Save the given file in machine and give extension ".ps1"

$myCol = @()
Foreach ($cluster in Get-Cluster)
    {
        Foreach($vmhost in ($cluster | Get-VMHost))
        {
            Foreach($vm in (Get-VM -Location $vmhost)){
                $VMView = $vm | Get-View
                $VMSummary = "" | Select ClusterName,HostName,VMName,VMSockets,VMCores,CPUSockets,CPUCores
                $VMSummary.ClusterName = $cluster.Name
                $VMSummary.HostName = $vmhost.Name
                $VMSummary.VMName = $vm.Name
                $VMSummary.VMSockets = $VMView.Config.Hardware.NumCpu
                $VMSummary.VMCores = $VMView.Config.Hardware.NumCoresPerSocket
                $VMSummary.CPUSockets = $vmhost.ExtensionData.Hardware.CpuInfo.NumCpuPackages
                $VMSummary.CPUCores = $vmhost.ExtensionData.Hardware.CpuInfo.NumCpuCores
                $myCol += $VMSummary
            }
        }
    }
$myCol | Export-csv reports.csv

Now connect vcenter using vmware powercli and execute the script.


Another method to get done this is follow below mentioned file save and execute the same to get the data.


Don't forget to change the given lines with your scenario.



  • $vcenter = vc01.vcdx56.com
  • $vcenteruser = vcdx56\magnus”
  • $vcenterpw = “not secret”
  • $reportdir = c:\vSpherereport
  • $filename = c:\vSphere$date.html
  • $basefile = c:\vSpherereportCPU-oversubscription.html

 # The script will calculate the ESXi host CPU core to VM vCPU oversubscription and create a HTML report

#
# Version 1.0 Magnus Andersson RTS
#————————————————
# Start of script parameters section
#
# vCenter Server configuration
$vcenter = “vcenter-ip-address“
$vcenteruser = “Administrator@vsphere.local“
$vcenterpw = "password"
#
$date=get-date -uformat %Y-%m-%d
#
# Define report directory
$reportdir = "c:\temp\vSpherereport"
#
# Define file name
$filename = "c:\temp\vSphere$date.html"
#
# Define base file
$basefile = "c:\temp\vSpherereportCPU-oversubscription.html"
#
# End of script parameter section
#—————————————— #
#
# Connect to vCenter Server
connect-viserver $vcenter -User $vcenteruser -Password $vcenterpw
#
function Get-Cluster-CPUMem {
$table = @()
foreach($clust in (get-cluster | Sort-Object Name)) {
$esx = $clust | Get-VMHost
$clu = "" | select Cluster, "ESXi host num CPU core", "VM vCPU", "VM vCPU on", "Percent of vCPU on"
$vms = $clust | get-vm
$clu.Cluster = $clust.Name
$clu."ESXi host num CPU core" = ($clust | Get-vmhost | Measure-Object -Sum NumCPU).Sum
$clu."VM vCPU" = ($vms | Measure-Object -Sum NumCPU).Sum
$clu."VM vCPU on" = ($vms | ?{$_.PowerState -eq "PoweredOn"} | Measure-Object -Sum NumCPU).Sum
$clu."Percent of vCPU on" = "{0:P0}" -f ($clu."VM vCPU on" / $clu."ESXi host num CPU core")
$table += $clu
}
$clu = "" | select Cluster, "ESXi host num CPU core", "VM vCPU", "VM vCPU on", "Percent of vCPU on"
$clu.Cluster = "Total"
$clu."ESXi host num CPU core" = ($table | Measure-Object -property "ESXi host num CPU core" -sum).sum
$clu."VM vCPU" = ($table | Measure-Object -property "VM vCPU" -sum).sum
$clu."VM vCPU on" = ($table | Measure-Object -property "VM vCPU on" -sum).sum
$clu."Percent of vCPU on" = "{0:P0}" -f ($clu."VM vCPU on" / $clu."ESXi host num CPU core")
$table += $clu
$table
}
$a = "<style>"
$a = $a + "BODY{background-color:white;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 4px;border-style: solid;border-color: black;}"
$a = $a + "TD{border-width: 1px;padding: 4px;border-style: solid;border-color: black;text-align:center;}"
$a = $a + "</style>"
Get-Cluster-CPUMem | ConvertTo-HTML -head $a -Title "CPU oversubscription report $date" | Out-File $filename
Remove-Item $basefile
Copy-Item $filename $basefile
if ($filename -like "*-01.*") {
Copy-Item $filename $reportdir
}
Remove-item $filename

Wednesday, May 2, 2018

VMWare useful definations

Standard Edition: 1 vcenter server in standard license, Up to 2vCPU for FT, vMotion, Storage vMotion, HA, VVols etc.

Enterprise Edition: Same as Standard edition, additionally API's for Array Integration and multipathing DRS and DPM.

Enterprise Plus: Includes all features of Standard and Enterprise with additionally FT upto 4vCPU and 64GB RAM includes distributed vSwitch.

=> Max RAM support in vsphere 6.0 is 12TB

=> To move powered off VM from one host to another is called cold migration. 

=> To move powered on VM from one host to another is called vMotion.

=> Single cluster can manage max 8000 VMs

=> Single cluster can manage max 64 hosts in vsphere 6.0

=> Min 3 Esxi Hosts/Servers in the form of vSAN cluster require. If one of server fails vSAN cluster will fail.

=> Max 64 hosts are allowed to configure a vsan cluster.

=> A Host which has highest numbers of datastores mounted will be selected as a master host.

=> .vmx - Configuration file for a virtual machine

=> .nvram - BIOS related info of Virtual Machine

=> .vmdk - Virtual Machine Disk file and stores data of a Virtual Machine it can be up to 62TB in 6.0

=> vDS (Virtual Distributed Switch) 

Single switch in whole virtual environment  and is responsible to provide central provisioning administration and monitoring of virtual network.

=> VSS (Virtual Standard Switch)

For communication of virtual machines hosted on a single physical host.
- It works like a physical switch automatically detects a VM's which want to communicate with other VM on a same physical server.

=> VVol - (Virtual Volume)

- A new disk management concept introduced in vsphere 6.0 that enables array based operations at the virtual disk level. VVol is automatically  created when virtual disk is created in virtual environment for virtual machine.

=> vSAN (Virtual SAN)

- (I) Hybrid
- Uses both flash-based and magnatic disks for storage, Flash are used for caching while magnatic disks are used for capacity or storage.

- (II) All-Flash
- Uses flash for both caching and for storage.


=> VMKernal adapter

- VMKernel adapter provides network connectivity to the ESXi host to handle network traffic for vMotion, IP Storage, NAS, Fault Tolerance, and vSAN. For each type of traffic such as vMotion, vSAN etc. separate VMKernal adapter should be created and configured.
=> port groups
You can segregate the network traffic by using port groups such as vMotion, FT, management traffic etc.
- Virtual Machine Port Group – Used for Virtual Machine Network
- Service Console Port Group – Used for Service Console Communications
- VMKernel Port Group – Used for VMotion, iSCSI, NFS Communications
=> Hypervisor -

- Hypervisor is a virtualization layer that enables multiple operating systems to share a single hardware host.  Each operating system or VM is allocated physical resources such as memory, CPU, storage etc by the host. There are two types of hypervisors.

- Hosted hypervisor (works as application i-e VMware Workstation)

- Bare-metal (is virtualization software i-e VMvisor, hyper-V which is installed directly onto the hardware and controls all physical resources).

=> VMware HA and FT

- Main difference between VMware HA and FT is: HA is enabled per cluster and VMware FT is enabled per VM. In HA, VMs will be re-started and powered-on on another host in case of host failure, while in FT there is no downtime, because second copy will be activated in case of host failure.
=> Disk Types

- There are three disk types in vSphere.

- Thick Provisioned Lazy Zeroes: every virtual disk is created by default in this disk format. Physical space is allocated to a VM when virtual disk is created. It can’t be converted to thin disk.

- Thick Provision Eager Zeroes: this disk type is used in VMware Fault Tolerance. All required disk space is allocated to a VM at time of creation. It takes more time to create a virtual disk compare to other disk formats.

- Thin provision: It provides on-demand allocation of disk space to a VM. When data size grows, the size of disk will grow. Storage capacity utilization can be up to 100% with thin provisioning.

=> VMware DRS

- DRS stands for Distributed Resource Scheduler; that automatically balances available resources among various hosts by using cluster or resource pools. With the help of HA, DRS can move VMs from one host to another to balance the available resources among VMs.

=> VMware Template

- When a VM is converted into a format which can be used to create a VM with pre-defined settings is called a template. An installed VM can be converted into a template but it cannot be powered-on.

=> Snapshot

- To create a copy of a VM with the time stamp as a restore point is called a snapshot. Snapshots are taken when an upgrade or software installation is required. For better performance, a snapshot should be removed after particular task is performed.

=> How to convert a physical machine into a VM?

- Three steps are required to convert a physical machine to a VM:
- An agent needs to be installed on the Physical machine
- VI client needs to be installed with Converter Plug-in
- A server to import/export virtual machines

=> What monitoring method is used in vSphere HA?

- Network Hearbeat
- Datastore Heartbeat

=> How master host is elected in vSphere HA?

- When HA is enabled in a cluster, all hosts take part in selection process to be selected as a master host. A host which has highest number of datastores mounted, will be selected as a master host. All other hosts will remain slave hosts.

=> VMware Tools

- It is a suite of utilities which are used to enhance performance of a VM in the form of graphics, mouse/keyboard movement, network card and other peripheral devices.


=> ESXi Shell

- It is a command-line interface is used to run repair and diagnostics of ESXi hosts. It can be accessed via DCUI, vCenter Server enable/disable, and via SSH.


Thursday, April 19, 2018

[Solved] Unable To Import OVA due to ISO mounted VM exported

1.  Uncompress the OVA file to local drive.
      
      2. Open the OVF file (i.e.: gc2nfe-clone.ovf) in notepad. This file contains all the configuration information to deploy the virtual machine.

      

 3. In the gc2nfe-clone.ovf file, Search for “vmware.cdrom.iso” and replace it with “vmware.cdrom.remotepassthrough”.













4.       Save the gc2nfe-clone.ovf file.

5.       Now move the .mf file to any other location.


        

       6.       Now import vm as OVF.