Merge branch 'master' of github.com:zhuzhih2017/packer
This commit is contained in:
commit
b7c1765deb
|
@ -8,6 +8,42 @@
|
|||
"revision": "5678f03fc801525df794f953aa82f5ad7555a2ef",
|
||||
"revisionTime": "2016-08-11T22:04:02Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "HttiPj314X1a0i2Jen1p6lRH/vE=",
|
||||
"path": "github.com/aliyun/aliyun-oss-go-sdk/oss",
|
||||
"revision": "e6dbea820a9f304b43d3b357dd48ced23b86df72",
|
||||
"revisionTime": "2017-01-13T02:27:42Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "InnjAEH008xuFzlslJn2IaG7McM=",
|
||||
"path": "github.com/denverdino/aliyungo/common",
|
||||
"revision": "4102657a3f4885557c5e19dee53decb1fbf49d2a",
|
||||
"revisionTime": "2017-03-09T13:03:54Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "yhWqkta/EcCfgSy1ZV7T/CR6VTo=",
|
||||
"path": "github.com/denverdino/aliyungo/ecs",
|
||||
"revision": "4102657a3f4885557c5e19dee53decb1fbf49d2a",
|
||||
"revisionTime": "2017-03-09T13:03:54Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "40PbgN4Emct6AIiJbhPoEdd+vIA=",
|
||||
"path": "github.com/denverdino/aliyungo/ram",
|
||||
"revision": "4102657a3f4885557c5e19dee53decb1fbf49d2a",
|
||||
"revisionTime": "2017-03-09T13:03:54Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "ufG04XwbDZklJlmRINMh4DErUiI=",
|
||||
"path": "github.com/denverdino/aliyungo/slb",
|
||||
"revision": "4102657a3f4885557c5e19dee53decb1fbf49d2a",
|
||||
"revisionTime": "2017-03-09T13:03:54Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Lp0KtT7ycgq31ox3Uzhpxyw0U+Y=",
|
||||
"path": "github.com/denverdino/aliyungo/util",
|
||||
"revision": "4102657a3f4885557c5e19dee53decb1fbf49d2a",
|
||||
"revisionTime": "2017-03-09T13:03:54Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "/WG++Jij8INZ80tER+FAiIDMmws=",
|
||||
"comment": "v3.1.0-beta",
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
---
|
||||
description: |
|
||||
The Packer Alicloud Import post-processor takes a RAW or VHD artifact from various builders and
|
||||
imports it to an Alicloud customized image list.
|
||||
layout: docs
|
||||
page_title: 'Alicloud Import Post-Processor'
|
||||
...
|
||||
|
||||
# Aicloud Import Post-Processor
|
||||
|
||||
Type: `alicloud-import`
|
||||
|
||||
The Packer Alicloud Import post-processor takes a RAW or VHD artifact from various builders and imports it to an Alicloud ECS Image.
|
||||
## How Does it Work?
|
||||
|
||||
The import process operates making a temporary copy of the RAW or VHD to an OSS bucket, and calling an import task in ECS on the RAW or VHD file. Once completed, an Alicloud ECS Image is returned. The temporary RAW or VHD copy in OSS can be discarded after the import is complete.
|
||||
|
||||
## Configuration
|
||||
|
||||
There are some configuration options available for the post-processor. There are
|
||||
two categories: required and optional parameters.
|
||||
|
||||
Required:
|
||||
|
||||
* `access_key` - (string) This is the Alicloud access key. It must be provided, but it can also be sourced from the `ALICLOUD_ACCESS_KEY` environment variable.
|
||||
|
||||
* `secret_key` - (string) This is the Alicloud secret key. It must be provided, but it can also be sourced from the `ALICLOUD_SECRET_KEY` environment variable.
|
||||
|
||||
* `region` - (string) This is the Alicloud region. It must be provided, but it can also be sourced from the `ALICLOUD_REGION` environment variables.
|
||||
|
||||
* `image_name` - (string) The name of the user-defined image, [2, 128] English or Chinese characters. It must begin with an uppercase/lowercase letter or a Chinese character, and may contain numbers, "_" or "-".It cannot begin with http:// or https://.
|
||||
|
||||
* `oss_bucket_name` (string) - The name of the OSS bucket where the RAW or VHD file will be copied to for import. If the Bucket isn't exist, post-process will create it for you.
|
||||
|
||||
* `image_os_type` (string) - Type of the OS linux/windows
|
||||
|
||||
* `image_platform` (string) - platform such "CentOS"
|
||||
|
||||
* `image_architecture` (string) - Platform type of the image system:i386 | x86_64
|
||||
|
||||
* `Format` (string) - The format of the image for import, now alicloud only support RAW and VHD.
|
||||
|
||||
Optional:
|
||||
|
||||
* `oss_key_name` (string) - The name of the object key in `oss_bucket_name` where the RAW or VHD file will be copied to for import.
|
||||
|
||||
* `skip_clean` (boolean) - Whether we should skip removing the RAW or VHD file uploaded to OSS after the import process has completed. "true" means that we should leave it in the OSS bucket, "false" means to clean it out. Defaults to `false`.
|
||||
|
||||
* `image_description` (string) The description of the image, with a length limit of 0 to 256 characters. Leaving it blank means null, which is the default value.It cannot begin with http:// or https://.
|
||||
|
||||
* `image_force_delete` (bool) If this value is true, when the target image name is duplicated with an existing image, it will delete the existing image and then create the target image, otherwise, the creation will fail. The default value is false.
|
||||
|
||||
* `image_system_size` (int) Size of the system disk, in GB, values range:
|
||||
<ul>
|
||||
<li>cloud - 5 ~ 2000
|
||||
<li>cloud_efficiency - 20 ~ 2048
|
||||
<li>cloud_ssd - 20 ~ 2048
|
||||
</ul>
|
||||
|
||||
## Basic Example
|
||||
|
||||
Here is a basic example. This assumes that the builder has produced an RAW artifact. The user must have the role "AliyunECSImageImportDefaultRole" with "AliyunECSImageImportRolePolicy", post-process will automatically configu the role and policy for you if you have the priviledge, otherwise, you have to ask the administer configure for you in advance.
|
||||
|
||||
``` {.javascript}
|
||||
"post-processors":[
|
||||
{
|
||||
"access_key":"{{user `access_key`}}",
|
||||
"secret_key":"{{user `secret_key`}}",
|
||||
"type":"alicloud-import",
|
||||
"oss_bucket_name": "packer",
|
||||
"image_name": "packer_import",
|
||||
"image_os_type": "linux",
|
||||
"image_platform": "CentOS",
|
||||
"image_architecture": "x86_64",
|
||||
"image_system_size": "40",
|
||||
"region":"cn-beijing"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
This will take the RAW generated by a builder and upload it to OSS. In this case, an existing bucket called `packer` in the `cn-beijing` region will be where the copy is placed.
|
||||
|
||||
Once uploaded, the import process will start, creating an Alicloud ECS image in the "cn-beijing" region with the name you specified in template file.
|
|
@ -79,6 +79,7 @@
|
|||
<li>
|
||||
<h4>Post-Processors</h4>
|
||||
</li>
|
||||
<li><a href="/docs/post-processors/alicloud-import.html">Alicloud Import</a></li>
|
||||
<li><a href="/docs/post-processors/amazon-import.html">Amazon Import</a></li>
|
||||
<li><a href="/docs/post-processors/artifice.html">Artifice</a></li>
|
||||
<li><a href="/docs/post-processors/atlas.html">Atlas</a></li>
|
||||
|
|
Loading…
Reference in New Issue