Automate your VM Images with Packer and Azure DevOps Pipeline

  Рет қаралды 5,061

Azure Terraformer

Azure Terraformer

Күн бұрын

Пікірлер: 26
@TheDummyHead
@TheDummyHead Жыл бұрын
Dynamic image versioning is very cool. I had to do it manually for common libraries at previous work, and there were times where you pushed a wrong version number... That wasn't fun.
@marsamuk
@marsamuk Жыл бұрын
Hi. I’m trying to follow and do the lab 😊. Where are you defining the variable values? Thanks
@azure-terraformer
@azure-terraformer Жыл бұрын
Sorry about that! I just posted the code for this episode. Hopefully that should help. Check out the video description for the link to my GitHub. Packer input variables are defined in a file called "variables.pkr.hcl". Terraform input variables are defined in a file called "variables.tf".
@rajulros
@rajulros Жыл бұрын
Thank you Mark for this video. It was very helpful. However, I am facing issues with winrm connections. Pipeline fails with winrm timeout. Packer VM is not accepting winrm connections when we specify the vnet and subnet names
@azure-terraformer
@azure-terraformer Жыл бұрын
WinRM is always a bit weird isn’t it? Have you checked your NSGs on your existing VNet for the WinRM ports being opened?
@0ccccccccc
@0ccccccccc 8 ай бұрын
Hi thank you very much for uploading such a wonderful video serials, I learned a lot! I tried all the procedures in your video, but I got an error message from Azure DevOps, saying that "packer: command not found". I think this is because I used a self hosted agent, and on this agent packer is not installed. If I use a azure hosted agent, do I still need to install Packer? And I tried to run packer build through my local computer, got another error saying that the shared image is not found. I guess it is because I didn't deploy an image version through terraform before I call "packer build". But I noticed that you also didn't deploy any versions to the shared image before you call packer build (you only deployed shared image gallery and an empty shared image "Ubuntu-baseline"), but your code is working.... Do you have any idea how this happens? Thank you in advance!🙂
@azure-terraformer
@azure-terraformer 8 ай бұрын
Thanks for the kind words. I’m glad you found it useful! It sounds like your Azure DevOps build agent doesn’t have Packer installed. You might want to install it yourself or use a marketplace task to do so. If you’re still having trouble hop on our discord server and Post in the channel dedicated to Packer.
@0ccccccccc
@0ccccccccc 8 ай бұрын
@@azure-terraformer Thank you so much for the quick reply!!! By saying marketplace task, do you mean the extension and I should install packer extension? Sorry, I'm totally new to Azure DevOps. 😅 And about the error I posted before about not finding correct image, I have already found out the reason. I used the SKU, publisher etc. which I made up, from the destination image. That's wrong, since I should use the identifiers from a real Azure VM Image. Now I understand why you said that packer doesn't build the image, but only build a new version😃
@azure-terraformer
@azure-terraformer 8 ай бұрын
@0ccccccccc glad you got it sorted!
@0ccccccccc
@0ccccccccc 8 ай бұрын
@@azure-terraformer Oh there's another question about your episodes in this video playlist. I want to see all the videos, so that I can follow the full instructions. But when I open the playlist, I can only see a few of them, for example the first video in the playlist is the episode 8, and second is 12... Do you know why is it like that? And how can I see the complete playlist? Thank you again for your patience!
@marsamuk
@marsamuk Жыл бұрын
Have you done any Ansible automation using AzDO? I’m working on a project to automate Ansible Linux patching using AzDO. Thanks
@azure-terraformer
@azure-terraformer Жыл бұрын
Yes. This is in the works.
@marsamuk
@marsamuk Жыл бұрын
@@azure-terraformer love your content. Looking forward for it.
@azure-terraformer
@azure-terraformer Жыл бұрын
Thank you!!!
@marsamuk
@marsamuk Жыл бұрын
Hi. Is it possible to use a single template packer file to build multiple OS images like Windows, Ubuntu, and RHEL? If so, what would be the recommended approach to achieve this? Thank you!
@azure-terraformer
@azure-terraformer Жыл бұрын
Good question. But I think that would not be a great idea. First windows and Linux vastly differ in how you script them to setup. Even Linux distributions differ between using apt or yum. You can use something like ansible to rationalize Linux distros to a certain extent but not for windows and Linux. You can use the same builder configuration. But the provisioners will differ so radically it wouldn't make sense.
@marsamuk
@marsamuk Жыл бұрын
Hi. What do I need to change if I’m running your code in my ADO? Also what’s the need for declaring IP address? I thought packer will create an IP and other requirements? Thanks
@azure-terraformer
@azure-terraformer Жыл бұрын
You need to setup a variable group with the credentials for your service principal. Your SP has to have contributor access to your sub so that packer can create a resource group and all the things. The up address is YOUR IP address. You could make it public but not super great from a security stand point so I at least specify a whitelisted IP, this will tell packer to setup an NSG and block anybody but you.
@marsamuk
@marsamuk Жыл бұрын
Hi. Why do we need terraform? Can’t we just use packer and Azure DevOps automate packer builds? Thanks
@azure-terraformer
@azure-terraformer Жыл бұрын
Packer and Terraform have distinct separation of responsibility. Packer automates how an individual virtual machine is setup and produces a virtual machine image as its output. Terraform automates the provisioning of a virtual machine by taking as its input that virtual machine image that packer produced as its output.
@marsamuk
@marsamuk Жыл бұрын
@@azure-terraformer sorry maybe I got confused. Thought this video was going through the process of automating packer build using AzDO and adding the image to shared image gallery. I’ll rewatch the video. Thanks
@azure-terraformer
@azure-terraformer Жыл бұрын
Oh I see what you mean now. The Terraform in this episode is used to provision an Azure shared compute gallery which packer can use as a target for creating the images.
@misterc3835
@misterc3835 11 ай бұрын
Even I added variables created in the previous video (kzbin.info/www/bejne/moi5ZXSGjsmGd8k), add SP role on subscription and added azure required plugin , I still have an issues: Build 'azure-arm.vm' errored after 440 milliseconds 558 microseconds: the Shared Gallery Image 'VMimagesDev' to which to publish the managed image version to does not exist in the resource group 'test1' or does not contain managed image '2023.12.12' Any idea what is missing? (The gallery image name and resource group are fine)
@misterc3835
@misterc3835 11 ай бұрын
I fixed the missing imageName var in the pipeline and everything is fine.
@azure-terraformer
@azure-terraformer 11 ай бұрын
It looks like you solved this but from the error you received it sounds more like the Resource Group name was wrong or something. It can be frustrating when the error messages are pretty unhelpful!
@azure-terraformer
@azure-terraformer 11 ай бұрын
Glad you got it figured out!
Setup Packer Build PIpelines for Minecraft Server
19:53
Azure Terraformer
Рет қаралды 540
Azure DevOps Pipeline and Image Builder
28:32
Travis Roberts
Рет қаралды 16 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Getting Started with Packer and Terraform on Azure!
1:04:48
Azure Terraformer
Рет қаралды 2 М.
Introduction to HCP Packer
13:33
HashiCorp
Рет қаралды 9 М.
Install Applications in Azure Image Builder with PowerShell!
20:29
Travis Roberts
Рет қаралды 5 М.
Automating Azure Image Pipelines with HCP Packer
16:56
DevOps on Azure
Рет қаралды 5 М.
Managing Multiple Environments with Terraform
20:39
Ned in the Cloud
Рет қаралды 7 М.
How To Create a YAML Pipeline in Azure DevOps (NEW 2023)
48:26
BestITCourses
Рет қаралды 14 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН