You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating an image with file folders to be uploaded into the Azure windows image.
What I have done so far. I have created a custom windows image with SSH server installed and running the below packer script to provision a new image from that custom image. Packer is able to create all the required resources at runtime but not able to upload any files to it and terminates with the error "Context deadline exceeded".
The same is achievable from winrm but failing with SSH.
Since the files and directories are huge in size so it is taking a lot of time to transfer using winrm that's why I chose SSH communicator to quicky upload the files but its failing.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Hi,
I am creating an image with file folders to be uploaded into the Azure windows image.
What I have done so far. I have created a custom windows image with SSH server installed and running the below packer script to provision a new image from that custom image. Packer is able to create all the required resources at runtime but not able to upload any files to it and terminates with the error "Context deadline exceeded".
The same is achievable from winrm but failing with SSH.
Since the files and directories are huge in size so it is taking a lot of time to transfer using winrm that's why I chose SSH communicator to quicky upload the files but its failing.
########################################################################
source "azure-arm" "autogenerated_1" {
azure_tags = {
dept = "Engineering"
task = "Image deployment"
}
build_resource_group_name = "TEST-RG"
client_id = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client_secret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
communicator = "ssh"
custom_managed_image_name = "SSH-WindowsImage"
custom_managed_image_resource_group_name = "TEST-RG"
managed_image_name = "Windows-image"
managed_image_resource_group_name = "TEST-RG"
os_type = "Windows"
subscription_id = "XXXXXXXXXXXXXXXXXXXXX"
tenant_id = "XXXXXXXXXXXXXXXXXXXXX"
vm_size = "Standard_D2_v2"
ssh_username = "userzktest1"
ssh_password = "PassPktest@123!"
ssh_port = 22
pause_before_connecting = "5m"
ssh_file_transfer_method = "sftp"
}
build {
sources = ["source.azure-arm.autogenerated_1"]
provisioner "file" {
source = "files/bin.zip"
destination = "C:/code/bin.zip"
}
provisioner "powershell" {
inline = ["while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }", "while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }", "& $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 } }"]
}
}
###############################################################################
Any help will be highly appreciated.
Thanks in advance.
The text was updated successfully, but these errors were encountered: