如何启动从其他区域复制的AMI实例?

时间:2018-03-03 07:24:47

标签: amazon-web-services amazon-ec2 ami packer

使用Packer我在北弗吉尼亚州创建了AMI(us-east-1)。下面是它的构建器代码段。

import SpriteKit

class Circle: SKSpriteNode {

    var ringSize: CGFloat = 96 {
        // Use an observer to update myRing if this changes.
        didSet { configureMyRing() }
    }

    var ringColor = SKColor.white {
        didSet { configureMyRing() }
    }

    var ringWidth: CGFloat = 8 {
        didSet { configureMyRing() }
    }

    // This can be a let instead of a var because I'm never going to
    // set it to a different object. Note that I'm not bothering to
    // initialize myRing's path or any other property here, because
    // I can just call configureMyRing in my init (after the call to
    // super.init).
    let myRing = SKShapeNode()

    override init(texture: SKTexture?, color: SKColor, size: CGSize) {
        super.init(texture: texture, color: color, size: size)

        // Call this now to set up myRing's path and other properties.
        configureMyRing()
    }

    convenience init() {
        self.init(color: SKColor.clear, size: CGSize(width: 100, height: 100))

        // No need to do anything to myRing now, because my designated
        // initializer set it up completely.

        addChild(myRing)
        print("I'm on the screen")

        // Commented out because you didn't provide this property
        // or method in your question.
//        explodeGroup = create_explosionActionGroup()
        }

    convenience init(color: SKColor, size: CGSize, position: CGPoint) {
        self.init(color: color, size: size)
        self.position = position

        // Commented out because you didn't provide this property
        // or method in your question.
//        explodeGroup = create_explosionActionGroup()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    private func configureMyRing() {
        myRing.path = CGPath(ellipseIn: CGRect(x: -ringSize / 2, y: -ringSize / 2, width: ringSize, height: ringSize), transform: nil)
        myRing.strokeColor = ringColor
        myRing.lineWidth = ringWidth
    }
}

我在us-east-1中启动此AMI没有任何问题。但是当我把它复制到孟买(ap-south-1)并尝试启动它时

  

不支持此AWS Marketplace产品的实例配置。有关支持的实例类型,区域和操作系统的详细信息,请参阅AWS Marketplace网站。

大多数设置都保留为默认值,因此不确定导致此问题的原因。任何指针都会有很大的帮助。

1 个答案:

答案 0 :(得分:0)

由于许可限制,市场AMI无法在帐户之间移动

来源:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html

  

您无法使用相关的billingProduct代码复制AMI   与您分享来自其他帐户。这包括Windows AMI和   来自AWS Marketplace的AMI。使用a复制共享AMI   billingProduct代码,使用您的帐户启动EC2实例   共享AMI,然后从实例创建AMI。更多   信息,请参阅创建Amazon EBS支持的Linux AMI。

相关问题