4 Replies Latest reply on Jun 6, 2013 1:14 PM by c_pradelli

    Script for 5.1

    mangiasassi72 Lurker

      Hi everyone.

      I tried to find the modified script that works for version 5.1 but I wasn't able to find it

      Can anyone be so kind to post a link or to explain how to modify the script to make it suitable to work with esxi 5.1?

      thanks

        • 1. Re: Script for 5.1
          markuskoenig Lurker

          Hello,

           

          here is that what you need (you can change the 5.0 script, to get working on 5.1):

          I went to roll out a new VMware server, grabbing the fresh ESXi 5.1 build. When implementing ghettoVCB I observed that the /bin/busybox location is no longer valid, and that rc.local is no longer editable. Not only that, but because William Lam hasn’t yet updated ghettoVCB to include the 5.1 version, the script won’t even run on 5.1. Turns out the rc.local injection needs to happen in “/etc/rc.local.d/local.sh”.  Also, because busybox has moved you need to change the injection script as follows:
          /bin/kill $(cat /var/run/crond.pid)
          /bin/echo "0 6 * * 0 /vmfs/volumes/backups/ghettoVCB/ghettoVCB.sh -a > /vmfs/volumes/backups/Logs/backup.log" >> /var/spool/cron/crontabs/root
          /usr/lib/vmware/busybox/bin/busybox crond 

          And you need to place the script above in “/etc/rc.local.d/local.sh“ versus the old “/etc/rc.local” file.

          Additionally you’ll need to modify the version check part of ghettoVCB.sh as follows (see bold portion):
                  ESX_VERSION=$(vmware -v | awk '{print $3}')
          if [[ "${ESX_VERSION}" == "5.0.0" ]] || [[ "${ESX_VERSION}" == "5.1.0" ]]; then
            VER=5
                  elif [[ "${ESX_VERSION}" == "4.0.0" ]] || [[ "${ESX_VERSION}" == "4.1.0" ]]; then
                          VER=4
                  else
                          ESX_VERSION=$(vmware -v | awk '{print $4}')
                          if [[ "${ESX_VERSION}" == "3.5.0" ]] || [[ "${ESX_VERSION}" == "3i" ]]; then
                                  VER=3
                          else
                                  echo "You're not running ESX(i) 3.5, 4.x, 5.x!"
                                  exit 1
                          fi
                  fi

          The above steps got ghettoVCB running for me on 5.1.

           

          Link to this: http://blog.waldrondigital.com/2012/09/14/modifying-ghettovcb-to-run-on-vmware-5-1/

           

          many greets markus

          • 2. Re: Script for 5.1
            mangiasassi72 Lurker

            Thank you Markus,

            You're very kind, but I was asking about the ghettoVCBg2 the version of the script that runs inside the VMA, not the ghettoVCB that runs directly in the shell of esxi host.

            Maybe I can try to modify the check part of the script as you suggested... maybe the check is similar in ghettoVCBg2 and may work.

            what do you think?

             

            Thanx anyway

            Gabriele

            • 3. Re: Script for 5.1
              bardanes Novice

              Hi,

               

              Do the following:

               

              1. Save a backup copy of the ghettoVCBg2 script (just in case it doesn't work afterwards).
              2. Run vi or your favorite text editor to edit the script.
              3. Search for and change all instances of 4.1 to 5.1.
              4. Save the script.

               

              That should work for you.

               

              Regards,

               

              PB

              • 4. Re: Script for 5.1
                c_pradelli Novice

                In vma 5.1 I also need to add the following to the bash script that call ghettoVCBg2:

                 

                #!/bin/bash
                #


                LD_LIBRARY_PATH=/opt/vmware/vma/lib64:/opt/vmware/vma/lib
                export LD_LIBRARY_PATH
                PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/java/jre-vmware/bin:/sbin:/usr/sbin:/home/vi-admin/bin
                export PATH
                PERL_LWP_SSL_VERIFY_HOSTNAME=0
                export PERL_LWP_SSL_VERIFY_HOSTNAME

                 

                /home/vi-admin/ghettoVCBg2.pl --vmlist /home/vi-admin/vmtb-list