Automation

 View Only
Expand all | Collapse all

VM creation using content library failing

  • 1.  VM creation using content library failing

    Posted Jan 17, 2022 07:47 AM

    Hello Everyone,

    I am trying to create a VM using templates stored in content library. We have automated to create 3 vm's in parallel referring to 3 different templates using powercli (command is noted below)

    Get-ContentLibraryItem –Name ${args.templateName} | New-VM –Name ${args.vmName} –VMHost ${args.esxiHost} -DiskStorageFormat Thin -Confirm:\$False -ErrorAction Stop

    The VM creation fails randomly with the below error and VMWare log console.



  • 2.  RE: VM creation using content library failing

    Posted Jan 17, 2022 08:35 AM

    WHich PowerCLI version, and which vSphere version?



  • 3.  RE: VM creation using content library failing

    Posted Jan 17, 2022 09:56 AM

    we are using powercli - 11.5.0 and VSphere - 6.7.0.40000



  • 4.  RE: VM creation using content library failing

    Posted Jan 17, 2022 10:13 AM

    I would suggest first upgrading your PowerCLI version, there have been Content Library related changes in the recent updates.



  • 5.  RE: VM creation using content library failing

    Posted Jan 17, 2022 12:57 PM

     I upgarded powercli to 12.5.0 (build 19093566) and tried to create VM's  but still facing the same issue 



  • 6.  RE: VM creation using content library failing

    Posted Jan 17, 2022 02:02 PM

    Does the creation of the VM work when you do it from the Web Client?

    It seems you are doing this from within Jenkins, did you also try outside of Jenkins?
    Just a New-VM from a PS prompt?



  • 7.  RE: VM creation using content library failing

    Posted Jan 17, 2022 02:49 PM

    Same issue and error when I create VM's from web client. But when I created with PS prompt the machine creation executed one after the other and the VM's were created fine.



  • 8.  RE: VM creation using content library failing

    Posted Jan 17, 2022 02:53 PM

    Those VMs were all created from Templates stored in a Content Library?

    Strange that the one from the PS prompt worked, but not the ones from the Web Client.
    You are sure that your Jenkins setup uses the same PowerCLI version?



  • 9.  RE: VM creation using content library failing

    Posted Jan 18, 2022 08:23 AM

     Yes, Jenkins setup uses the same PowerCLI Version. I have notices below pattern.

    By using web client , I tried to create 3 VM's in parallel. 2 succeeded and one failed. 

    When created using PS Prompt I used below commands which executed one after the other and all 3 machines were created successfully.

    Connect-VIServer -Server ****** -Protocol https -User ****** -Password ******

    Get-ContentLibraryItem –Name ****** | New-VM –Name test –VMHost ****** -DiskStorageFormat Thin
    Get-ContentLibraryItem –Name ****** | New-VM –Name test1 –VMHost ****** -DiskStorageFormat Thin
    Get-ContentLibraryItem –Name ****** | New-VM –Name test2 –VMHost ****** -DiskStorageFormat Thin



     



  • 10.  RE: VM creation using content library failing

    Posted Jan 18, 2022 08:31 AM

    When you add the RunAsync switch to the New-VM cmdlet, they will also run in parallel in the background.
    Do they all succeed in that case?

    Also, when they all succeed from the PS prompt in sequence, and 2 out of 3, when done from the Web Client, I don't see how this could be a PowerCLI issue.



  • 11.  RE: VM creation using content library failing

    Posted Jan 18, 2022 08:49 AM

     I agree that it might not be PowerCLI issue. IS it something where PowerCLI accessing content library api issue ? or May be conetent library issue ? Do we have a separate discussion thread for it ? 

     



  • 12.  RE: VM creation using content library failing

    Posted Jan 18, 2022 08:54 AM

    Did you try with the RunAsync switch on the New-VM cmdlet, from the PS prompt?

    The Web Client is using the same API and the same Content Library as the PowerCLI cmdlet.
    I suspect it might be a content library issue or the connection to that library.



  • 13.  RE: VM creation using content library failing

    Posted Jan 18, 2022 11:41 AM

     I tried using RunAsync and all the instances were created fine.

    And yes, looks like its content library connection issue. May I know how to verify or fix this ?
     



  • 14.  RE: VM creation using content library failing

    Posted Jan 18, 2022 12:25 PM

    To be honest no clue.
    I would suggest opening an SR.



  • 15.  RE: VM creation using content library failing

    Posted Jan 18, 2022 02:09 PM

     Thank you for the assistance, we will try opening SR