最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Using Cloudbase-Init for setting the password for the ECS windows instance in Open Telekom Cloud using Terraform - Stack Overflo

programmeradmin8浏览0评论

I have a windows ECS instance on Open Telekom Cloud and instead of using the key-pair I would like to set the admin Password when the instance will launch and the Cloudbase-init will run and set the password. So that I can login to the machine using that password.

For this I am using Terraform and this is the code looks like:

resource "opentelekomcloud_compute_instance_v2" "windows_ecs" {
name              = "test-windows"
flavor_id         = "s3.large.2"
image_name        = "Enterprise_Windows-Server_2022_STD_amd64_uefi_latest"
availability_zone = var.az

network {
  uuid = opentelekomcloud_vpc_subnet_v1.test_subnet.id
}

security_groups = [opentelekomcloud_networking_secgroup_v2.rdp_sg.name]

user_data = base64encode(file("${path.module}/bootstrap-windows.ps1"))

}

and then the bootstrap-windows.ps1 file is

    #ps1
    net user "Administrator" "SecurePassword!"
    net user Administrator /active:yes

when it provisioned the ecs I can see the script is running and then the ecs is rebooting but when I try to login to the machine using this set password, I am not able to do that.

Where am I going wrong, but for the linux machine this works.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论