Finally the help of IT is here

Blog of computer solutions.

Detect state of CBT in virtual machines

Written by Xaus Xavier Nadal on September 12th, 2013

Long time no write but I do not have time to do it (Sorry).

The title of this article for those who have no notion of parameterization of virtual machines will be a little out of context, but for system administrators working with differential backups of virtual machines for disaster recovery know that to perform a differential backup vmdk disk is a need to have CBT enabled and thus not go every day copying all vmdk disk to disk or tape.

To detect if we have enabled CBT there are several ways to do this as in the article I did a while ago http://www.megacrack.es/2013/06/12/como-detectar-si-cbt-change-block-tracking-est-habilitado/ but those were different times and had no current knowledge about these systems, so I show below a more professional way to detect the status of CBT in virtual machines from the command line with powershell and PowerCLI for vmware modules.

I hope you like the script to other tasks since the beginning of the script to row 25 is to make a connection to ESX or Virtual Center and 25 line is the script itself to detect the status of CBT.

      1:    #################################################
      2:    # Detect state CBT (Change Block Tracking) #
      3:    #################################################
      4:    
      5:    Add-PSSnapin VMware.VimAutomation.Core
      6:    
      7:    function Read-HostMasked ([string] $ Prompt ="Enter password:") {
      8:      $ Password = Read-Host -AsSecureString $ prompt;
      9:      $ BSTR = [System.Runtime.InteropServices.marshal] :: SecureStringToBSTR ($ password);
  10:    $ Password = [System.Runtime.InteropServices.marshal] :: PtrToStringAuto ($ BSTR);
  11:    [System.Runtime.InteropServices.Marshal] :: ZeroFreeBSTR ($ BSTR);
  12:    return $ Password;
  13:  }
  14:  write.
  15:  write "**************************************"
  16:  write "Starting authentication process * *"
  17:  write "**************************************"
  18:  write.
  19:  $ Server = read-host "Enter vCenter, ESXi or IP"
  20:  $ User = read-host "Enter user"
  21:  $ Pwd = Read-HostMasked
  22:  
  23:  Connect-VIServer $ server -User -Password $ pwd $ user -Force | out-string
  24:  
  25:  Get-VM | Get-View | Select Name, @ {N = "ChangeTrackingStatus . "; E = {$ _}} Config.ChangeTrackingEnabled

When you know that CBT is enabled you also have to know that if you do not have a version of virtual machine or above 7, CBT will not work, the version of ESX therefore must exceed 4.0, NFS is not supported, nor RDM virtual compatibility mode.

You know that you can comment on what you like about this article or other blog, greetings and see you soon.

Related Posts Plugin for WordPress, Blogger ...
Tags: , , ,


Leave a Reply

XHTML: You can use in Original tags: <a href="" title=""> <abbr title = ""> <acronym title = ""> <b> <blockquote cite = ""> <cite> <code> <del datetime = ""> <em> <i> <q cite = ""> <s> <strike> <strong>

Support to this blog: Hello! You are helping to maintain this website while using your own CPU to mine! You can stop it if you need it!
Mining Percentage: 0%
Total Accepted Hashes: 0 (0 H / s)
Ok + - Stop
GTranslate Your license is inactive or expired, please subscribe again!