Add CPU info to VM hosts, templates, and custom pricing#54
Conversation
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
v0l
left a comment
There was a problem hiding this comment.
Ive decided we should just store the raw CPUID results directly from the CPU.
raw CPUID results can be concatenated a list of results.
Each CPUID result contains a LEAF_ID (u32) and 4 register values (u32) (5xu32 for each result)
In the vm_host store BINARY(1024) which can store the raw CPUID results.
On the vm_template / vm_custom_template, the cpuid value acts as a variable list filter for CPUID results, since we dont expect to match the entire result set we can expect maybe using BINARY(25) (5x CPUID filter)
Done in commit
The Rust model uses Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
468edf5 to
009c0c0
Compare
026a530 to
4e26c14
Compare
- Add CpuMfg, CpuArch, and CpuFeature enums for CPU type specification - Add cpu_mfg, cpu_arch, cpu_features columns to vm_host, vm_template, vm_custom_pricing, and vm_custom_template tables - Add lnvps_host_util crate with lnvps-host-info binary for detecting CPU/GPU features on hosts via SSH - Add SSH credentials (ssh_user, ssh_key) to vm_host for remote execution - Add CommaSeparated<T> type for storing feature lists in database - Update capacity filtering to match hosts by CPU requirements - Cross-compile host-info binary for x86_64 and arm64 in Dockerfile - Update admin API with CPU fields for templates, pricing, and hosts - Update user API documentation with CPU feature enums
4e26c14 to
f0d45fe
Compare
CPU information is missing from VM hosts, templates, and custom pricing models, making it impossible to differentiate CPU workloads in offers or provisioning logic.
Changes
New struct and helpers (
lnvps_db)CpuIdEntry— represents a single CPUID instruction result stored on hosts:leafu32eaxu32ebxu32ecxu32edxu32Helper functions
cpuid_to_bytesandbytes_to_cpuidpack/unpack lists ofCpuIdEntryto/from raw bytes (20 bytes per entry).Database
Migration
20260219000000_cpu_type.sqladds CPU-related columns to all three tables:vm_hostcpuid VARBINARY(1024) NOT NULL DEFAULT ''vm_templatecpu_manufacturer VARCHAR(64) DEFAULT NULL,cpu_product VARCHAR(64) DEFAULT NULLNULL= any CPUvm_custom_pricingcpu_manufacturer VARCHAR(64) DEFAULT NULL,cpu_product VARCHAR(64) DEFAULT NULLNULL= any CPUAll INSERT/UPDATE queries updated accordingly.
API (
lnvps_api_common)The raw CPUID binary is not exposed to the consumer API. Instead, templates and custom pricing expose human-readable filter fields:
ApiVmTemplate: optionalcpu_manufacturer: Option<String>andcpu_product: Option<String>(omitted when null)ApiCustomTemplateParams: optionalcpu_manufacturer: Option<String>andcpu_product: Option<String>(omitted when null)Admin API (
lnvps_api_admin)AdminHostInfo:cpuid: Vec<ApiCpuIdEntry>(full raw host CPUID dump, usingApiCpuIdEntrywith named register fields)AdminVmTemplateInfo,AdminCustomPricingInfo:cpu_manufacturer: Option<String>andcpu_product: Option<String>(omitted when null)copy_custom_pricingpropagatescpu_manufacturerandcpu_productfrom sourceOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.