gpt4 book ai didi

azure - terraform 中的 DomainJoin 部分给了我以下代码 "VMExtensionProvisioningError"

转载 作者:行者123 更新时间:2023-12-03 06:17:05 28 4
gpt4 key购买 nike

错误消息:


Error: Code="VMExtensionProvisioningError" Message="VM has reported a failure when processing extension 'domainZone-domainJoin'. Error message: \"Exception(s) occured while joining Domain 'domainZOne.zone'\"\r\n\r\nMore information on troubleshooting is available at https://aka.ms/vmextensionwindowstroubleshoot "

│ with azurerm_virtual_machine_extension.domainJoin[1],
│ on main.tf line 194, in resource "azurerm_virtual_machine_extension" "domainJoin":
│ 194: resource "azurerm_virtual_machine_extension" "domainJoin" {

当前的实现:

resource "azurerm_virtual_machine_extension" "domainJoin" {
count = var.nb_instances #2 #module.winserv.nb_instances #"${var.domain_joined ? var.rdsh_count : 0}"
name = "datashieldzone-domainJoin"
# name = "${var.vm_hostname}-${count.index + 1}-domainJoin"
virtual_machine_id = module.winserv.vm_ids[count.index]
publisher = "Microsoft.Compute"
type = "JsonADDomainExtension"
type_handler_version = "1.3"
auto_upgrade_minor_version = true

depends_on = [
module.winserv,
]
#"/subscriptions/<subscription id>/resourceGroups/WIN10/providers/Microsoft.Compute/virtualMachines/win10addsman" #"${azurerm_virtual_machine.main.*.name[count.index]}"

lifecycle {
ignore_changes = [
settings,
protected_settings,
]
}

settings = <<SETTINGS
{
"Name": "${var.domain_name}",
"User": "${var.domain_adminuser}",
"OUPath": "${var.domain_ou}",
"Restart": "true",
"Options": "3"
}
SETTINGS

protected_settings = <<PROTECTED_SETTINGS
{
"Password": "${var.domain_password}"
}
PROTECTED_SETTINGS

}

我正在使用 Microsoft 的指南,但我似乎使用了正确的扩展。我正在本地计算机上手动执行此操作,并给了我这个问题。如果我在 Github Actions 下运行此管道,一切看起来都很好,但我不知道为什么本地会给出这些错误消息。

有人对这个问题有什么见解吗?有没有人有任何可能的解决方案?

最佳答案

最初,当我们为虚拟机创建域加入扩展时,我在我的环境中遇到了相同的错误。

错误: enter image description here

上述错误表明虚拟机无法加入域;因此,请检查参数domainToJoin、ouPath、existingDomainUPN和existingDomainPassword是否提供了正确的值。

我尝试了正确的域 Controller 设置并使用了相同的代码。

main.tf

provider "azurerm" {
features {}

}
data "azurerm_resource_group" "example" {
name = "resource-grp"
}

data "azurerm_virtual_machine" "example"{
name = "vm-name"
resource_group_name = data.azurerm_resource_group.example.name
}
resource "azurerm_virtual_machine_extension" "domainJoin" {
name = "datashieldzone-domainJoin"
# name = "${var.vm_hostname}-${count.index + 1}-domainJoin"
virtual_machine_id = data.azurerm_virtual_machine.example.id
publisher = "Microsoft.Compute"
type = "JsonADDomainExtension"
type_handler_version = "1.3"
auto_upgrade_minor_version = true

lifecycle {
ignore_changes = [
settings,
protected_settings,
]
}

settings = <<SETTINGS
{
"Name": "<domainname>.com",
"User": "<domainname>\\<username>",
"OUpath":"",
"Restart": "true",
"Options": "3"
}
SETTINGS
protected_settings = <<PROTECTED_SETTINGS
{
"Password": "<Password>"
}
PROTECTED_SETTINGS
depends_on = [data.azurerm_virtual_machine.example]
}

输出: enter image description here

门户:

enter image description here

虚拟机:

enter image description here

关于azure - terraform 中的 DomainJoin 部分给了我以下代码 "VMExtensionProvisioningError",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76167956/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com