HashiCorp Packer VMware Windows Templates and Terraform for VMs | Infrastructure as Code

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 32

  • @jora4873
    @jora4873 Місяць тому +1

    this is one of the most useful YT Videos Ive seen the last years regarding my Work.

    • @TeKanAid
      @TeKanAid  Місяць тому

      Thank you for the kind words

  • @cleito001
    @cleito001 4 роки тому +6

    The video is dope! You should do another going over your ubuntu configuration :)

    • @TeKanAid
      @TeKanAid  4 роки тому +1

      Hey Collin, finally got the chance to do it, here's the video: ua-cam.com/video/4yb-iofeqeY/v-deo.html

  • @guyrawsthorn461
    @guyrawsthorn461 3 роки тому +2

    I was receiving errors when attempting an unattend windows server 2019 install. This video and Guillermo's repo got me back on track. Thank you! one question, after I change the admin password the winRM connection no longer works.

  • @90DaysOfDevOps
    @90DaysOfDevOps 3 роки тому +1

    Thanks for this and i find video explanations much easier to follow these days than blogs, one question i have though is that i have noticed that on the deployed VM i get a message about product key "Windows cannot read the setting from the unattend answer file" I presume i have to add a key to the unattend.xml in the folder? Are you able to highlight where that would be please.

    • @TeKanAid
      @TeKanAid  3 роки тому

      Thank you. Trial ISOs work fine. For purchased product keys, uncomment the section under user. Example: github.com/joefitzgerald/packer-windows/blob/master/answer_files/2016/Autounattend.xml

    • @90DaysOfDevOps
      @90DaysOfDevOps 3 роки тому +1

      @@TeKanAid Yes thank you I managed to find it and got that sorted. Next I am looking into the Ubuntu image you have but also 20.04 which seems to be very rare out there at least documented because of the change

  • @bocephus6772
    @bocephus6772 3 роки тому +2

    Very helpful video. I do have one question. On your 2016 template, you disable WinRM, and then enable WinRM. Not a huge deal, just seems like an extra unnecessary step unless not disabling WinRM was problematic.

    • @TeKanAid
      @TeKanAid  3 роки тому

      Good observation. Not too sure if removing it would break something. I took the code as is from Guillermo Musumeci at github.com/guillermo-musumeci/packer-vsphere-iso-windows

    • @bocephus6772
      @bocephus6772 3 роки тому

      @@TeKanAid That is what I figured, and thanks for the response. I've watched both this one, and your packer/teraform/ubuntu video. They are both excellent.
      Any chance you could do a similar setup deploying Windows Server 2019 with packer/vsphere-iso but using efi instead of bios, for firmware. As of vCenter 7, efi is now the default for Windows Server 2019.

    • @TeKanAid
      @TeKanAid  3 роки тому

      Thanks for the feedback. Yes I'll add it to the backlog. However, if you end up figuring it out before I get to it, please share your findings :)

  • @yuvaranisaravanan7450
    @yuvaranisaravanan7450 Рік тому

    Hi Sir,
    Very helpful video, need your help getting below error when i tried. please guide me
    I. The number of network adapter setting in the customization specification 0 does not match of network adapters present in the virtual machine 1
    II. error sending customization spec: customization of the guest operating system is not supported.

    • @TeKanAid
      @TeKanAid  10 місяців тому

      Error I: Network Adapter Mismatch
      The Issue:
      This error usually indicates a mismatch in the number of network adapters between your VM template (created by Packer) and the customization specification in VMware.
      In simple terms, your VM template might have one network adapter, but the customization spec expects a different number (in this case, zero).
      How to Resolve:
      Check VM Template Network Adapters:
      Make sure you know how many network adapters your Packer template is configured with. You can check this in your Packer configuration file.
      Align Customization Specification:
      Adjust your VMware customization specification to match the number of network adapters in your template. This step is crucial to ensure that the VM created from the template can be properly customized.
      Rebuild Template if Needed:
      If necessary, rebuild your VM template with Packer after adjusting the network adapter settings.
      Error II: Guest OS Customization Not Supported
      The Issue:
      This error message typically appears when VMware does not support customization of the guest operating system you're using in your template.
      It could be due to the specific OS version, or VMware tools not being installed or recognized properly in the template.
      How to Resolve:
      Check OS Compatibility:
      Ensure that the guest OS in your VM template is supported for customization by VMware. VMware has specific versions and editions of operating systems that support customization.
      Install/Update VMware Tools:
      Make sure VMware Tools is installed and up to date in the template. VMware Tools is essential for customization operations.
      Review Packer Template Configuration:
      Double-check your Packer template. Ensure that it's configured correctly for the OS and that it’s installing VMware Tools as part of the build process.

  • @monausavlogs9796
    @monausavlogs9796 3 роки тому +1

    Hi Thanks for the tutorial . I am trying to join domain using windows option but it’s not joining as expected but it’s adding a workgroup . Not sure what the issue is

    • @TeKanAid
      @TeKanAid  3 роки тому

      You're welcome. You could also take a look at this module wirh this example: registry.terraform.io/modules/Terraform-VMWare-Modules/vm/vsphere/0.10.0/examples/windows#example-of-windows-vm-joined-to-domain

  • @balaa78
    @balaa78 2 роки тому

    Great Explanation!!!
    I tried with this code and successfully able to deploy a VM and added to the domain.
    But when i try to deploy multiple VM's by giving the vm-count = 2, getting the below error.
    Error: Invalid index

    │ on main.tf line 100, in resource "vsphere_virtual_machine" "vm":
    │ 100: ipv4_netmask = var.ipv4_netmasks[count.index]
    │ ├────────────────
    │ │ count.index is 1
    │ │ var.ipv4_netmasks is list of number with 1 element

    │ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the collection.
    can you please suggest on this

  • @dillonhansen71
    @dillonhansen71 4 роки тому +1

    more... More.... MOREEEEEEEEEE!!!!!!!!

  • @sofyane3696
    @sofyane3696 3 роки тому +1

    Honestly, I don’t see what the difference to create a vm with terraform or creating it from vcenter by selecting the proper template .

    • @TeKanAid
      @TeKanAid  3 роки тому +1

      It's the whole idea of infrastructure as code IaC, where you define your infrastructure in code. There are many benefits of this such as repeatability, better documentation, collaboration, and governance. Terraform is great because it can be used with all the cloud vendors in addition to vSphere and many other providers.

    • @sofyane3696
      @sofyane3696 3 роки тому +1

      @@TeKanAid thank you ,
      Yea I see some use case like deploying VMs based on template .
      I Am wondering if we can use it to patch the server regularly ( windows vms ) and also manage the esxi update / upgrade

    • @TeKanAid
      @TeKanAid  3 роки тому

      You can do a few things with Terraform, check out the provider documentation here registry.terraform.io/providers/hashicorp/vsphere/latest/docs

  • @anjananiyyer544
    @anjananiyyer544 3 роки тому

    How to remotely execute packer build command throug ssh..(my packer command creates a windows vm in local machine..but when calling packer build command from remote machine it fails.. I'm using ubuntu)

    • @TeKanAid
      @TeKanAid  3 роки тому

      Sorry I don't understand. Are you trying to use Packer to build an image from a remote machine? So you would ssh into that remote machine then run packer? Does your remote machine have the packer binary installed?

    • @anjananiyyer544
      @anjananiyyer544 3 роки тому

      @@TeKanAid yes.remote machine has packer..and I'm able to build image in remote machine locally using packer build..but build commaand is not working when run through ssh

    • @anjananiyyer544
      @anjananiyyer544 3 роки тому

      @@TeKanAid one more thing..the ssh command is issued from a php page

    • @TeKanAid
      @TeKanAid  3 роки тому

      What commands are you running? What is the error? What packer builder are you using? Are you building on VMware?

    • @anjananiyyer544
      @anjananiyyer544 3 роки тому +1

      @@TeKanAid thanks for reply..my issue is resolved now😀

  • @Free_bird30
    @Free_bird30 3 роки тому

    How do we add ISO from localhost instead of Datastore

    • @TeKanAid
      @TeKanAid  3 роки тому

      Take a look at this www.packer.io/docs/builders/vmware/vsphere-iso#iso-configuration and perhaps this www.packer.io/docs/builders/vmware/iso