Automated Windows Server virtual machine templates in vSphere with Hashicorp Packer

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ต.ค. 2024
  • Building automated Windows Server vSphere templates is a great way to take away the burden of having to build your vSphere templates by hand. Using Hashicorp Packer, we can fully automate the build process of Windows Server and Linux vSphere templates and keep the templates fresh with the latest updates and other applications. The video takes a detail look at what is needed to use Packer to perform machine image automation, where to download Packer, how to configure your Packer files for the automated build process, and demonstrates how to actually run the build.
    Subscribe to the channel: / @virtualizationhowto
    My blog: www.virtualiza...
    _____________________________________________________
    Social Media: / vspinmaster
    LinkedIn: / brandon-lee-vht
    Github: github.com/bra...
    Downloading Hashicorp Packer - 0:57
    Create the files Packer needs for the automated Windows Server vSphere template - 1:53
    Looking at the Packer variables file - 3:12
    Looking at the Windows Server 2022 build file - 4:38
    Describing the autounattend.xml file for automated Windows installation - 5:25
    Installing VMware Tools automatically during the Packer Build - 6:20
    Running the Packer build command - 7:15
    Monitoring progress of the Packer build process using the Remote Console - 8:10
    Running the automated build of Windows Server 2022 - Windows Updates are getting installed - 8:31
    The Packer build of Windows Server 2022 completely successfully - 9:00
    Final thoughts on fully automated Windows Server templates using Hashicorp Packer - 9:25
    Take a look at my written writeup of the Packer build of Windows Server 2022 here:
    www.virtualiza...
    You can clone down my Github repository files for Packer builds, including Windows Server 2022 here:
    github.com/bra...

ความคิดเห็น • 32

  • @Berkto00
    @Berkto00 11 หลายเดือนก่อน +1

    Thank you for your work and awesome blog ! :)

  • @mandeepmails
    @mandeepmails ปีที่แล้ว

    Nice and Informative Video !

  • @handuo5698
    @handuo5698 2 ปีที่แล้ว

    thank you sir, much appreciated 👏

  • @gibotje
    @gibotje 2 ปีที่แล้ว

    Thanks brother.

  • @phybroptyx1999
    @phybroptyx1999 ปีที่แล้ว

    Have you had any success with this method for Windows Server 2016/2012R2? Each time I go through the steps, the VM is created, boots, but indicates that there are no images available. The curious thing is that you see 4 images (Std/Data w/Desktop Experience and Std/Data Core) when you create a VM manually and use the exact same ISOs. Not sure if anyone else has experienced this.

  • @stannous2T
    @stannous2T 8 หลายเดือนก่อน

    Thank you for the wonderful video. Can this work with ESXi or have to be VSphere? Thanks again.

  • @pbu80
    @pbu80 ปีที่แล้ว

    any solution if the vSphere environment does not have DHCP enabled, currently the build is halted at "==> vsphere-iso: Waiting for IP..."

  • @kenmurphy4259
    @kenmurphy4259 ปีที่แล้ว

    Awesome content

  • @fbifido2
    @fbifido2 2 ปีที่แล้ว +1

    Can you do a video on packer for Hyper-V with the same Windows Server 2022 ??

  • @fbifido2
    @fbifido2 2 ปีที่แล้ว +2

    1. Can you also delete VM ?
    2. How would you deploy & remove a fully virtualize home lab (server core):
    a) dc, ad, dns, dhcp, adcs
    b) file/print server
    c) sql server
    d) windows admin center
    e) etc....

    • @VirtualizationHowto
      @VirtualizationHowto  2 ปีที่แล้ว +2

      fbi fido, You can delete an existing vsphere template with the -force parameter with Packer as this allows refreshing the templates. Packer is not really the best tool to deploy and customize a lab environment. Think of Packer as the tool to get the templates you need as a starting point. Then you can use something like Terraform to deploy a VMware home lab environment based on the template. Terraform has provisioners that can be used to customize the VM, install roles, etc. This is the approach I would use. Then you can perform a terraform apply to deploy the lab and a terraform destroy to destroy it when you are finished.

  • @TayschrennSedai
    @TayschrennSedai ปีที่แล้ว

    Why not use sccm at that point? Doesn't everyone prefer hiring a FTE for their home lab?

  • @kharmastreams8319
    @kharmastreams8319 ปีที่แล้ว +3

    I've tried using your files and for some reason I never get longer than waiting for WinRM to become available

    • @kharmastreams8319
      @kharmastreams8319 ปีที่แล้ว

      @@ZackLeeDrummer have to test that here 🙂

    • @davistiano
      @davistiano ปีที่แล้ว

      @@kharmastreams8319 hey mate just wondering if you have ever resolved this issue? Mine is also timing out at WinRM step and the flow just fails and destroyed the VM. :(

    • @kharmastreams8319
      @kharmastreams8319 ปีที่แล้ว

      @@davistiano I have to do some testing again. Hoping it was a bug or a typo in my files

    • @davistiano
      @davistiano ปีที่แล้ว

      @@kharmastreams8319 thanks mate. I found my issue finally, that I missed changing the "winadmin_password" in the variables.json file :) I feel so dumb now lol

  • @Nimitz_oceo
    @Nimitz_oceo 8 หลายเดือนก่อน +1

    You didn’t show how you connected packer to your vsphere

    • @chrissteele1537
      @chrissteele1537 26 วันที่ผ่านมา

      Timeline 3.25 he states where you are inputting the credentials to authenticate.

  • @coreyman00
    @coreyman00 9 หลายเดือนก่อน

    how would i not use plain text password for the vsphere creds?

    • @VirtualizationHowto
      @VirtualizationHowto  9 หลายเดือนก่อน +1

      @coreyman00 Thank you for the comment! Please sign up on the VHT forums and we can talk about it in more detail there: www.virtualizationhowto.com/community

  • @dogesking
    @dogesking 2 ปีที่แล้ว

    Doesn’t work on vSphere Free Licence though, so it isn’t that homelab friendly

    • @kharmastreams8319
      @kharmastreams8319 ปีที่แล้ว

      Just get vmug advantage.
      Cheap licensing for homelabs

    • @smooti
      @smooti ปีที่แล้ว

      Yeah, i believe it is because the API is not available on the free version. Which is what packer uses to communicate with the vSphere server

    • @smooti
      @smooti ปีที่แล้ว

      @@kharmastreams8319 VMUG is nice to have for training purposes but for people who want a completely free option, VMware simply isn't it.

  • @notta3d
    @notta3d 2 ปีที่แล้ว

    I was excited about watching this because we have a strong need as our VM templates constantly get out of date. Then boom I lost interest as I always do when a product requires an admin password to be stored in clear text in a file. Is there any way to truly secure that part of the process? It will never fly in our environment. Great video though.

    • @VirtualizationHowto
      @VirtualizationHowto  2 ปีที่แล้ว +1

      notta3d, as Maor mentions, you can take care of variables using various solutions to handle secrets. I think most of the tutorials don't show these steps as it adds additional complexity for the basic understanding of how to automate. However, this is an absolute must in production environments to handle secrets carefully. I will look at creating a video using Hashcorp Vault and how you can retrieve credentials securely from there on the fly. Let me know if that would be something you would be interested in.

    • @notta3d
      @notta3d 2 ปีที่แล้ว

      @@VirtualizationHowto Oh Absolutely!! Without a secure method to pass admin credentials most companies would never implement it. So a video in that would be excellent. Thanks.

    • @kharmastreams8319
      @kharmastreams8319 ปีที่แล้ว

      I keep my templates up to date with ansible, works like a charm.
      (Also deploy new vm's via ansible)