Google Cloud 不会替换有状态管理实例组内的实例
使用以下代码创建的托管实例组,但在“替换 VMS”时出现此错误:
Failed to update instance group ssv-node-igm: UpdatePolicy with type set to PROACTIVE and replacementMethod different than RECREATE is not allowed when Stateful is used (instanceGroupManager has statefulPolicy or perInstanceConfigs). Set replacementMethod to RECREATE to apply this update.
此外,MIG 不会替换运行状况检查失败的 VM,但会给出“实例正在验证”以获取更多信息超过6小时。
代码:
resource "google_compute_health_check" "autohealing" {
name = "${var.name_space}-ssv-health-check"
check_interval_sec = 5
timeout_sec = 5
healthy_threshold = 2
unhealthy_threshold = 10
tcp_health_check {
port = "13000"
}
}
resource "google_compute_instance_group_manager" "ssv-node" {
name = "ssv-node-igm"
base_instance_name = "${var.name_space}-ssv-node"
zone = "us-central1-a"
version {
instance_template = google_compute_instance_template.ssv-template.id
name = "${var.name_space}-ssv-node-igm-v1"
}
target_size = 1
stateful_disk {
device_name = "${var.name_space}-boot"
}
stateful_disk {
device_name = "${var.name_space}-data"
}
named_port {
name = "customhttp"
port = 8888
}
auto_healing_policies {
health_check = google_compute_health_check.autohealing.id
initial_delay_sec = 30
}
update_policy {
type = "PROACTIVE"
minimal_action = "REPLACE"
max_surge_fixed = 0
max_unavailable_fixed = 1
replacement_method = "RECREATE"
}
}
您可以发现更新策略与错误消息建议的操作完全相同,但仍然出现相同的错误。
提出任何建议!
A managed instance group created with below code, but when "replace VMS", got this error:
Failed to update instance group ssv-node-igm: UpdatePolicy with type set to PROACTIVE and replacementMethod different than RECREATE is not allowed when Stateful is used (instanceGroupManager has statefulPolicy or perInstanceConfigs). Set replacementMethod to RECREATE to apply this update.
Also the MIG does not replace the VM failed on health check, but giving "Instance is being verified" for more than 6 hours.
The code:
resource "google_compute_health_check" "autohealing" {
name = "${var.name_space}-ssv-health-check"
check_interval_sec = 5
timeout_sec = 5
healthy_threshold = 2
unhealthy_threshold = 10
tcp_health_check {
port = "13000"
}
}
resource "google_compute_instance_group_manager" "ssv-node" {
name = "ssv-node-igm"
base_instance_name = "${var.name_space}-ssv-node"
zone = "us-central1-a"
version {
instance_template = google_compute_instance_template.ssv-template.id
name = "${var.name_space}-ssv-node-igm-v1"
}
target_size = 1
stateful_disk {
device_name = "${var.name_space}-boot"
}
stateful_disk {
device_name = "${var.name_space}-data"
}
named_port {
name = "customhttp"
port = 8888
}
auto_healing_policies {
health_check = google_compute_health_check.autohealing.id
initial_delay_sec = 30
}
update_policy {
type = "PROACTIVE"
minimal_action = "REPLACE"
max_surge_fixed = 0
max_unavailable_fixed = 1
replacement_method = "RECREATE"
}
}
You can find that update policy is exactly same as what error message suggest to do, but still get same error.
Appricate any suggestion!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有一张 Google 支持票,问题是 GUI 问题。使用下面的 cli,它可以工作。
除此之外,对于使用运行状况检查的任何人来说,还有一个注意事项:在 MIG 终止不运行状况的实例之前,您必须具有运行状况。换句话说,如果您的实例从未达到健康状态,它将永远保留。
I had a ticket with Google support, and the issue was GUI issue. With below cli, it works.
Beyond that, another note for anyone using healthcheck: You have to have an health status before the MIG can terminate unhealthy instances. In another word, if your instance never reached health status, it will keep forever.