Slow upload of files using file provisioner?

1,811 views
Skip to first unread message

Ulf Holm Nielsen

unread,
Jul 2, 2015, 5:20:42 AM7/2/15
to packe...@googlegroups.com
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

Alvaro Miranda Aguilera

unread,
Jul 2, 2015, 5:24:35 PM7/2/15
to packe...@googlegroups.com
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?
> --
> 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 packer-tool...@googlegroups.com.
> 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.

Ulf Holm Nielsen

unread,
Jul 3, 2015, 12:13:09 AM7/3/15
to packe...@googlegroups.com
Yes fusion. I could use ftp/http but having to do that is rather inconvenient. I was mostly wondering if there is a bug in the file provisioner or if the speed waste be expected.
/Ulf

You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/ALVk6YjyUNw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAHqq0ezezbObh-5HQt31SL%3DdY7a2jXHsFvnY%2BmR82HUf_ts6pw%40mail.gmail.com.

Muthukumar Arunachalam

unread,
Jul 24, 2020, 3:56:21 PM7/24/20
to Packer
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,

Muthukumar Arunachalam

unread,
Jul 24, 2020, 3:59:20 PM7/24/20
to Packer
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 } }"
      ]
    }
  ]
Reply all
Reply to author
Forward
0 new messages