fix website
This commit is contained in:
parent
50fadc4118
commit
2f927177d9
|
@ -1,142 +0,0 @@
|
||||||
---
|
|
||||||
description: |
|
|
||||||
The `alicloud-ecs` Packer builder plugin provide the capability to build
|
|
||||||
customized images based on an existing base images.
|
|
||||||
page_title: Alicloud Image Builder
|
|
||||||
---
|
|
||||||
|
|
||||||
# Alicloud Image Builder
|
|
||||||
|
|
||||||
Type: `alicloud-ecs`
|
|
||||||
Artifact BuilderId: `alibaba.alicloud`
|
|
||||||
|
|
||||||
The `alicloud-ecs` Packer builder plugin provide the capability to build
|
|
||||||
customized images based on an existing base images.
|
|
||||||
|
|
||||||
## Configuration Reference
|
|
||||||
|
|
||||||
The following configuration options are available for building Alicloud images.
|
|
||||||
In addition to the options listed here, a
|
|
||||||
[communicator](/docs/templates/legacy_json_templates/communicator) can be configured for this
|
|
||||||
builder.
|
|
||||||
|
|
||||||
### Required:
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudAccessConfig-required.mdx'
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/RunConfig-required.mdx'
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudImageConfig-required.mdx'
|
|
||||||
|
|
||||||
### Optional:
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudAccessConfig-not-required.mdx'
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudDiskDevices-not-required.mdx'
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/RunConfig-not-required.mdx'
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx'
|
|
||||||
|
|
||||||
@include 'packer-plugin-sdk/communicator/SSHTemporaryKeyPair-not-required.mdx'
|
|
||||||
|
|
||||||
@include 'packer-plugin-sdk/communicator/SSH-Key-Pair-Name-not-required.mdx'
|
|
||||||
|
|
||||||
@include 'packer-plugin-sdk/communicator/SSH-Private-Key-File-not-required.mdx'
|
|
||||||
|
|
||||||
@include 'packer-plugin-sdk/communicator/SSH-Agent-Auth-not-required.mdx'
|
|
||||||
|
|
||||||
# Disk Devices Configuration:
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudDiskDevice-not-required.mdx'
|
|
||||||
|
|
||||||
## Basic Example
|
|
||||||
|
|
||||||
Here is a basic example for Alicloud.
|
|
||||||
|
|
||||||
<Tabs>
|
|
||||||
<Tab heading="JSON">
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"variables": {
|
|
||||||
"access_key": "{{env `ALICLOUD_ACCESS_KEY`}}",
|
|
||||||
"secret_key": "{{env `ALICLOUD_SECRET_KEY`}}"
|
|
||||||
},
|
|
||||||
"builders": [
|
|
||||||
{
|
|
||||||
"type": "alicloud-ecs",
|
|
||||||
"access_key": "{{user `access_key`}}",
|
|
||||||
"secret_key": "{{user `secret_key`}}",
|
|
||||||
"region": "cn-beijing",
|
|
||||||
"image_name": "packer_test2",
|
|
||||||
"source_image": "centos_7_04_64_20G_alibase_201701015.vhd",
|
|
||||||
"ssh_username": "root",
|
|
||||||
"instance_type": "ecs.n1.tiny",
|
|
||||||
"io_optimized": "true",
|
|
||||||
"internet_charge_type": "PayByTraffic",
|
|
||||||
"image_force_delete": "true"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"provisioners": [
|
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"inline": ["sleep 30", "yum install redis.x86_64 -y"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
</Tab>
|
|
||||||
<Tab heading="HCL2">
|
|
||||||
|
|
||||||
```hcl
|
|
||||||
variable "access_key" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "secret_key" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
source "alicloud-ecs" "basic-example" {
|
|
||||||
access_key = var.access_key
|
|
||||||
secret_key = var.secret_key
|
|
||||||
region = "cn-beijing"
|
|
||||||
image_name = "packer_test2"
|
|
||||||
source_image = "centos_7_04_64_20G_alibase_201701015.vhd"
|
|
||||||
ssh_username = "root"
|
|
||||||
instance_type = "ecs.n1.tiny"
|
|
||||||
io_optimized = true
|
|
||||||
internet_charge_type = "PayByTraffic"
|
|
||||||
image_force_delete = true
|
|
||||||
}
|
|
||||||
|
|
||||||
build {
|
|
||||||
sources = ["sources.alicloud-ecs.basic-example"]
|
|
||||||
|
|
||||||
provisioner "shell" {
|
|
||||||
inline = [
|
|
||||||
"sleep 30", "yum install redis.x86_64 -y",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
</Tab>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
~> Note: Images can become deprecated after a while; run
|
|
||||||
`aliyun ecs DescribeImages` to find one that exists.
|
|
||||||
|
|
||||||
~> Note: Since WinRM is closed by default in the system image. If you are
|
|
||||||
planning to use Windows as the base image, you need enable it by userdata in
|
|
||||||
order to connect to the instance, check
|
|
||||||
[alicloud_windows.json](https://github.com/hashicorp/packer/tree/master/builder/alicloud/examples/basic/alicloud_windows.json)
|
|
||||||
and
|
|
||||||
[winrm_enable_userdata.ps1](https://github.com/hashicorp/packer/tree/master/builder/alicloud/examples/basic/winrm_enable_userdata.ps1)
|
|
||||||
for details.
|
|
||||||
|
|
||||||
See the
|
|
||||||
[examples/alicloud](https://github.com/hashicorp/packer/tree/master/builder/alicloud/examples)
|
|
||||||
folder in the Packer project for more examples.
|
|
|
@ -1,73 +0,0 @@
|
||||||
---
|
|
||||||
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.
|
|
||||||
page_title: Alicloud Import Post-Processor
|
|
||||||
---
|
|
||||||
|
|
||||||
# Alicloud Import Post-Processor
|
|
||||||
|
|
||||||
Type: `alicloud-import`
|
|
||||||
Artifact BuilderId: `packer.post-processor.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 by 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:
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudAccessConfig-required.mdx'
|
|
||||||
|
|
||||||
@include 'builder/alicloud/ecs/AlicloudImageConfig-required.mdx'
|
|
||||||
|
|
||||||
@include 'post-processor/alicloud-import/Config-required.mdx'
|
|
||||||
|
|
||||||
### Optional:
|
|
||||||
|
|
||||||
- `keep_input_artifact` (boolean) - if true, do not delete the RAW or VHD
|
|
||||||
disk image after importing it to the cloud. Defaults to false.
|
|
||||||
|
|
||||||
@include 'post-processor/alicloud-import/Config-not-required.mdx'
|
|
||||||
|
|
||||||
## Basic Example
|
|
||||||
|
|
||||||
Here is a basic example. This assumes that the builder has produced a RAW
|
|
||||||
artifact. The user must have the role `AliyunECSImageImportDefaultRole` with
|
|
||||||
`AliyunECSImageImportRolePolicy`, post-process will automatically configure the
|
|
||||||
role and policy for you if you have the privilege, otherwise, you have to ask
|
|
||||||
the administrator configure for you in advance.
|
|
||||||
|
|
||||||
```json
|
|
||||||
"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.
|
|
|
@ -901,10 +901,6 @@
|
||||||
"title": "Overview",
|
"title": "Overview",
|
||||||
"path": "post-processors"
|
"path": "post-processors"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"title": "Alicloud Import",
|
|
||||||
"path": "post-processors/alicloud-import"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"title": "Artifice",
|
"title": "Artifice",
|
||||||
"path": "post-processors/artifice"
|
"path": "post-processors/artifice"
|
||||||
|
|
Loading…
Reference in New Issue