Please find the below packer script i used for your reference.

{
  "variables": {        
      "subscription_id": "",          
      "WorkingDirectory": "{{env `System_DefaultWorkingDirectory`}}",
      "Packages_folder": "C:\\HostedToolCache\\",
  
      "root_folder": "C:"  
  
    },

  "builders": [
    {
      "type": "azure-arm",
      "subscription_id": "xxxxxxxxxxxxxxxxxxxxxx",
  "client_id": "{{user `client_id`}}",            
      "tenant_id": "{{user `tenant_id`}}",
      "managed_image_resource_group_name": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
      "build_resource_group_name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "managed_image_name": "mytestPackerImage1",
      "os_type": "Windows",
      "image_publisher": "MicrosoftWindowsServer",
      "image_offer": "WindowsServer",
      "image_sku": "2019-Datacenter",
      "communicator": "winrm",
      "winrm_use_ssl": true,
      "winrm_insecure": true,
      "winrm_timeout": "5m",
      "winrm_username": "packer",
      "azure_tags": {
        "dept": "Engineering",
        "task": "Image deployment"
      },
      "vm_size": "Standard_D2_v2"
    }
  ],
  "provisioners": [
{
            "type": "file",
            "source": "{{ template_dir }}/Packages/Java.zip",
            "destination": "{{user `Packages_folder`}}"
        },
    {
      "type": "powershell",
      "inline": [
        "Add-WindowsFeature Web-Server",
        "& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe 
/generalize /quiet /quit",
        "while($true) { $imageState = Get-ItemProperty 
HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select 
ImageState; if($imageState.ImageState -ne 
'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output 
$imageState.ImageState; Start-Sleep -s 10  } else { break } }"
      ]
    }
  ]
}

On Friday, July 24, 2020 at 2:56:21 PM UTC-5, Muthukumar Arunachalam wrote:
>
> Hi,
>
> I am also facing the same issue. i created packer script to create windows 
> 2019 image. under image i want to push the package which is 300mb size.
> And i am using communicator as "WINRM". it is taking several hours and did 
> not complete the script. i cancelled after 3 hours.
> kindly advise.
>
> Thanks,
>
> On Thursday, July 2, 2015 at 4:24:35 PM UTC-5, Alvaro Miranda Aguilera 
> wrote:
>>
>> Hello, 
>>
>> vmware fusion/workstation? 
>>
>> if you put the files in an ftp/http maybe you can pull it from the 
>> windows guest using a script? 
>>
>>
>>
>> On Thu, Jul 2, 2015 at 9:20 PM, Ulf Holm Nielsen <[email protected]> wrote: 
>> > Hi, 
>> > 
>> > I'm trying to upload ~500 mb worth of msi files (full directory) to a 
>> > windows 2012 r2 vm-ware image but the process takes forever. Some 
>> smaller 
>> > files make it over, but the larger files don't even make it overnight? 
>> > 
>> > I'm using WinRM (packer 0.8.0) and no SSH installed on the windows 
>> image. 
>> > 
>> > I suppose it's correct to use the file provisioner for exactly this 
>> task 
>> > right? I'm new to packer and I'm not entirely sure how to start 
>> > troubleshooting this.. any hints? 
>> > 
>> > /Ulf 
>> > 
>> > -- 
>> > This mailing list is governed under the HashiCorp Community Guidelines 
>> - 
>> > https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation 
>> > of those guidelines may result in your removal from this mailing list. 
>> > 
>> > GitHub Issues: https://github.com/mitchellh/packer/issues 
>> > IRC: #packer-tool on Freenode 
>> > --- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "Packer" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to [email protected]. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/packer-tool/1978e519-85f2-4323-bd9f-99ede9b7317e%40googlegroups.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/4eaf6874-95f8-490c-8e01-e05a97ee9ebbo%40googlegroups.com.

Reply via email to