ошибка тайм-аута Azure-arm winrm с использованием упаковщика - PullRequest
0 голосов
/ 14 мая 2019

Я использовал свою существующую VNET, группу ресурсов, подсеть, которую упаковщик использовал для создания виртуальной машины и получения образа из нее. Я взял образ Windows с рынка. Упаковщик запускает Vm, но время ожидания при подключении к нему истекает. Я включил мой файл JSON ниже { "строители": [{ "type": "azure-arm",

"client_id": "XXXXXX",
"client_secret": "XXXXXX",
"tenant_id": "XXXXXX",
"subscription_id": "XXXXXX",

"managed_image_resource_group_name": "test",
"managed_image_name": "myPackerImage",

"os_type": "Windows",
"image_publisher": "MicrosoftWindowsServer",
"image_offer": "WindowsServer",
"image_sku": "2016-Datacenter",

"communicator": "winrm",
"winrm_use_ssl": true,
"winrm_insecure": true,
"winrm_timeout": "3m",
"winrm_password": "Welcome@123456",
"winrm_username": "packer",

"azure_tags": {
"dept": "Engineering",
"task": "Image deployment"
},
"build_resource_group_name" : "test",
"virtual_network_name": "test",
"virtual_network_resource_group_name" : "test",
"virtual_network_subnet_name" : "test",
"vm_size": "Standard_DS2_v2"
}],
"provisioners": [{
"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 } }"
]
 }]
}

Я использовал существующую группу ресурсов, VNET и подсеть. Но время ожидания при подключении к ВМ. Это показывает следующую ошибку выход лазурной руки будет в этом цвете.

==> azure-arm: Running builder ...
==> azure-arm: Getting tokens using client secret
azure-arm: Creating Azure Resource Manager (ARM) client ...
==> azure-arm: Using existing resource group ...
==> azure-arm: -> ResourceGroupName : 'test'
==> azure-arm: -> Location : 'uksouth'
==> azure-arm: Validating deployment template ...
==> azure-arm: -> ResourceGroupName : 'test'
==> azure-arm: -> DeploymentName : 'pkrdpn19ib1zopk'
==> azure-arm: Deploying deployment template ...
==> azure-arm: -> ResourceGroupName : 'test'
==> azure-arm: -> DeploymentName : 'kvpkrdpn19ib1zopk'
==> azure-arm: Getting the certificate's URL ...
==> azure-arm: -> Key Vault Name : 'pkrkvn19ib1zopk'
==> azure-arm: -> Key Vault Secret Name : 'packerKeyVaultSecret'
==> azure-arm: -> Certificate URL : 'https://pkrkvn19ib1zopk.vault.azure.net/secrets/packerKeyVaultSecret/37221457a5a3459fa0da7f3745e1c9ee'
==> azure-arm: Setting the certificate's URL ...
==> azure-arm: Validating deployment template ...
==> azure-arm: -> ResourceGroupName : 'test'
==> azure-arm: -> DeploymentName : 'pkrdpn19ib1zopk'
==> azure-arm: Deploying deployment template ...
==> azure-arm: -> ResourceGroupName : 'test'
==> azure-arm: -> DeploymentName : 'pkrdpn19ib1zopk'
==> azure-arm: Getting the VM's IP address ...
==> azure-arm: -> ResourceGroupName : 'test'
==> azure-arm: -> PublicIPAddressName : 'pkripn19ib1zopk'
==> azure-arm: -> NicName : 'pkrnin19ib1zopk'
==> azure-arm: -> Network Connection : 'PrivateEndpoint'
==> azure-arm: -> IP Address : '10.1.0.5'
==> azure-arm: Waiting for WinRM to become available...
==> azure-arm: Timeout waiting for WinRM.
==> azure-arm:
==> azure-arm: The resource group was not created by Packer, deleting individual resources ...
==> azure-arm: -> Deployment: pkrdpn19ib1zopk
==> azure-arm: -> Microsoft.Compute/virtualMachines : 'pkrvmn19ib1zopk'
==> azure-arm: -> Microsoft.Network/networkInterfaces : 'pkrnin19ib1zopk'
==> azure-arm: -> Microsoft.Compute/disks : '/subscriptions/2b87c584-986d-4a3c-9e56-012df416db72/resourceGroups/test/providers/Microsoft.Compute/disks/pkrosn19ib1zopk'
==> azure-arm:
==> azure-arm: The resource group was not created by Packer, deleting individual resources ...
==> azure-arm: Could not retrieve OS Image details
==> azure-arm: -> Deployment: kvpkrdpn19ib1zopk
==> azure-arm: -> Microsoft.KeyVault/vaults/secrets : 'pkrkvn19ib1zopk/packerKeyVaultSecret'
==> azure-arm: -> Microsoft.KeyVault/vaults : 'pkrkvn19ib1zopk'
==> azure-arm: -> : ''
==> azure-arm: Error deleting resource. Please delete manually.
==> azure-arm:
==> azure-arm: Name:
==> azure-arm: Error: Unable to parse path of image
==> azure-arm:
==> azure-arm: The resource group was not created by Packer, not deleting ...
Build 'azure-arm' errored: Timeout waiting for WinRM.

==> Some builds didn't complete successfully and had errors:
--> azure-arm: Timeout waiting for WinRM.

==> Builds finished but no artifacts were created.
...