Automation

 View Only
Expand all | Collapse all

POWERCLI and Storage Polices ( SPBM ) Issues .

  • 1.  POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 12:54 PM

    Afternoon Communities .

    I am having problems with querying TAGS and Storage Polices and it appears I am not the only one on communities .

    VCSA6.02

    PowerCLI 6.5.1 and 6.03 and .6.31.

    When I run the following from PowerCli 6.5.1 :

    Get-SpbmStoragePolicy -Namespace "Bronze Datastore Policy"

    Or Just Get-SpbmStoragePolicy

    I get Object reference not set to an instance of an object

    I tried community solutions like setting date format to US English and accepting invalid certs .

    https://www.rudimartinsen.com/2017/07/14/issues-with-get-spbm-powercli-cmdlets-and-vcenter-6-5/

    No luck . Then I found

    VMware PowerCLI Forum - VMware {code}

    I did  Get-Tag | Where {$_.Category -eq $null}

    It returned quite a few uncategorized SRM-CG and SRM-PG ones .

    I am however pretty sure I cannot delete or edit those , from names , they were clearly created by system : EG

    Name                           Category                       Description                                              

    ----                           --------                       -----------         

    SRM-CG-341213cf07293d273f81...                                Site Recovery Manager Consistency Group Tag for Replica...

    SRM-PG-939d00673c75ea9c7a47...                                Site Recovery Manager Protection Group Tag for Protecte...

    So I tried two other Windows Management server with PowerCLI 6.03 and 6.3.1 as some communities suggest its a but in PowerCLI 6.5.1

    Now I cannot even do get-tag :

    Index was outside the bounds of the array

    Where to now ?

    Any help would be greatly appreciated .

    Ultimate goal is to get Storage Policies set to ensure Storage Tier and SRM protection are automatically dealt with during VM provisioning



  • 2.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .
    Best Answer

    Posted Nov 21, 2017 01:13 PM

    Did you already try with PowerCLI 6.5.4?

    There were some tag issues that were fixed recently.



  • 3.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 01:48 PM

    Ok let me try that , just getting Windows Management Framework . I see PowerCLI is no longer just a downloadable exe



  • 4.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 01:53 PM

    Correct, since 6.5.1 PowerCLI is distributed via the PowerShell Gallery.

    Install-Module -Name VMware.PowerCLI

    is all you need if you're on a PC with an Internet connection.



  • 5.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 04:52 PM

    So i've gone and installed 6.5.3 and when I run Get-PowerCLIVersion it comes back w/ :

    PowerCLI Version

    ----------------

       VMware PowerCLI 6.5.1 build 5377412

    ---------------

    Component Versions

    ---------------

       VMware Cis Core PowerCLI Component 6.5 build 6983166

       VMware VimAutomation Core PowerCLI Component 6.5 build 6234650

    So I tried running the following command:

    PS U:\> Update-Module -name VMware.PowerCLI -RequiredVersion 6.5.4.7155375 -Verbose

    VERBOSE: Checking for updates for module 'VMware.PowerCLI'.

    VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'True'; IsRegistered = 'True'.

    VERBOSE: Using the provider 'PowerShellGet' for searching packages.

    VERBOSE: Using the specified source names : 'PSGallery'.

    VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.

    VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.

    VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='VMware.PowerCLI'' for ''.

    VERBOSE: Total package yield:'1' for the specified package 'VMware.PowerCLI'.

    VERBOSE: Skipping installed module VMware.PowerCLI 6.5.4.7155375.

    I'm having the same problem as Almero, I can't run TAG commands and I can't run any VMware.VIMAutomation.Storage module commands.

    I did notice SOMETIMES when I run a tag command from a version of PowerCLI of 6.5 or 6.1 my tag commands error out with the following:

    Tag's used to work when we were on vCSA 6.0 but as soon as I updated to 6.5U1 (was only trying this once we finished upgrade) it all stopped working...

    I've tried this on multiple machines, w/ different versions of PowerCLI and it seems to be consistent in the fact that it just no longer works...



  • 6.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 05:04 PM

    I would suggest to open a SR.
    And yes, PowerCLI is supported, you can point the tech to PowerCLI Support Breakdown



  • 7.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 08:25 PM

    LucD​, so had to talk to a Support Manager, who has to get clarification from the SDK team on what to do as he is saying internal documents regarding PowerCLI support are contradicting the blog post you kindly gave to me. I don't know why its difficult to have this supported literally took me 30min of arguing w/ the initial tech to even get them to escalate to the support manager, after asking for it multiple times. Hopefully will get help so I can pass it along.

    Thanks for all your help and the article, if it wasn't for them literally reading that article themselves, and showing it to the support manager I would have still been arguing my point till now, much appreciated!



  • 8.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 05:23 PM

    LucD​, I followed your post Get-SpbmStoragepolicy and vCenter 6.5 but noticed in my situation i'm unable to get any results when using the get-tag command you all talked about in the other thread:

    I'm wondering if its something to do with vCSA 6.5U1 or 6.5 in general? As I am only able to get this result when using a Windows 2008 R2 server with PowerCLI 6.3 R1 installed (Error is image above)

    When I try to run these same commands on Win10 Pro 1709 the commands just say executing and never stop, i've left a window open for 2 hours and it never error'd out...

    Does anyone have any suggestions as I've been searching and reading all morning and this was the CLOSEST thread i've found and it looks like others have the same issue.... Has anyone opened up a Service Request? If not I think I will...



  • 9.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 08:00 PM

    Just wanted to give an update....

    I'm on the phone w/ support we have a Enterprise Plus Support Agreement, and this person i'm talking to will NOT troubleshoot or support this request.. She says it requires a SDK Entitlement Agreement, which makes no sense... DO we have access to anyone in this community who can help us with this support problem, as it seems to be a general issue with vCenter 6.5 (from what I can tell..), thanks!



  • 10.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 21, 2017 08:24 PM

    As Kyle wrote in that post I mentioned earlier, you could pass this to your account team.


    In parallel I'll try to get this under the attention of one of the PowerCLI persons.



  • 11.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 22, 2017 09:02 AM

    Hi Guys .

    I have upgraded to Windows Management Framework 5.0 and PowerCLI 6.5.4 .

    Get a new error >

    From my humble point of view it does look like its related to SRM auto Tags not returning a category .

    Funny thing is , in the web client there is a built in category not shown via PowerShell .

    I am trying to find out if I can disable these SRM auto tags if I DO NOT intend to use Storage DRS  ( without breaking my Protection groups and RPs )

    Option 2 listed in this informal article .

    Site Recovery Manager 6 and Storage DRS Tagging: Part II–FlashArray SRA | Cody Hosterman

    Any Thoughts ?



  • 12.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Nov 19, 2018 08:16 PM

    Hello,

    I'm seeing the same error - did you figure this one out?

    I've tried PowerCLI 6.5 and now 11:

    PowerCLI Version

    ----------------

       VMware PowerCLI 11.0.0 build 10380590

    ---------------

    Component Versions

    ---------------

       VMware Cis Core PowerCLI Component PowerCLI Component 11.0 build 10335701

       VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 11.0 build 10336080

       VMware VimAutomation Storage PowerCLI Component PowerCLI Component 11.0 build 10380343

    Thanks,

    Jon



  • 13.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Mar 16, 2018 09:57 AM

    Today I also encountered this issue when trying to replicate Storage policies between vCenters. When Importing I get "Object reference not set to an instance of an object"

    I've done this from a machine where I'm using the workaround from (my mentioned blogpost in this first post) for the Tags bug. Still I see this error.

    After updating to the latest version of PowerCLI (v 10) on a different machine without the mentioned workaround I see that the Tags cmdlet now seems to work as intended but the error from Import-Spbmstoragepolicy is still present

    PS C:\> get-module vmware.*
     
    ModuleType Version    Name
    ---------- -------    ----
    Script     10.0.0.... VMware.VimAutomation.Core
    Script     10.0.0.... VMware.VimAutomation.Storage

    I'll try to open a SR, but from the last time I did that after finding the Tags bug I'm expecting them to go with the "not supported" thing again. Even if I reference to the post from Kyle



  • 14.  RE: POWERCLI and Storage Polices ( SPBM ) Issues .

    Posted Mar 16, 2018 10:25 AM

    Did you get the error with PowerCLI 10?