3 Replies Latest reply on Sep 24, 2014 11:18 AM by whitemice

    Can't get vim_service - the session object is uninitialized

    whitemice Novice

      Migrating from a much older VMware cluster to an ESX5.1, and I have a VMA host in the new cluster vMA 5.1.0 BUILD-1062361.  Hypervisor hosts in the new cluster have been added to vMA and it appears to work.

       

      I can:

      vifptarget -s esx03301.micore.us

      vicfg-cfgbackup -s esx03301.micore.us.cfg

      vicfg-nics -l --vihost  esx03301.micore.us

      etc...

       

      I have updates the version checks in ghettoVCBg2.pl and the script run, and makes a snapshot, but the backup fails.

      vi-admin@localhost:~/ghettoVCBg2> ./ghettoVCBg2.pl --config ghettoVCBg2-config1 --dryrun --server esx03301.micore.us --vmlist esx03301.vmlist --output ghettoVCBg2.log

      Can't get vim_service - the session object is uninitialized or not logged in at /usr/lib/perl5/5.10.0/VMware/VICommon.pm line 1654

      Perl exited with active threads:

          1 running and unjoined

          0 finished and unjoined

          0 running and detached

       

      Any hints?

        • 1. Re: Can't get vim_service - the session object is uninitialized
          whitemice Novice

          I suppose the error makes sense, if I look in the log file I see it using defaults -

              09-23-2014 12:02:23 --  debug: copyTask: waiting for next job and sleep ...

           

              09-23-2014 12:02:23 --  info: CONFIG - BACKUP_LOG_OUTPUT = ghettoVCBg2.log

           

              09-23-2014 12:02:23 --  info: CONFIG - VM_BACKUP_DATASTORE = esx4-1-local-storage-1

           

              09-23-2014 12:02:23 --  info: CONFIG - VM_BACKUP_DIRECTORY = WILLIAM_BACKUPS

           

              09-23-2014 12:02:23 --  info: CONFIG - DISK_BACKUP_FORMAT = thin

           

              09-23-2014 12:02:23 --  info: CONFIG - ADAPTER_FORMAT = buslogic

           

              09-23-2014 12:02:23 --  info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = NO

           

              09-23-2014 12:02:23 --  info: CONFIG - VM_SNAPSHOT_MEMORY = NO

           

              09-23-2014 12:02:23 --  info: CONFIG - VM_SNAPSHOT_QUIESCE = NO

           

              09-23-2014 12:02:23 --  info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2014-09-23

           

              09-23-2014 12:02:23 --  info: CONFIG - VM_VMDK_FILES = all

          - which is not what I have in ghettoVCBg2-config1 -

          VM_BACKUP_DATASTORE = "Cornice-Blue"

          VM_BACKUP_DIRECTORY = "ghetto

          VM_BACKUP_ROTATION_COUNT = "3"

          DISK_BACKUP_FORMAT = "zeroedthick"

          ADAPTER_FORMAT = "buslogic"

          POWER_VM_DOWN_BEFORE_BACKUP = "0"

          VM_SNAPSHOT_MEMORY = "0"

          VM_SNAPSHOT_QUIESCE = "0"

          LOG_LEVEL = "debug"

          VM_VMDK_FILES = "all"

          Hmmm.

          • 2. Re: Can't get vim_service - the session object is uninitialized
            whitemice Novice

            Fixed the configuration issue - different config syntax than before.  But it still fails with the same error:

             

            ...

            09-24-2014 06:35:35 --  info: Initiate backup for Cornice-Green found on redwing.micore.us

            09-24-2014 06:35:39 --  debug: Cornice-Green original powerState: poweredOn

            09-24-2014 06:35:39 --  debug: Creating Snapshot "ghettoVCBg2-snapshot-2014-09-24" for Cornice-Green

            09-24-2014 06:35:49 --  info: Cornice-Green has 2 VMDK(s)

            09-24-2014 06:35:49 --  debug: backupVMDK: Backing up "[FC-VMWareESX01] Cornice-Green/Cornice-Green.vmdk" to "[Cornice-Blue] ghetto/Cornice-Green/Cornice-Green-2014-09-24/Cornice-Green.vmdk"

            09-24-2014 06:35:49 --  debug: backupVMDK: Signal copyThread to start

            09-24-2014 06:35:49 --  debug: copyTask: Wake up and follow the white rabbit, with status: doCopy

            09-24-2014 06:35:49 --  debug: CopyThread: Start backing up VMDK(s) ...

            09-24-2014 06:35:49 --  debug: backupVMDK: Backup progress: Elapsed time 0 min

            09-24-2014 06:35:50 --  debug: copyTask: send copySuccess message ...

            09-24-2014 06:35:50 --  debug: copyTask: waiting for next job and sleep ...

            09-24-2014 06:36:49 --  debug: backupVMDK: Successfully completed backup for [FC-VMWareESX01] Cornice-Green/Cornice-Green.vmdk Elapsed time: 1 min

            09-24-2014 06:36:53 --  debug: Removing Snapshot "ghettoVCBg2-snapshot-2014-09-24" for Cornice-Green

            09-24-2014 06:36:54 --  debug: checkVMBackupRotation: Starting ...

            09-24-2014 06:36:54 --  debug: Unable to purge [Cornice-Blue] ghetto/Cornice-Green/Error: Can not list directory '[Cornice-Blue] ghettoCornice-Green'. due to rotation max

            The line Can not list directory '[Cornice-Blue] ghettoCornice-Green'. due to rotation max seems odd.  Is it having trouble accessing that data store?

            • 3. Re: Can't get vim_service - the session object is uninitialized
              whitemice Novice

              I commented out the section of code call for rotation. Now it runs without error.

              #####################

              # CHECK ROTATION

              #####################

              # &checkVMBackupRotation($vm_view,"[$VM_BACKUP_DATASTORE] $VM_BACKUP_DIRECTORY/$vm_name","[$VM_BACKUP_DATASTORE] $VM_BACKUP_DIRECTORY/$vm_name/$vm_name\-$VM_BACKUP_DIR_NAMING_CONVENTION",$vm_name,$vmx_file);

              &log("info", "Rotation disabled by code modification.\n");

              Only, it doesn't do anything.  I creates no files in the backup data store.  It runs, creates the snapshot, drops the snapshot, and reports success.  And nothing wrote the the backup datastore.  Modification times on the folders remain unchanged.  There are no error messages anywhere.