TritonDataCenter / TritonDataCenter/sdc-adminui

Default hostname to name/alias when provisioning a new VM

Open
#266 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
16
Forks
26
Avg merge
2d 15h
Merged PRs (30d)
1

Description

Any time I provision a VM through AdminUI such as a native SmartOS zone and then SSH into the zone, the hostname is the UUID which makes for an unfriendly PS1 so I need to run mdata-get sdc:alias > /etc/nodename && reboot to change it but that won't persist across reprovisions. It seems like creating a VM via node-triton (CloudAPI) defaults the hostname to the VM name/alias so AdminUI should be consistent.

I also tried manually calling VMAPI after the VM was provisioned to update the hostname but according to the documentation hostname is not a field that can be updated.

[root@headnode (neptune) ~]# sdc-vmapi /vms/73d03c63-c00a-4c67-bc5c-3047eeb78312?action=update -X POST -d '{"hostname":"nginx"}'
HTTP/1.1 409 Conflict
Connection: close
Content-Type: application/json
Content-Length: 77
Date: Fri, 06 May 2022 19:09:57 GMT
Server: VMAPI/9.14.1
x-request-id: 9cd50b8b-8468-42d5-88f8-0f386a65a189
x-response-time: 19
x-server-name: 50172949-5150-42ba-967d-c1e3434820d9

{
  "code": "ValidationFailed",
  "message": "No VM parameters provided",
  "errors": []
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the AdminUI VM provisioning entry point and compare its hostname handling with node-triton through CloudAPI. Check the VMAPI hostname update behavior described in the issue, then verify that a newly provisioned VM uses its name or alias as the hostname and retains that value after reprovisioning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.