vultr / terraform-provider-vultr-community

Terraform Vultr provider
Mozilla Public License 2.0
50 stars 7 forks source link

[BUG] - Create server that is using PXE startup_script #82

Closed superseb closed 5 years ago

superseb commented 5 years ago

Describe the bug I want to create a server and use the iPXE Custom Script option, as available in the UI (via Upload ISO -> iPXE Custom Script) which contains a iPXE script.

To Reproduce Steps to reproduce the behavior:

  1. Create a server
    
    resource "vultr_server" "ipxe" {
    region_id            = "1"
    plan_id              = "202"
    script_id            = "${vultr_startup_script.pxe.id}"
    }

resource "vultr_startup_script" "pxe" { name = "pxe" type = "pxe" script = "pxe script" }

2. Run `terraform apply`

**Expected behavior**
Create the server using the iPXE custom script just as in the UI.

**Desktop (please complete the following information where applicable:**
 - Version : v1.0.0

**Additional context**

If you leaved out any of the required reference IDs, you get the error:

Error: Please select at least one of the following os_id, app_id, iso_id or snapshot_id


If you set the `os_id` to the `Custom` one (`159`), you end up with:

Error: Please set a corrosponding attribute



If I comment out this error (https://github.com/vultr/terraform-provider-vultr/blob/master/vultr/resource_vultr_server.go#L274), it seems to work fine (I get the result I want)
ddymko commented 5 years ago

@superseb

Thanks for creating the issue. We will take a look into this and get back to you!

afady commented 5 years ago

This issue was fixed in v1.0.1