【发布时间】:2019-10-28 20:38:23
【问题描述】:
本周或上周,MS 更改了 Azure DB 默认部署设置。 我们的部署脚本开始创建通用 2 vcores 实例而不是 S0 实例。我正在尝试修复它,但看起来要么文档不正确,要么我做错了什么。
我们的初始脚本是:
azure_rm_sqldatabase:
resource_group: "{{ resource_group }}"
server_name: "{{ db_server }}"
name: "{{ item }}"
location: "{{ location }}"
with_items:
- "{{ database_list }}"
register: async_result
async: 7200
poll: 0
根据文档,它应该可以通过添加 2 个参数来解决。
版本:标准
max_size_bytes:268435456000
但事实证明这还不够。
我尝试使用 create_mode 或减少 max_size_bytes 但没有运气。
- name: Create SQL Database for "{{ stack_name }}"
azure_rm_sqldatabase:
resource_group: "{{ resource_group }}"
server_name: "{{ db_server }}"
name: "{{ item }}"
location: "{{ location }}"
create_mode: default
edition: standard
max_size_bytes: 268435456000
在所有情况下我都会遇到错误:
failed: [127.0.0.1] (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_item_label': u'authentication',
u'ansible_job_id': u'701489864709.12193', 'failed': False, u'started': 1, 'changed': True, 'item': u'authentication', u'finished': 0,
u'results_file': u'/home/vb/.ansible_async/701489864709.12193', '_ansible_ignore_errors': None, '_ansible_no_log': False}) =>
{"ansible_job_id": "701489864709.12193", "attempts": 2, "changed": false, "finished": 1,
"item": {"ansible_job_id": "701489864709.12193", "changed": true, "failed": false, "finished": 0, "item": "authentication",
"results_file": "/home/vb/.ansible_async/701489864709.12193", "started": 1}, "msg":
"Error creating the SQL Database instance: 400 Client Error:
Bad Request for url: https://management.azure.com/subscriptions/1bbba5c5-fbdb-18d7-8128-b4d403d7c6c5/resourceGroups/test_rg/providers/Microsoft.Sql/servers/testserver/databases/authentication?api-version=2014-04-01"}
请让我知道我做错了什么。
更新: 将 ansible 升级到最新版本后,我遇到了另一个错误:
DeserializationError: Unable to deserialize response data. Data: 268435456000, long, ValueError: invalid literal for long() with base 10: '268435456000\\xe2\\x80\\xac'"
我减小了 db 大小,创建了数据库,但是它不是 S0,而是创建为 2vcore。
【问题讨论】:
标签: ansible azure-sql-database