Packer Openstack using Windows(Getting Devices Ready)

158 views
Skip to first unread message

Louis Mayorga

unread,
Jun 5, 2019, 3:50:13 PM6/5/19
to Packer
I have the following template for packer to build an openstack image based on a Windows 2016 Core existing image

{
   
"variables": {
     
"windows_admin_user": "Administrator",
     
"windows_admin_password": "******",
     
"source_image": "<source_image_name>",
     
"flavor_name": "<flavor_id>",
     
"network": "<network-id>"
   
},
   
"builders": [ {
     
"type": "openstack",
     
"image_name": "win2016-docker-host",
     
"instance_name": "windows-server-2016-docker.temp",
     
"insecure": true,
     
"availability_zone": "zone1",
     
"source_image": "{{user `source_image`}}",
     
"communicator": "winrm",
     
"flavor": "{{user `flavor_name`}}",
     
"networks": "{{user `network`}}",
     
"winrm_username": "{{user `windows_admin_user`}}",
     
"winrm_password": "{{user `windows_admin_password`}}",
     
"winrm_port": 5986,
     
"winrm_timeout": "1h",
     
"winrm_use_ssl": true,
     
"winrm_insecure": true,
     
"user_data_file": "bootstrap.ps1",
     
"image_disk_format": "qcow2",
     
"use_blockstorage_volume": true,
     
"volume_type": "datera",
     
"volume_size": "80",
     
"endpoint_type":"public",
     
"image_visibility": "public",
     
"security_groups": ["allow-all"],
     
"metadata": { "windows_release": "windows2016core",
                   
"packer_version": "{{ packer_version }}"
                 
}
     
}
   
],
   
"provisioners": [
   
{
       
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
       
"scripts": [
         
"scripts/win/enable-rdp.bat"
       
],
       
"type": "windows-shell"
     
}
   
]
}


The image is created successfully and I was able to see the details of the openstack image

+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 374787655efc2bedb1070823e1e77534                     |
| container_format | bare                                                 |
| created_at       | 2019-06-05T15:52:37Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/38e9939f-dbe5-4c30-80e6-c4e19ebb7f4e/file |
| id               | 38e9939f-dbe5-4c30-80e6-c4e19ebb7f4e                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | win2016-docker-host                                  |
| owner            | 135cd3e82df64f8d91c00f572137794b                     |
| properties       | os_type='windows'                                    |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 8120369152                                           |
| status           | active                                               |
| updated_at       | 2019-06-05T15:59:49Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+


 However,

When I create an instance based on the image I get the Windows Getting Devices Ready and it takes forever so far 2 hours.

Any advice will be appreciated.

Reply all
Reply to author
Forward
0 new messages