Skip to content

Machine create refinements#119

Draft
majst01 wants to merge 9 commits intomainfrom
machine-create-refinements
Draft

Machine create refinements#119
majst01 wants to merge 9 commits intomainfrom
machine-create-refinements

Conversation

@majst01
Copy link
Copy Markdown
Contributor

@majst01 majst01 commented Mar 27, 2026

Description

Contains API enhancements found during metal-apiserver implementation of machine create

Used AI-Tools ✨

  • none

@majst01 majst01 requested a review from a team as a code owner March 27, 2026 12:17
@majst01 majst01 marked this pull request as draft March 27, 2026 14:44
string project = 1 [(buf.validate.field).string.uuid = true];
// UUID if this field is set, this specific machine will be allocated if it is not in available state and not currently allocated.
// this field overrules size and partition
optional string uuid = 2 [(buf.validate.field).string.uuid = true];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field should be prevented for users and only used for admins.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in the apiserver

string partition = 6 [(buf.validate.field).string.(metalstack.api.v2.is_partition) = true];
// Size of the machine to create
string size = 7 [(buf.validate.field).string = {max_len: 128}];
// Partition the partition id to assign this machine to, must be omitted if uuid is given
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effectively, this is only optional for admins if they do allocation by UUID.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// MACHINE_STATE_UNSPECIFIED is not specified
MACHINE_STATE_UNSPECIFIED = 0 [(enum_string_value) = ""];
// MACHINE_STATE_RESERVED this machine is reserved
// MACHINE_STATE_RESERVED this machine is reserved, e.g. this machine is not considered during machine allocation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there is another term that we can use because this can easily be confused with machine size reservations.

It describes a machine that is not considered during machine allocation --> it's not in the waiting machine pool.

  • MACHINE_STATE_TAINTED ?

string ip = 1 [(buf.validate.field).string.ip = true];
// Namespace where this ip was created, usually the project of the namespaced tenant network.
optional string namespace = 2 [(buf.validate.field).string.uuid = true];
bool no_auto_acquire_ip = 2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can think about removing this functionality and just let the users pass IP addresses they want to have on the machine. If they do not provide any IPs, then we do auto acquisition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants