Merge pull request #10435 from nubificus/fix_fc_machineconfig

runtime-rs: Use vCPU and memory values from config
This commit is contained in:
Anastassios Nanos 2024-10-18 13:41:20 +01:00 committed by GitHub
commit 68d539f5c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,6 +107,11 @@ impl FcInner {
.get_resource(&self.config.boot_info.image, FC_ROOT_FS)
.context("get resource ROOTFS")?;
let body_config: String = json!({
"mem_size_mib": self.config.memory_info.default_memory,
"vcpu_count": self.config.cpu_info.default_vcpus,
})
.to_string();
let body_kernel: String = json!({
"kernel_image_path": kernel,
"boot_args": parameters,
@ -124,6 +129,8 @@ impl FcInner {
info!(sl(), "Before first request");
self.request_with_retry(Method::PUT, "/boot-source", body_kernel)
.await?;
self.request_with_retry(Method::PUT, "/machine-config", body_config)
.await?;
self.request_with_retry(Method::PUT, "/drives/rootfs", body_rootfs)
.await?;