github.com/aclaygray/packer@v1.3.2/website/source/docs/builders/ncloud.html.md (about) 1 --- 2 description: | 3 The ncloud builder allows you to create server images using the NAVER Cloud Platform. 4 layout: docs 5 page_title: 'Naver Cloud Platform - Builders' 6 sidebar_current: 'docs-builders-ncloud' 7 --- 8 9 # NAVER CLOUD PLATFORM Builder 10 11 The `ncloud` builder allows you to create server images using the [NAVER Cloud 12 Platform](https://www.ncloud.com/). 13 14 ## Configuration Reference 15 16 ### Required: 17 18 - `ncloud_access_key` (string) - User's access key. Go to [\[Account 19 Management \> Authentication 20 Key\]](https://www.ncloud.com/mypage/manage/authkey) to create and view 21 your authentication key. 22 23 - `ncloud_secret_key` (string) - User's secret key paired with the access 24 key. Go to [\[Account Management \> Authentication 25 Key\]](https://www.ncloud.com/mypage/manage/authkey) to create and view 26 your authentication key. 27 28 - `server_image_product_code` (string) - Product code of an image to create. 29 (member\_server\_image\_no is required if not specified) 30 31 - `server_product_code` (string) - Product (spec) code to create. 32 33 ### Optional: 34 35 - `member_server_image_no` (string) - Previous image code. If there is an 36 image previously created, it can be used to create a new image. 37 (`server_image_product_code` is required if not specified) 38 39 - `server_image_name` (string) - Name of an image to create. 40 41 - `server_image_description` (string) - Description of an image to create. 42 43 - `block_storage_size` (number) - You can add block storage ranging from 10 44 GB to 2000 GB, in increments of 10 GB. 45 46 - `access_control_group_configuration_no` (string) - This is used to allow 47 winrm access when you create a Windows server. An ACG that specifies an 48 access source (`0.0.0.0/0`) and allowed port (5985) must be created in 49 advance. 50 51 - `user_data` (string) - Init script to run when an instance is created. 52 - For Linux servers, Python, Perl, and Shell scripts can be used. The 53 path of the script to run should be included at the beginning of the 54 script, like \#!/usr/bin/env python, \#!/bin/perl, or \#!/bin/bash. 55 - For Windows servers, only Visual Basic scripts can be used. 56 - All scripts must be written in English. 57 - `user_data_file` (string) - A path to a file containing a `user_data` 58 script. See above for more information. 59 60 - `region` (string) - Name of the region where you want to create an image. 61 (default: Korea) 62 - values: Korea / US-West / HongKong / Singapore / Japan / Germany 63 64 65 ## Sample code of template.json 66 67 ``` 68 { 69 "variables": { 70 "ncloud_access_key": "FRxhOQRNjKVMqIz3sRLY", 71 "ncloud_secret_key": "xd6kTO5iNcLookBx0D8TDKmpLj2ikxqEhc06MQD2" 72 }, 73 "builders": [ 74 { 75 "type": "ncloud", 76 "access_key": "{{user `ncloud_access_key`}}", 77 "secret_key": "{{user `ncloud_secret_key`}}", 78 79 "server_image_product_code": "SPSW0WINNT000016", 80 "server_product_code": "SPSVRSSD00000011", 81 "member_server_image_no": "4223", 82 "server_image_name": "packer-test {{timestamp}}", 83 "server_description": "server description", 84 "user_data": "CreateObject(\"WScript.Shell\").run(\"cmd.exe /c powershell Set-ExecutionPolicy RemoteSigned & winrm quickconfig -q & sc config WinRM start= auto & winrm set winrm/config/service/auth @{Basic=\"\"true\"\"} & winrm set winrm/config/service @{AllowUnencrypted=\"\"true\"\"} & winrm get winrm/config/service\")", 85 "region": "US-West" 86 } 87 ] 88 } 89 ``` 90 91 ## Requirements for creating Windows images 92 93 You should include the following code in the packer configuration file for 94 provision when creating a Windows server. 95 96 ``` 97 "builders": [ 98 { 99 "type": "ncloud", 100 ... 101 "user_data": 102 "CreateObject(\"WScript.Shell\").run(\"cmd.exe /c powershell Set-ExecutionPolicy RemoteSigned & winrm set winrm/config/service/auth @{Basic=\"\"true\"\"} & winrm set winrm/config/service @{AllowUnencrypted=\"\"true\"\"} & winrm quickconfig -q & sc config WinRM start= auto & winrm get winrm/config/service\")", 103 "communicator": "winrm", 104 "winrm_username": "Administrator" 105 } 106 ], 107 "provisioners": [ 108 { 109 "type": "powershell", 110 "inline": [ 111 "$Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet \"/unattend:C:\\Program Files (x86)\\NBP\\nserver64.xml\" " 112 ] 113 } 114 ] 115 ``` 116 117 ## Note 118 119 * You can only create as many public IP addresses as the number of server 120 instances you own. Before running Packer, please make sure that the number of 121 public IP addresses previously created is not larger than the number of 122 server instances (including those to be used to create server images). 123 * When you forcibly terminate the packer process or close the terminal 124 (command) window where the process is running, the resources may not be 125 cleaned up as the packer process no longer runs. In this case, you should 126 manually clean up the resources associated with the process.