如何使用Ansible将SSD磁盘添加到Google计算引擎实例?

时间:2014-12-26 23:54:02

标签: google-compute-engine ansible ssd google-cloud-platform

Ansible有gce_pd模块:http://docs.ansible.com/gce_pd_module.html。根据文档,您可以指定大小和模式(READ,READ-WRITE),但不能指定类型(SSD与标准)。是否可以使用gce_pd模块创建SSD磁盘?

2 个答案:

答案 0 :(得分:1)

截至目前,https://github.com/ansible/ansible-modules-core/blob/devel/cloud/google/gce_pd.py根本没有提到SSD,所以似乎不支持。如果这是您真正需要的,请考虑提交功能请求。

答案 1 :(得分:1)

现在可以在Ansible中使用。

根据updated official docs,Ansible 1.9中添加了disk_type

disk_type可以包含以下值:

  • pd-standard
  • pd-ssd

以下是一个例子:

# Simple attachment action to an existing instance
- local_action:
    module: gce_pd
    name: mongodata
    instance_name: www1
    size_gb: 30
    disk_type: pd-ssd
相关问题