TRITON-2504

VMAPI should support reprovision for bhyve branded zones.

Status:
Resolved
Created:
2025-09-05T12:53:24.572-0400
Updated:
2025-09-10T11:52:45.470-0400

Comments (1)

Dan McDonald commented on 2025-09-08T10:22:04.657-0400:

Deployed on Kebecloud to test on the same VM documented in OS-8683 here: OS-8683?focusedCommentId=132359

First I installed the experimental build on the head node.

[root@moe (kebecloud) ~]# sdcadm health vmapi
INSTANCE                              SERVICE  HOSTNAME  ALIAS   HEALTHY
bdd3c089-444a-43de-9f0f-ad92dbece8de  vmapi    moe       vmapi0  true
00000000-0000-0000-0000-0cc47a07f6ee  global   headnode  global  true
[root@moe (kebecloud) ~]# sdcadm services vmapi
sdcadm services: error (Usage): too many args: vmapi
[root@moe (kebecloud) ~]# sdcadm services | grep vmapi
vm     6c830538-2c09-46ca-a295-73eb5e1c1f1b  vmapi                  01686563-e2fa-463f-8548-dac9a47f9a60  1
[root@moe (kebecloud) ~]# 

Then let’s kick off a reprovision using VMAPI itself:

[root@moe (kebecloud) ~]# sdc-vmapi /vms/b66a6b8a-7e4f-4d98-9787-d39b0cfa5995\?action=reprovision -X POST -d '{ "image_uuid": "d89041d8-41b9-481d-918a-722be4598dd1" }'
HTTP/1.1 202 Accepted
Connection: close
workflow-api: http://workflow.kebecloud.work.kebe.com
Content-Type: application/json
Content-Length: 100
Date: Mon, 08 Sep 2025 14:08:48 GMT
Server: VMAPI/9.16.0
x-request-id: 68bb21b4-0254-4c9b-9a0a-7ab9bb283777
x-response-time: 161
x-server-name: bdd3c089-444a-43de-9f0f-ad92dbece8de

{
  "vm_uuid": "b66a6b8a-7e4f-4d98-9787-d39b0cfa5995",
  "job_uuid": "ff6e46d2-9f64-470c-89bc-6474cd7078ae"
}
[root@moe (kebecloud) ~]# 

Here’s before-and-after ssh-ing into the target VM.

hideo(~)[1]% ssh root@172.24.4.185
Enter passphrase for key '/home/danmcd/.ssh/id_ed25519': 
Linux b66a6b8a-7e4f-4d98-9787-d39b0cfa5995 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64

      *--+--*--*
     /| /| /| /|
    / |/ |/ |/ |    #####  ####   #  #####  ###   #   # TM
   +--*--+--*--*      #    #   #  #    #   #   #  ##  #
   | /| /| /| /|      #    ####   #    #   #   #  # # #
   |/ |/ |/ |/ |      #    #  #   #    #   #   #  #  ##
   *--+--+--+--+      #    #   #  #    #    ###   #   #
   | /| /| /| /
   |/ |/ |/ |/
   *--*--+--*

  HVM Instance (Debian 12 20231127T032311)
  https://docs.tritondatacenter.com/public-cloud/instances/virtual-machines/images/linux/debian

Last login: Fri Sep  5 16:05:56 2025 from 172.24.4.12
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# ls
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# ls -lt
total 0
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# cat > README.txt

Will this survive the upgrade?

root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# ls /data/danmcd/
file-locking-backup  kebe.txt
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# cat /data/danmcd/kebe.txt 
KEBE WAS HERE, AND THIS ONE SURVIVES!
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# ls -lt /data/danmcd/
total 8
-rw-r--r-- 1 1345 staff   38 Sep  3 19:34 kebe.txt
drwxr-xr-x 2 1345 staff 4096 May 24  2024 file-locking-backup
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# ls -lt
total 4
-rw-r--r-- 1 root root 33 Sep  8 14:01 README.txt
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# Connection to 172.24.4.185 closed by remote host.
Connection to 172.24.4.185 closed.
hideo(~)[255]% ssh root@172.24.4.185
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:DntIB0X4s/E9wIEynLgpsmsCGe+Fb1Qc5jaHUZPVKPY.
Please contact your system administrator.
Add correct host key in /home/danmcd/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/danmcd/.ssh/known_hosts:39
Host key for 172.24.4.185 has changed and you have requested strict checking.
Host key verification failed.
hideo(~)[255]% vi .ssh/kno
known_hosts      known_hosts.old  
hideo(~)[255]% vi .ssh/known_hosts
hideo(~)[0]% ssh root@172.24.4.185
The authenticity of host '172.24.4.185 (172.24.4.185)' can't be established.
ED25519 key fingerprint is SHA256:DntIB0X4s/E9wIEynLgpsmsCGe+Fb1Qc5jaHUZPVKPY.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.24.4.185' (ED25519) to the list of known hosts.
Enter passphrase for key '/home/danmcd/.ssh/id_ed25519': 
Linux b66a6b8a-7e4f-4d98-9787-d39b0cfa5995 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64

      *--+--*--*
     /| /| /| /|
    / |/ |/ |/ |    #####  ####   #  #####  ###   #   # TM
   +--*--+--*--*      #    #   #  #    #   #   #  ##  #
   | /| /| /| /|      #    ####   #    #   #   #  # # #
   |/ |/ |/ |/ |      #    #  #   #    #   #   #  #  ##
   *--+--+--+--+      #    #   #  #    #    ###   #   #
   | /| /| /| /
   |/ |/ |/ |/
   *--*--+--*

  HVM Instance (Debian 12 20231127T032311)
  https://docs.tritondatacenter.com/public-cloud/instances/virtual-machines/images/linux/debian

root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# ls -lta
total 20
drwx------  2 root root 4096 Sep  8 14:09 .ssh
drwxr-xr-x 19 root root 4096 Sep  8 14:09 ..
drwx------  3 root root 4096 Nov 27  2023 .
-rw-r--r--  1 root root  571 Apr 10  2021 .bashrc
-rw-r--r--  1 root root  161 Jul  9  2019 .profile
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# ls -lta /data/danmcd
total 16
drwxr-xr-x 3 1345 root  4096 Sep  3 19:35 .
-rw-r--r-- 1 1345 staff   38 Sep  3 19:34 kebe.txt
drwxr-xr-x 4 root root  4096 Sep  3 19:33 ..
drwxr-xr-x 2 1345 staff 4096 May 24  2024 file-locking-backup
root@b66a6b8a-7e4f-4d98-9787-d39b0cfa5995:~# 

And finally a before/after reprovisioning comparison of VMAPI’s view of the VM:

[root@moe (kebecloud) ~]# sdc-vmapi /vms/b66a6b8a-7e4f-4d98-9787-d39b0cfa5995 >& /tmp/after
[root@moe (kebecloud) ~]# diff /tmp/{before,after}
1,10c1,10
< HTTP/1.1 200 OK
< Connection: close
< Content-Type: application/json
< Content-Length: 2269
< Date: Mon, 08 Sep 2025 14:04:11 GMT
< Server: VMAPI/9.16.0
< x-request-id: ec446f38-b428-4c08-8320-1262436e1ec4
< x-response-time: 7
< x-server-name: bdd3c089-444a-43de-9f0f-ad92dbece8de
< 
---
> HTTP/1.1 200 OK
> Connection: close
> Content-Type: application/json
> Content-Length: 2270
> Date: Mon, 08 Sep 2025 14:10:29 GMT
> Server: VMAPI/9.16.0
> x-request-id: 1c7620f3-a96a-4f1c-824e-be45837b1a9a
> x-response-time: 9
> x-server-name: bdd3c089-444a-43de-9f0f-ad92dbece8de
> 
29c29
<   "last_modified": "2025-09-05T16:05:14.000Z",
---
>   "last_modified": "2025-09-08T14:08:59.000Z",
73,74c73,74
<   "boot_timestamp": "2025-09-05T16:05:13.000Z",
<   "pid": 4404,
---
>   "boot_timestamp": "2025-09-08T14:08:58.000Z",
>   "pid": 90355,
[root@moe (kebecloud) ~]# 

Related Links