lunedì 9 marzo 2020

VMs Memory information

Problem
I need a fast way to check the Memory usage of the last 30 days to understand if there are more RAMs than needed in the VMs.

Solution
Below a very simple PowerCLI script that will return information about Minimum, Maximum and Avarage Memory of the last 30 days.
First of all, after you have opened a powershell terminal (doesn't mind if Windows/Linux/MacOS), you need to connect to the vCenter Server, providing a proper User and Password:

Connect-VIServer -Server “IP/hostname/FQDN”
Once connected you can execute the following command:

$Report = @()
foreach ($VM in Get-VM) {
  $vmstat=@{}
 $vmstat.VMname = $vm.Name     
 $statmem = Get-Stat -Entity ($vm)-start (get-date).AddDays(-30) -Finish (get-date).AddDays(-1) -MaxSamples 10000 -stat mem.usage.average
 $mem = $statmem | Measure-Object -Property value -Average -Maximum -Minimum
 $vmstat.MemMax = [math]::round($mem.Maximum,2)
 $vmstat.MemAvg = [math]::round($mem.Average,2)
 $vmstat.MemMin = [math]::round($mem.Minimum,2)
 $temp = New-Object -TypeName PSObject -Property $vmstat
    $Report += $temp
} 
$Report | Select VMname, MemMax, MemAvg, MemMin | Format-Table -AutoSize 



That's it.

venerdì 6 marzo 2020

VEEAM - Configure a NAS backup Job

New capabilities that redefine NAS data protection to deal with the world of massive file data, have been released with the new veeam v10 version.
Below I will covering step by step how to setup and configure on Veeam 10 to backup file from a NAS file share.
First of all let's see the official documentation available here, to understand which components must be present or added to the backup infrastructure and to understand "How File Share Backup Works".

Before to begin to adding an SMB file share to the inventory of the virtual infrastructure is possible to check prerequisites, limitations and the official procedures here.

To add an SMB file share, once opened Veeam Backup and Replication console proceed as follows:
  • Open the Inventory view.

    Click on File Shares and then ADD FILE SHARE.



  • Click SMB share (in my case I have a NAS that run a CIFS service)



  • In the Shared folder field, specify the path to an SMB file share in the \\server\folder format.

    Select the This share requires access credentials check box and provide proper credentials to get full access control to shared folder.



  • Clicking on Advanced the window shows several options.

    Leave the enabled the default option "Backup directly from the file share" clicking on OK and then click Next >.



  • Click Choose... next to the File proxy field to select a file proxy.

    From the Cache repository drop-down list, select a cache repository where temporary cache files must be stored.

    Use the Backup I/O control slider to define how fast all proxies can read data from the source file share.

    Click Apply to save the configured settings.



  • Wait while required components are installed and configured, then click Next>.



  • At the Summary step, reviewed the configuration, click Finish to finalize the setup and exit the wizard.



In the following steps we will see how to set up a backup job of the NAS file share content.

  • Open the Inventory view.

    Right click on SMB file share select Add to backup job and then click on New job...



  • In the Name field, specify the name of the backup job and click Next >.



  • Select File or folder and click Add...



  • Explore Folders, select which ones you prefer and click OK.



  • In Advanced is possible to create extension masks to Include or Exclude files.



  • Select the desired Backup repository.

    Use the Keep all file versions for the last field to define short-term retention policy: specify how long copies of all recent file versions must be kept in the short-term backup repository.

    Click Next >.



  • Add a Secondary Target otherwise click Next >.



  • Schedule the job to run automatically.



  • Review details and click Finish.



  • The job run as expected.




That's it.


Further info: v10: Seriously Powerful NAS Backup at Scale

mercoledì 4 marzo 2020

Personal goals for 2020 about the Blog.

In this year 2020 my personal goals regarding the evolution of the blog (born as a personal collection point of information, scripts, issues, daily problems that have happened to me, how I have solved them and so on, to be shared with users of the web) is obviously to continue writing on VMware but also, to posts some articles on two brands with which I work daily (or almost) like Pure Storage and Veeam.




We will see next year if I succeeded in my intent ... :)

martedì 3 marzo 2020

VM Hardware and Tools Status,Version

Problem
I need to check and compare for each Virtual Machine the version of the Virtual Hardware, the Status and the Version of the VMware Tools.

Solution
The easiest way I've found is to make some a simple script like the following via PowerCLI.

$Report = @()
foreach ($VM in Get-VM) {
  $vmHW=@{} 
 $temp = Get-View $VM |  Select Name, @{N="HWVersion";E={$_.Config.version}},  @{N='VMwareToosStatus';E={$_.Guest.ToolsStatus}}, @{N="VMwareToolsVersion";E={$_.Config.Tools.ToolsVersion}}
 $vmHW.VMname = $temp.Name
 $vmHW.HWVersion = $temp.HWVersion
 $vmHW.VMwareToosStatus = $temp.VMwareToosStatus
 $vmHW.VMwareToolsVersion = $temp.VMwareToolsVersion
 $tempNObject = New-Object -TypeName PSObject -Property $vmHW
    $Report += $tempNObject
} 
$Report | Select @{N="VM Name";E={$_.VMname}}, @{N="HW Version";E={$_.HWVersion}},  @{N='VMware Tools Status';E={$_.VMwareToosStatus}}, @{N="VMware Tools version";E={$_.VMwareToolsVersion}}  | Sort-Object -Unique "VM Name" | Format-Table -AutoSize 



That's it.

lunedì 10 febbraio 2020

NSX-V Manager stuck on boot

Problem
NSX-V Manager (version 6.4.4) is stuck on boot due an unexpected inconsistency of the filesystem.

/dev/sda2: UNEXPECTED INCONSISTENCY: RUN fsck MANUALLY.
              (i.e., without -a or -p options)


FAILURE:

File system errors were encountered that could not be fixed automatically. This system cannot continue to boot and will therefore be halted until those errors are fixed manually by a System Administrator.

After you press Enter. this system will be halted and powered off.



Solution

Disclaimer: Some of the procedures described below is not officially supported by VMware. Use it at your own risk.

What I suggest to solve the issue is to try to perform a FIX of the disk, following the steps described below:
  1. First thing before to start you must have a valid backup
  2. Turn off the NSX Manager VM
  3. Perform a cold snapshot
  4. Start NSX Manager VM via a Live linux CD
  5. Then open a Terminal Console, become root and execute the commands ->
    # umount /dev/sda2
    # fsck -y /dev/sda2
  6. Then reboot normally.
If it still does not work I suggest to deploy a new OVA and restore data from backup.

That's it

venerdì 7 febbraio 2020

VCSA Upgrade - Fatal error during network preservation

Problem
Upgrading a vCSA 6.0 U3 to 6.5 U3 received in stage 2 at 50% of progress bar a "fatal error"

Error: Fatal error during network preservation



Solution
To solve the issue is enough to perform below steps and re initiate the upgrade process,
  1. Login to https://<vCenterServer_FQDN>:5480 vami page

  2. Navigate to Networking and enable IPV6 settings.

  3. Select the NIC and IPv6 Settings and Select the below option:
    "Obtain IPv6 automatically through DHCP"

That's it

Certification Upgrade Policy Update

Certification Upgrade Policy Update
VMware has released new recertification policies to keep updated its own certification to the last level 2020. Information are available on the VMware blog at the following link.

Good news for those who have the certification updated to 2019 (either VCP or VCAP) they can simply complete a qualifying course or if they prefer pass the qualifying exam to upgrade.


To learn more, visit www.vmware.com/certification.

Information and images in this article are property of VMware.