Which number should be used as max_length restriction for instance_name field?

Asked by Yuanhui Liu

Current code doesn't have restriction on max_length for instance_name field in "update instance". When I did the test, I saw the backend seems to be using "255" as the max_length checking, as shown in the message below:

RESP BODY: {"badRequest": {"message": "Server name has more than 255 characters.", "code": 400}}

But current code in "create instance" does restrict the max_length for instance_name field, and it seems to be using "80" as the max_length restriction, as shown in the code below:

name = forms.CharField(max_length=80, label=_("Instance Name"))

So just would like to confirm which number should I use as the max_length to restrict the instance_name field in "update instance"? 80 or 255?

Thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Dashboard (Horizon) Edit question
Assignee:
No assignee Edit question
Solved by:
Yuanhui Liu
Solved:
Last query:
Last reply:
Revision history for this message
Ana Krivokapić (akrivoka) said :
#1

Since Nova allows for instance names of up to 255 chars, I see no reason to restrict it to 80 in Horizon. IMO, the create instance form should be changed to allow up to 255 chars, and the same restriction should be applied in edit instance form.

Revision history for this message
Yuanhui Liu (liuyu) said :
#2

Thanks Ana for your response!