Affected Resources
- resource "cloudstack_instance"
- resource "cloudstack_user_data"
Description
I have deployed Apache Cloudstack and I want to create instances with userdata.
My userdata is merely 7544 bytes but when the provider tries to issue a GET method during orchestration the error code 4350 is thrown.
I have tried pasting userdata in the webui and referencing on the instance but the same issue is thrown, see below.
I have tried increasing the vm.userdata.max.length setting from 32768 to 1048576 , but it didn't help.
My userdata:
output "user_data_size_bytes" {
value = length(base64encode(local.my-vm_cloudinit))
}
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
user_data_size_bytes = 7544
I am not sure what the solution for this is since I have not delved into the code, but in the documentation there seems to be a higher limit for POST method in the API, maybe this could solve this issue?
HTTP GET parameters are limited to a length of 2048 bytes, but it is possible to store larger User Data blobs by sending them in the body via HTTP POST instead of GET.
Provider resource snippets
|
ud, err := getUserData(userData.(string)) |
|
p := cs.User.NewRegisterUserDataParams(d.Get("name").(string), d.Get("userdata").(string)) |
Debug output
cloudstack_user_data.my-vm: Creating...
╷
│ Error: Error registering user data: CloudStack API error 431 (CSExceptionErrorCode: 4350): User data is too long for http GET request
cloudstack_instance.my-vm: Creating...
╷
│ Error: Error creating the new instance my-vm: CloudStack API error 431 (CSExceptionErrorCode: 4350): User data is too long for http GET request
Affected Resources
Description
I have deployed Apache Cloudstack and I want to create instances with userdata.
My userdata is merely
7544 bytesbut when the provider tries to issue a GET method during orchestration the error code4350is thrown.I have tried pasting userdata in the webui and referencing on the instance but the same issue is thrown, see below.
I have tried increasing the
vm.userdata.max.lengthsetting from32768to1048576, but it didn't help.My userdata:
Apply complete! Resources: 0 added, 0 changed, 0 destroyed. Outputs: user_data_size_bytes = 7544I am not sure what the solution for this is since I have not delved into the code, but in the documentation there seems to be a higher limit for POST method in the API, maybe this could solve this issue?
Provider resource snippets
cloudstack-terraform-provider/cloudstack/resource_cloudstack_instance.go
Line 453 in 16915b6
cloudstack-terraform-provider/cloudstack/resource_cloudstack_user_data.go
Line 91 in 16915b6
Debug output
cloudstack_user_data.my-vm: Creating... ╷ │ Error: Error registering user data: CloudStack API error 431 (CSExceptionErrorCode: 4350): User data is too long for http GET requestcloudstack_instance.my-vm: Creating... ╷ │ Error: Error creating the new instance my-vm: CloudStack API error 431 (CSExceptionErrorCode: 4350): User data is too long for http GET request