Data Infrastructure Management Software Discussions

Highlighted

Datasource Script for VMware vCenter 6.0 running into error

Hi,

 

I just downloaded and installed the "Datasource Script for VMware vCenter 6.0" from the Storage Automation Store.

I setup a new datasource and the credentials seem to be fine as well, but at some point during aquisition the script fails with the following message:

 

"You cannot call a method on a null-valued expression."

 

This looks like some code in the script tries to use some still uninitialized variable.

 

Can anybody please help to debug?

 

Thanks and regards, Niels

 

17 REPLIES 17
Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Niels,

 

     Your inconvenience is regretted. Now to get to the real cause of this failure, I'll keep this conversation via email and then post conclusion etc. here for everyone.

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

We hit this exact same error.  Could you please post the solution when found.

 

Thanks,

Matt.


@sinhaa wrote:

Niels,

 

     Your inconvenience is regretted. Now to get to the real cause of this failure, I'll keep this conversation via email and then post conclusion etc. here for everyone.

 

sinhaa


 

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Matt,

    Your inconvinience is regretted. The cause of the error has been identified and fixed. We are currently doing internal testing.

 

A new updated version of this pack will be available very soon.

 

I hope you can wait till then.

 

warm regards,

sinhaa

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Hi Matt and all,

 

I have fixed this code and you can try it on your setup.

 

Min WFA version needed to import dar: WFA3.1P1

 

Also added the code in txt format, which can be used for creating a new Data Source type on any WFA version.

 

I've also added the Logging for Script Based Datasources

Now if you need  to log something or trace the code execution, all you need to do it edit the code and all lines like below

 

#Info

$logg.Info("this is an info message")

 

You can see the execution logs using the "Log Viewer"

 

Import the .dar file attached here. It will add a DataSource type names "VMware vCenter 6.0 Abhishek Sinha"

 

Create a new Data Source for this and provide the needed credentials.

 

NOTE: I would suggest to keep Timeout(sec) large like 2400 seconds. VMware cmdlets at times can be very slow to return results.  

 

VC60_DS.png

 

 

Let me know how this worked for you.

 

warm regards,

sinhaa

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Hi sinhaa,

 

ESXi6 is not on the Interoperability Matrix yet as a supported hypervisor for WFA. Any idea when that configuration will be added?

 

Kind regards,

Marco Teeuwen

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Hi Marco,

 

How do you plan to manage your ESXi 6.0 hypervisor? Directly or using a cerntralized management unit like VMWare vCenter. 

 

I've not seen the support matrix but let me try to explain you. See there are 2 things with WFA. 

 

1. Acquiring environment information for advanced and intelligent resource selection.

2.  Active management using a programatic interface like API, CLI, cmdlet etc.

 

Point (1) is not mandatory for using WFA with any system (like Vmware ESXi). Yes, it gives big advantage, but you can still use WFA for manageing your stuff without it. Even without resource selection, WFA being a great automation framework will work great for you.

 

The attached Data Source acquistion script for VMWare vCenter6.0 provides for Point (1). It gets the needed information about the environment by connecting to central management system like vCenter which manages multiple ESXi hypervisors. So if you are managing your ESXi 6.0 Hypervisor using a vCenter, then you have point (1) done for you. For point(2), WFA doesn't have a huge array of built-in commands, but you can create them on your own using VMware Power CLI cmdlets. So its not exactly that ESXi is NOT supported.

 

If you do not use VMware vCenter, and manage your ESXi directly, then also you can write a Data Source Acquistion script which gets information from an ESXi Hypervisor. Its not there in WFA as of now.

 

If you can wait some time, I'm writing one which I plan to post on Community for everyone's use.

 

warm regards,

sinhaa

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Hi Sinhaa,

 

I’m not talking about managing the ESX environment with WFA, but about the guest/hypervisor combination where WFA is installed on. The attached IMT export only shows ESXi 5.0, 5.1 and 5.5 in the hypervisor column. I assume it’s no problem running WFA on a Windows guest on ESXi 6, but I would like to see that combination added to the Interoperability Matrix so I can tell my customer it’s supported.

 

Kind regards,

Marco

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Ahh okay.. Maybe your queston wasn't exactly inline with the ongoing thread.

 

Anyway, the next WFA release will add this ESXi version perhaps.

 

sinhaa

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Hi Marco

 

I will take care of adding it in IMT.

I will add vCenter 6.0 as supported

 

But there will be a Note also added saying that "This is not supported out of the box. Customers have to download this pack from store and work with 3.1P1"

 

Regards

Sharaf

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

When will the updated version make it to the Automation store?

I just checked and it still lists the old broken one.

 

regards, Niels

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Niels,

 

Its been delayed due to unavoidable circumstances, but now its been posted. The new 1.1.0 version is available here

 

sinhaa

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Hi Sinhaa,

 

The DAR file you posted with your name on it was working for me really well in our test environment.  However, when I went to deploy to production it started throwing the same error again "You cannot call a method on a null-valued expression."  I then tried the new Vcenter 6.0 datasource DAR from the automation store and it throws that same error for both our prod and test vcenter servers.  The version you had released on this forum works for me in test but not in prod.

 

Do you have any suggestions for me?

 

Thanks,

Matt.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

 

Hi Matt,

     

      Your inconvinience is regretted. It would have been easier if you had reported you error the first time you posted on this thread. VMware acquistion is an extremely wild beast. Everytime I think, I've tamed it, it starts to run lose at some end.

 

The powershell error message is extremely generic, but your scenario is different from what it was initially reported on this original post fron niels.

 

Alright, lets use the code provided the at WFA Automation store. I assure you I'll get this one working both at your test and production env.

 

You need to do the following:

 

  1. With the Data Source type imported from Automation Store  on your Test env. Run your acqustion. I'm sure you have done it already.  Let it fail with the same error. For now, I'll not try something on your production env.
  2. Go to WFA -> Administration -> Log Viewer. You'll see a file named <your_vcenter_server_host>.log . I would need that file.
  3. Let's keep WFA aside to debug this. Attaching here is a code, you need to modify a bit in the beginning as per your Vcenter settings

 

$VcHost = "10.20.30.40"
$User = "administrator"
$Password = "pass"
$port = "443"

 

Save it after changing the extension to .ps1 . Or you may even copy the content as run it from a powershell ISE.

 

5. From a powershell console on your WFA server, execute it. I think it will fail as before with same error "You cannot call a method on a null-valued expression.". Send me the entire output in some text file.

 

6. You may raise a NetApp customer support case. This could speed things up as we can schedule a webex to resolve this.

 

My email is : sinhaa at netapp dot com

 

sinhaa

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Hi Sinhaa,

 

It turns out this issue was due to my mistake.  Looking at the datasource code this morning I realized that I had downloaded the wrong version of the vcenter 6.0 DAR it was still the 1.0 release.  When I imported the 1.1 release everything started working in prod and test.

 

Thanks for your help.  I’m very impressed with the level of support on the community site.  We have big plans for WFA at our company.

 

Thanks,

Matt.

Highlighted

Re: Datasource Script for VMware vCenter 6.0 running into error

Thanks Matt for your positive feedback.

Also would like to thank Abhishek for his efforts in helping you all.

Check out the KB!
Knowledge Base
All Community Forums