VMware vSphere

 View Only
  • 1.  Automate server creating or new-vm

    Posted Nov 11, 2019 03:23 PM

    Hi

    I am trying to find what products i need for testing powercli. I want to be able to run some iac and create servers from templates.

    So i installed the esxi and got some commands to work like get-vm "looking around" but not able to create a new vm.

    "The operation is not supported on the object"

    I suppose that i need, is it called vcenter? or vRealize? to get it to work?

    Powercli requirements?



  • 2.  RE: Automate server creating or new-vm

    Posted Nov 11, 2019 03:29 PM

    You're going to have to be much more specific as to what your requirements are here. There are multiple ways to do this, but they all begin with vSphere (vCenter + ESXi).



  • 3.  RE: Automate server creating or new-vm

    Posted Nov 12, 2019 07:05 AM

    Hi

    I have 2 esxi servers V 6.7 and want to try to bring up servers in a super easy way. And powercli would potentially do it for me.

    I will try to find Vcenter appliance.



  • 4.  RE: Automate server creating or new-vm
    Best Answer

    Posted Nov 13, 2019 10:04 AM

    When you install the vCenter Server Appliance (VCSA) you will be able to connect to it with PowerCLI and having access to all systems linked to that vCenter instance; so the datacenter as an object, a cluster, each host and each datastore as well as all other related objects such as the VMs, switches, folders etc.

    Trying out PowerCLI should have a reason, otherwise I don't understand what you're trying to achieve.

    Bringing up servers btw. is also possible with a pre-built Template VM and a Customization Specification.

    BR

    NC



  • 5.  RE: Automate server creating or new-vm

    Posted Nov 13, 2019 12:31 PM

    thx, got it running now and have created new vm´s by new-vm.

    My goal is to bring up servers on the fly for dev. Is there another way other than powerCLI?



  • 6.  RE: Automate server creating or new-vm

    Posted Nov 13, 2019 12:51 PM

    Hi cher1000​,

    yes there is.

    Either the described way with a Template VM and a Customization Specification or you simply clone an existing VM. This is not the same as deploying it from a template but it's similar. And this can be done as an easy right-click operation from within the vSphere Web Client.

    I hope I could help!

    BR

    NC



  • 7.  RE: Automate server creating or new-vm

    Posted Nov 13, 2019 12:56 PM

    If you have access to the VMware Hands-on Labs (HOL) you could also run through the following:

    VMware Learning Platform

    Lab: HOL-1911-05-SDC - VMware vSphere Automation - PowerCLI

    BR

    NC



  • 8.  RE: Automate server creating or new-vm

    Posted Nov 13, 2019 01:01 PM

    I only ran

    New-VM -Name w_2019_deploy -VM w_2019_bas -Datastore datastore2 -vmhost 10.10.253.10 -DiskStorageFormat thin

    instead of cloning in the gui, later i will check if i can invoke commands and scripts remote, to provisioning the server.

    Btw have anyone tried the Vagrant plugin?