【问题标题】:salt cloud launching EC2 servers into wrong subnetsalt cloud 将 EC2 服务器启动到错误的子网中
【发布时间】:2016-11-12 02:42:15
【问题描述】:

这真的很奇怪。我正在使用 salt-cloud 将一些 windows 2012 服务器启动到 EC2 中。而且我正在使用此配置文件:

ec2_private_win_app1:
    provider: company-nonpod-us-east-1
    image: ami-xxxxxx
    size: c4.large
    network_interfaces:
        - DeviceIndex: 0
    PrivateIpAddresses:
        - Primary: True
    #auto assign public ip (not EIP)
    AssociatePublicIpAddress: False
    SubnetId: subnet-A
    SecurityGroupId: sg-xxxxxx
    #block_device_mappings:
    #   - DeviceName: /dev/sda1
    #     Ebs.VolumeSize: 120
    #     Ebs.VolumeType: gp2
    #   - DeviceName: /dev/sdf
    #     Ebs.VolumeSize: 100
    #     Ebs.VolumeType: gp2
    tag: {'Engagement': '2112254190125', 'Owner': 'Tim', 'Name': 'production'}

并给出这个命令:

salt-cloud -p ec2_private_win_app1 USAB00005

生成的服务器最终位于 AWS 的这个子网中:

Subnet ID: subnet-B

我使用的是盐云版本:salt-cloud 2016.9.0-410-gdedfd82

在运行的服务器上:CentOS Linux release 7.2.1511

到底发生了什么?

【问题讨论】:

    标签: salt-stack salt-cloud


    【解决方案1】:

    这是一个 yaml 格式问题。我通过在线 yaml 解析器运行了 yaml,并能够纠正该问题:

    ec2_private_win_app1:
      provider: company-nonpod-us-east-1
      image: ami-xxxxx
      size: c4.large
      ssh_username: root
      network_interfaces:
         - DeviceIndex: 0
           SubnetId: subnet-xxxxxx
           PrivateIpAddresses:
             - Primary: True
       #auto assign public ip (not EIP)
       AssociatePublicIpAddress: False
       SecurityGroupId:
         - sg-xxxxxx
    

    基本上,我必须在 network_interfaces 部分中对子网 ID 进行分组,以便服务器出现在正确的子网中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-11-28
      • 2019-02-26
      • 2017-06-14
      • 2012-03-05
      • 2013-04-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多