Skip to content

Bug Report: Userdata request size limits #269

@Diskoteket

Description

@Diskoteket

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions