Skip to content

Show IP address of the VM created using inspect json #245

Open
@cmoulliard

Description

Proposition

It could be very hard for a user to figure out what the IP address of the VM created is when DHCP is used. This is why I would like to propose to use the inspect json response to show it like the hostname of VM

Now

❯ http :60195/vm/inspect
HTTP/1.1 200 OK
Content-Length: 1318
Content-Type: application/json; charset=utf-8
Date: Fri, 17 Jan 2025 10:38:43 GMT

{
    "bootloader": {
        "createVariableStore": true,
        "efiVariableStorePath": "/Users/cmoullia/code/_temp/vfkit/dev/efi-variable-store",
        "kind": "efiBootloader"
    },
    "devices": [
        {
            "devName": "virtio-blk",
            "imagePath": "/Users/cmoullia/code/_temp/vfkit/fedora/Fedora-Cloud-41.raw",
            "kind": "virtioblk"
        },
        {
            "devName": "virtio-blk",
            "imagePath": "/Users/cmoullia/code/_temp/vfkit/fedora/cloudinit.iso",
            "kind": "virtioblk"
        },
        {
            "inputType": "keyboard",
            "kind": "virtioinput"
        },
        {
            "inputType": "pointing",
            "kind": "virtioinput"
        },
        {
            "kind": "virtionet",
            "macAddress": "5a:94:ef:e4:0c:ee",
            "nat": true
        },
        {
            "ignoreIfMissing": false,
            "installRosetta": true,
            "kind": "rosetta",
            "mountTag": "rosetta"
        },
        {
            "kind": "virtiorng"
        },
        {
            "kind": "virtiosock",
            "listen": true,
            "port": 1025,
            "socketURL": "/Users/cmoullia/code/_temp/vfkit/dev/default.sock"
        },
        {
            "kind": "virtioserial",
            "logFile": "/Users/cmoullia/code/_temp/vfkit/dev/default.log"
        },
        {
            "height": 600,
            "kind": "virtiogpu",
            "usesGUI": true,
            "width": 800
        },
        {
            "kind": "virtiofs",
            "mountTag": "user1",
            "sharedDir": "/Users/cmoullia/code/"
        },
        {
            "kind": "virtiosock",
            "listen": true,
            "port": 1024,
            "socketURL": "/var/folders/28/g86pgjxj0wl1nkd_85c2krjw0000gn/T/ignition.sock"
        }
    ],
    "ignition": {
        "configPath": "/Users/cmoullia/code/_temp/vfkit/dev/my-cfg.ign",
        "kind": "ignition",
        "socketPath": "/var/folders/28/g86pgjxj0wl1nkd_85c2krjw0000gn/T/ignition.sock"
    },
    "memoryBytes": 4294967296,
    "vcpus": 2
}

After

{
...
    "memoryBytes": 4294967296,
    "vcpus": 2,
    "vm": {
        "name: "cloud-name",
        "ip": "192.168.64.4"
     }
}

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions