Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50773

Pipline script for vSphere ExposeGuestInfo generates <object of type org.jenkinsci.plugins.vsphere.builders.ExposeGuestInfo>. Pipeline DSL ExposeGuestInfo Build fails

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After upgrading vSphere Cloud Plugin from 2.15 to v 2.17

      Pipline script for vSphere ExposeGuestInfo generates:
      vSphere buildStep: <object of type org.jenkinsci.plugins.vsphere.builders.ExposeGuestInfo>, serverName: ''

      Should generate:
      vSphere buildStep: [$class: 'ExposeGuestInfo', envVariablePrefix: 'VSPHERE', vm: 'vmName', waitForIp4: boolean], serverName: ""

       

      When run DSL Pipline with using vSphere build step: "Expose Guest Info" it fails with Error: null.

      #!/usr/bin/env groovy
      pipeline {
          agent any
          stages {
              stage('Expose VM IP') {
                  steps {
                      script{
                          hostIP = vSphere buildStep: [$class: 'ExposeGuestInfo', envVariablePrefix: 'VSPHERE', vm: test.ci.kit], serverName: 'testvcs'
                          echo "$hostIP"
                      }
                  }

              }
          }
          post {
              always {
                  // Clean-up the workspace
                  cleanWs()
              }
          }
      }

       
      Started by user
      vassil
      Running in Durability level: MAX_SURVIVABILITY[Pipeline] nodeRunning on
      slave-u1604-1
      in /opt/riajenk/workspace/Abivahendid/Vassilharjutab/ExposeGuestIP[Pipeline] {[Pipeline] stage[Pipeline] { (Expose VM IP)[Pipeline] script[Pipeline] {[Pipeline] vSphere[vSphere]
      [vSphere] Performing vSphere build step: "Expose Guest Info"
      [vSphere] Attempting to use server configuration: "testvcs"
      [vSphere] Exposing guest info for VM "vassilm-test.ci.kit" as environment variables
      [vSphere] Added environmental variable "VSPHERE_IpAddress" with a value of "10.0.24.55"
      [vSphere] Added environmental variable "VSPHERE_GuestId" with a value of "ubuntu64Guest"
      [vSphere] Added environmental variable "VSPHERE_ToolsVersion" with a value of "2147483647"
      [vSphere] Skipped "Disk" as it is of type class [Lcom.vmware.vim25.GuestDiskInfo;
      [vSphere] Added environmental variable "VSPHERE_AppState" with a value of "none"
      [vSphere] Added environmental variable "VSPHERE_GuestOperationsReady" with a value of "true"
      [vSphere] Added environmental variable "VSPHERE_InteractiveGuestOperationsReady" with a value of "false"
      [vSphere] Added environmental variable "VSPHERE_GuestStateChangeSupported" with a value of "true"
      [vSphere] Skipped "GenerationInfo" as it is of type class [Lcom.vmware.vim25.GuestInfoNamespaceGenerationInfo;
      [vSphere] Added environmental variable "VSPHERE_ToolsVersionStatus2" with a value of "guestToolsUnmanaged"
      [vSphere] Added environmental variable "VSPHERE_ToolsRunningStatus" with a value of "guestToolsRunning"
      [vSphere] Added environmental variable "VSPHERE_GuestFullName" with a value of "Ubuntu Linux (64-bit)"
      [vSphere] Skipped "Net" as it is of type class [Lcom.vmware.vim25.GuestNicInfo;
      [vSphere] Skipped "IpStack" as it is of type class [Lcom.vmware.vim25.GuestStackInfo;
      [vSphere] Skipped "Screen" as it is of type class com.vmware.vim25.GuestScreenInfo
      [vSphere] Added environmental variable "VSPHERE_GuestState" with a value of "running"
      [vSphere] Added environmental variable "VSPHERE_AppHeartbeatStatus" with a value of "appStatusGray"
      [vSphere] Skipped "GuestKernelCrashed" as it is a null value
      [vSphere] Added environmental variable "VSPHERE_ToolsStatus" with a value of "toolsOk"
      [vSphere] Added environmental variable "VSPHERE_ToolsVersionStatus" with a value of "guestToolsUnmanaged"
      [vSphere] Added environmental variable "VSPHERE_GuestFamily" with a value of "linuxGuest"
      [vSphere] Added environmental variable "VSPHERE_HostName" with a value of "vassilm-test"[Pipeline] }[Pipeline] // script[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Declarative: Post Actions)[Pipeline] cleanWs[WS-CLEANUP] Deleting project workspace...[WS-CLEANUP] done[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: null
      Finished: FAILURE

       

        Attachments

          Activity

          Hide
          pjdarton pjdarton added a comment -

          FYI Jason ceased to be the plugin maintainer some time ago, and Eric's involvement on this is equally minimal. They both have day jobs that does not include supporting this plugin (as do I).

          You might get somewhere by looking at the https://wiki.jenkins.io/display/JENKINS/Team+Concert+Plugin page's explanation of how to access their environment variables.  e.g. if you substituted org.jenkinsci.plugins.vsphere.builders.ExposeGuestInfo.VSphereEnvAction for com.ibm.team.build.internal.hjplugin.RTCBuildResultAction
          Neither that plugin nor this one was written with pipeline support in mind, so workarounds for one (or other similarly aged plugins) might well work for others.

          Show
          pjdarton pjdarton added a comment - FYI Jason ceased to be the plugin maintainer some time ago, and Eric's involvement on this is equally minimal. They both have day jobs that does not include supporting this plugin (as do I). You might get somewhere by looking at the https://wiki.jenkins.io/display/JENKINS/Team+Concert+Plugin page's explanation of how to access their environment variables.  e.g. if you substituted org.jenkinsci.plugins.vsphere.builders.ExposeGuestInfo.VSphereEnvAction for com.ibm.team.build.internal.hjplugin.RTCBuildResultAction Neither that plugin nor this one was written with pipeline support in mind, so workarounds for one (or other similarly aged plugins) might well work for others.
          Hide
          vassil vassil marjunits added a comment -

          pjdarton thanx bro, for you effort with advising,
          Is there any way how can I donate for you?

          Show
          vassil vassil marjunits added a comment - pjdarton thanx bro, for you effort with advising, Is there any way how can I donate for you?
          Hide
          nelu Nelu Vasilica added a comment -

          vassil marjunits, did you manage to get this working?

          Show
          nelu Nelu Vasilica added a comment - vassil marjunits , did you manage to get this working?
          Hide
          vassil vassil marjunits added a comment -

          Nelu Vasilica sorry for delay.
          We decided to replace vSphere plugin with VMware SDK Perl toolkit and using Perl script to communicate with vSphere API.
          Why SDK Perl, because its is supported by VMware. https://code.vmware.com/web/sdk/67/vsphere-perl
          There is other SDK toolkit to - python, java.

          Show
          vassil vassil marjunits added a comment - Nelu Vasilica sorry for delay. We decided to replace vSphere plugin with VMware SDK Perl toolkit and using Perl script to communicate with vSphere API. Why SDK Perl, because its is supported by VMware. https://code.vmware.com/web/sdk/67/vsphere-perl There is other SDK toolkit to - python, java.
          Hide
          trunov_ms Max Trunov added a comment -

          def run = currentBuild.build()
          def action = run.getAction(org.jenkinsci.plugins.vsphere.builders.ExposeGuestInfo.VSphereEnvAction.class)
          def envVars = new hudson.EnvVars([:])
          action.buildEnvVars(null, envVars)
          println(envVars)

          Show
          trunov_ms Max Trunov added a comment - def run = currentBuild.build() def action = run.getAction(org.jenkinsci.plugins.vsphere.builders.ExposeGuestInfo.VSphereEnvAction.class) def envVars = new hudson.EnvVars( [:] ) action.buildEnvVars(null, envVars) println(envVars)

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            vassil vassil marjunits
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: