

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# VM 匯入資訊清單
<a name="manifest"></a>

匯入資訊清單是由 Amazon EC2 API 操作 [ImportInstance](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html) 和 [ImportVolume](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportVolume.html) 建立和使用的 XML 檔案。請注意， 不支援這些操作 AWS CLI。

資訊清單允許虛擬機器映像分成小部分進行傳輸，然後在目的地重新組合，並支援重試失敗的部分傳輸。此檔案通常由 Amazon EC2 工具建立、取用和銷毀，無需使用者介入。

在某些特殊情況下，開發人員可能會希望以手動或程式設計方式建構資訊清單，使其可以繞過某些 API 操作，同時仍然為需要檔案作為參數值的其他操作提供資訊清單。

本主題會記錄資訊清單的結構，並提供範例檔案。

**注意**  
資訊清單的直接操作來自 Amazon EC2 API 的標準工作流程。我們建議您改為遵循 [VM Import/Export 程序中](https://docs.aws.amazon.com/vm-import/latest/userguide/import-export-processes.html)的程序。

## 資訊清單結構描述
<a name="manifest_file_elements"></a>

以下結構描述說明資訊清單的格式。結構描述元素的文件會以內嵌方式呈現。

```
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="manifest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="version" type="xs:string">
                    <xs:annotation>
                        <xs:documentation> Version designator for the manifest file,
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="file-format" type="xs:string">
                    <xs:annotation>
                        <xs:documentation> File format of volume to be imported, with value RAW,
                            VHD, or VMDK. </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="importer" type="Importer">
                    <xs:annotation>
                        <xs:documentation> Complex type describing the software that created the
                            manifest. </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="self-destruct-url" type="xs:anyURI">
                    <xs:annotation>
                        <xs:documentation> Signed URL used to delete the stored manifest file.
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="import" type="Import">
                    <xs:annotation>
                        <xs:documentation> Complex type describing the size and chunking of the
                            volume file. </xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="Importer">
        <xs:sequence>
            <xs:element name="name" type="xs:string">
                <xs:annotation>
                    <xs:documentation> Name of the software that created the manifest.
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="version" type="xs:string">
                <xs:annotation>
                    <xs:documentation> Version of the software that created the manifest.
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="release" type="xs:string">
                <xs:annotation>
                    <xs:documentation> Release number of the software that created the manifest.
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Import">
        <xs:sequence>
            <xs:element name="size" type="xs:long">
                <xs:annotation>
                    <xs:documentation> Exact size of the file to be imported (bytes on disk).
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="volume-size" type="xs:long">
                <xs:annotation>
                    <xs:documentation> Rounded size in gigabytes of volume to be imported.
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="parts" type="Parts">
                <xs:annotation>
                    <xs:documentation> Complex type describing and counting the parts into which the
                        file is split. </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Parts">
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="unbounded" name="part" type="Part">
                <xs:annotation>
                    <xs:documentation> Definition of a particular part. Any number of parts may be
                        defined. </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="count" type="xs:int">
            <xs:annotation>
                <xs:documentation> Total count of the parts. </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="Part">
        <xs:sequence>
            <xs:element name="byte-range" type="ByteRange">
                <xs:annotation>
                    <xs:documentation> Complex type defining the starting and ending byte count of a
                        part. </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="key" type="xs:string">
                <xs:annotation>
                    <xs:documentation> The S3 object name of the part. </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="head-url" type="xs:anyURI">
                <xs:annotation>
                    <xs:documentation> Signed URLs for issuing a HEAD request on the S3 object
                        containing this part. </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="get-url" type="xs:anyURI">
                <xs:annotation>
                    <xs:documentation> Signed URLs for issuing a GET request on the S3 object
                        containing this part. </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="delete-url" minOccurs="0" type="xs:anyURI">
                <xs:annotation>
                    <xs:documentation> Signed URLs for issuing a DELETE request on the S3 object
                        containing this part. </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="index" type="xs:int">
            <xs:annotation>
                <xs:documentation> Index number of this part. </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="ByteRange">
        <xs:attribute name="start" type="xs:long">
            <xs:annotation>
                <xs:documentation> Offset of a part's first byte in the disk image.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="end" type="xs:long">
            <xs:annotation>
                <xs:documentation> Offset of a part's last byte in the disk image.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
</xs:schema>
```

## 範例
<a name="sample_manifest_file"></a>

這個資訊清單的第一個範例說明具有兩個部分的磁碟區映像。包含組件的檔案位於本機系統上，且必須上傳至 Amazon S3。

```
<manifest>
    <version>2010-11-15</version>
    <file-format>VMDK</file-format>
    <importer>
        <name>ec2-upload-disk-image</name>
        <version>1.0.0</version>
        <release>2010-11-15</release>
    </importer>
    <self-destruct-url>https://example-disk-part-bucket.s3.amazonaws.com/d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdkmanifest.xml?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&amp;Expires=1416618486&amp;Signature=m%2Bl%2FkuKuvfEeD%2Fya%2B0TrgeiH%2FLM%3D</self-destruct-url>
    <import>
        <size>12595200</size>
        <volume-size>1</volume-size>
        <parts count="2">
            <part index="0">
                <byte-range end="10485759" start="0"/>
                <key>d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part0</key>
                <head-url>https://example-disk-part-bucket.s3.amazonaws.com/d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part0?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&amp;Expires=1416618486&amp;Signature=2yqS2VGYXGmqcbu%2FrQEn8FGIKaI%3D</head-url>
                <get-url>https://example-disk-part-bucket.s3.amazonaws.com/d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part0?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&amp;Expires=1416618486&amp;Signature=nEvl8VhFoEuIjJFRkAYB2IWKRtY%3D</get-url>
                <delete-url>https://example-disk-part-bucket.s3.amazonaws.com/d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part0?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&amp;Expires=1416618486&amp;Signature=CX19zc4Eys8BN%2FXsoepk%2Bi3i4No%3D</delete-url>
            </part>
            <part index="1">
                <byte-range end="12595199" start="10485760"/>
                <key>d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part1</key>
                <head-url>https://example-disk-part-bucket.s3.amazonaws.com/d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&amp;Expires=1416618486&amp;Signature=3b%2F8ky92L8g%2BBf15Ou194VnR4Js%3D</head-url>
                <get-url>https://example-disk-part-bucket.s3.amazonaws.com/d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&amp;Expires=1416618486&amp;Signature=W%2FxagI5ChmfqqgY8WwyDJ3Rgviw%3D</get-url>
                <delete-url>https://example-disk-part-bucket.s3.amazonaws.com/d6e1ca17-72f6-4ab0-b2c8-d7ba8186cb23/cirros-0.3.2-x86_64-disk.vmdk.part1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&amp;Expires=1416618486&amp;Signature=08FH3QPwkIcNURnNpT9DIvvhQ0I%3D</delete-url>
            </part>
        </parts>
    </import>
</manifest>
```

第二個範例說明具有單一部分且已上傳至 Amazon S3 的磁碟區映像。

```
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<manifest>
    <version>2010-11-15</version>
    <file-format>VMDK</file-format>
    <importer>
        <name>Linux_RHEL_59_64.vmdk</name>
        <version>1.0.0</version>
        <release>2010-11-15</release>
    </importer>
    <self-destruct-url>https://example-disk-part-bucket.s3.ap-northeast-2.amazonaws.com/Linux_RHEL_59_64.vmdk?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAJ26ZRPZDGYJT4KAQFEXAMPLE%2Fap-northeast-2%2Fs3%2Faws4_request&amp;X-Amz-Date=20151119T234529Z&amp;X-Amz-Expires=604800&amp;X-Amz-Signature=4dbf803f2e52fb6a876d3b63778033af42ec11155b37366ab4fca56691672807&amp;X-Amz-SignedHeaders=Host</self-destruct-url>
    <import>
        <size>994433536</size>
        <volume-size>1</volume-size>
        <parts count="1">
            <part index="0">
                <byte-range end="994433536" start="0"/>
                <key>Linux_RHEL_59_64.vmdk</key>
                <head-url>https://example-disk-part-bucket.s3.ap-northeast-2.amazonaws.com/Linux_RHEL_59_64.vmdk?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAJ26ZRPZDGYJT4KAQFEXAMPLE%2Fap-northeast-2%2Fs3%2Faws4_request&amp;X-Amz-Date=20151119T234529Z&amp;X-Amz-Expires=604800&amp;X-Amz-Signature=4c3a7bdf3ef8fa53a5585fc67747c81ea1f65bf09f3768998a575dabf5dfda2e&amp;X-Amz-SignedHeaders=Host</head-url>
                <get-url>https://example-disk-part-bucket.s3.ap-northeast-2.amazonaws.com/Linux_RHEL_59_64.vmdk?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAJ26ZRPZDGYJT4KAQFEXAMPLE%2Fap-northeast-2%2Fs3%2Faws4_request&amp;X-Amz-Date=20151119T234529Z&amp;X-Amz-Expires=604800&amp;X-Amz-Signature=329d6abb673e4ce11c0aa602f34f62fb8ced703e8ae6c04f24c16e79d7699e52&amp;X-Amz-SignedHeaders=Host</get-url>
                <delete-url>https://example-disk-part-bucket.s3.ap-northeast-2.amazonaws.com/Linux_RHEL_59_64.vmdk?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAJ26ZRPZDGYJT4KAQFEXAMPLE%2Fap-northeast-2%2Fs3%2Faws4_request&amp;X-Amz-Date=20151119T234529Z&amp;X-Amz-Expires=604800&amp;X-Amz-Signature=4dbf803f2e52fb6a876d3b63778033af42ec11155b37366ab4fca56691672807&amp;X-Amz-SignedHeaders=Host</delete-url>
            </part>
        </parts>
    </import>
</manifest>
```