diff --git a/versions.yaml b/versions.yaml index 9ae579a1e9..3ec29e9b3b 100644 --- a/versions.yaml +++ b/versions.yaml @@ -75,7 +75,7 @@ assets: url: "https://github.com/cloud-hypervisor/cloud-hypervisor" uscan-url: >- https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz - version: "v0.9.0" + version: "v0.10.0" firecracker: description: "Firecracker micro-VMM" diff --git a/virtcontainers/pkg/cloud-hypervisor/client/.openapi-generator/FILES b/virtcontainers/pkg/cloud-hypervisor/client/.openapi-generator/FILES index 7914a2aa65..2a3283dd04 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/.openapi-generator/FILES +++ b/virtcontainers/pkg/cloud-hypervisor/client/.openapi-generator/FILES @@ -17,7 +17,10 @@ docs/FsConfig.md docs/InitramfsConfig.md docs/KernelConfig.md docs/MemoryConfig.md +docs/MemoryZoneConfig.md docs/NetConfig.md +docs/NumaConfig.md +docs/NumaDistance.md docs/PciDeviceInfo.md docs/PmemConfig.md docs/RestoreConfig.md @@ -28,6 +31,7 @@ docs/VmConfig.md docs/VmInfo.md docs/VmRemoveDevice.md docs/VmResize.md +docs/VmResizeZone.md docs/VmSnapshotConfig.md docs/VmmPingResponse.md docs/VsockConfig.md @@ -44,7 +48,10 @@ model_fs_config.go model_initramfs_config.go model_kernel_config.go model_memory_config.go +model_memory_zone_config.go model_net_config.go +model_numa_config.go +model_numa_distance.go model_pci_device_info.go model_pmem_config.go model_restore_config.go @@ -55,6 +62,7 @@ model_vm_config.go model_vm_info.go model_vm_remove_device.go model_vm_resize.go +model_vm_resize_zone.go model_vm_snapshot_config.go model_vmm_ping_response.go model_vsock_config.go diff --git a/virtcontainers/pkg/cloud-hypervisor/client/README.md b/virtcontainers/pkg/cloud-hypervisor/client/README.md index fe7b0209a5..cfbfde8653 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/README.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/README.md @@ -50,6 +50,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**VmInfoGet**](docs/DefaultApi.md#vminfoget) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance. *DefaultApi* | [**VmRemoveDevicePut**](docs/DefaultApi.md#vmremovedeviceput) | **Put** /vm.remove-device | Remove a device from the VM *DefaultApi* | [**VmResizePut**](docs/DefaultApi.md#vmresizeput) | **Put** /vm.resize | Resize the VM +*DefaultApi* | [**VmResizeZonePut**](docs/DefaultApi.md#vmresizezoneput) | **Put** /vm.resize-zone | Resize a memory zone *DefaultApi* | [**VmRestorePut**](docs/DefaultApi.md#vmrestoreput) | **Put** /vm.restore | Restore a VM from a snapshot. *DefaultApi* | [**VmSnapshotPut**](docs/DefaultApi.md#vmsnapshotput) | **Put** /vm.snapshot | Returns a VM snapshot. *DefaultApi* | [**VmmPingGet**](docs/DefaultApi.md#vmmpingget) | **Get** /vmm.ping | Ping the VMM to check for API server availability @@ -67,7 +68,10 @@ Class | Method | HTTP request | Description - [InitramfsConfig](docs/InitramfsConfig.md) - [KernelConfig](docs/KernelConfig.md) - [MemoryConfig](docs/MemoryConfig.md) + - [MemoryZoneConfig](docs/MemoryZoneConfig.md) - [NetConfig](docs/NetConfig.md) + - [NumaConfig](docs/NumaConfig.md) + - [NumaDistance](docs/NumaDistance.md) - [PciDeviceInfo](docs/PciDeviceInfo.md) - [PmemConfig](docs/PmemConfig.md) - [RestoreConfig](docs/RestoreConfig.md) @@ -78,6 +82,7 @@ Class | Method | HTTP request | Description - [VmInfo](docs/VmInfo.md) - [VmRemoveDevice](docs/VmRemoveDevice.md) - [VmResize](docs/VmResize.md) + - [VmResizeZone](docs/VmResizeZone.md) - [VmSnapshotConfig](docs/VmSnapshotConfig.md) - [VmmPingResponse](docs/VmmPingResponse.md) - [VsockConfig](docs/VsockConfig.md) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml b/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml index 97a47b8e9d..e765d67b31 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml +++ b/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml @@ -138,6 +138,21 @@ paths: "404": description: The VM instance could not be resized because it is not created. summary: Resize the VM + /vm.resize-zone: + put: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VmResizeZone' + description: The target size for the memory zone + required: true + responses: + "204": + description: The memory zone was successfully resized. + "500": + description: The memory zone could not be resized. + summary: Resize a memory zone /vm.add-device: put: requestBody: @@ -328,26 +343,46 @@ components: shared: false mergeable: false balloon: false - file: file size: 7 + hotplugged_size: 3 + zones: + - hugepages: false + shared: false + mergeable: false + file: file + size: 4 + hotplugged_size: 1 + host_numa_node: 7 + id: id + hotplug_size: 1 + - hugepages: false + shared: false + mergeable: false + file: file + size: 4 + hotplugged_size: 1 + host_numa_node: 7 + id: id + hotplug_size: 1 hotplug_size: 9 hotplug_method: acpi + balloon_size: 2 disks: - path: path - num_queues: 3 + num_queues: 1 readonly: false iommu: false - queue_size: 2 + queue_size: 6 vhost_socket: vhost_socket vhost_user: false direct: false poll_queue: true id: id - path: path - num_queues: 3 + num_queues: 1 readonly: false iommu: false - queue_size: 2 + queue_size: 6 vhost_socket: vhost_socket vhost_user: false direct: false @@ -370,25 +405,50 @@ components: id: id kernel: path: path + numa: + - distances: + - distance: 6 + destination: 3 + - distance: 6 + destination: 3 + cpus: + - 6 + - 6 + memory_zones: + - memory_zones + - memory_zones + guest_numa_id: 9 + - distances: + - distance: 6 + destination: 3 + - distance: 6 + destination: 3 + cpus: + - 6 + - 6 + memory_zones: + - memory_zones + - memory_zones + guest_numa_id: 9 rng: iommu: false src: /dev/urandom sgx_epc: - prefault: false - size: 1 + size: 8 - prefault: false - size: 1 + size: 8 fs: - - num_queues: 1 - queue_size: 1 - cache_size: 1 + - num_queues: 4 + queue_size: 5 + cache_size: 9 dax: true tag: tag socket: socket id: id - - num_queues: 1 - queue_size: 1 - cache_size: 1 + - num_queues: 4 + queue_size: 5 + cache_size: 9 dax: true tag: tag socket: socket @@ -401,13 +461,13 @@ components: pmem: - mergeable: false file: file - size: 6 + size: 9 iommu: false id: id discard_writes: false - mergeable: false file: file - size: 6 + size: 9 iommu: false id: id discard_writes: false @@ -422,9 +482,9 @@ components: path: path net: - tap: tap - num_queues: 4 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 1 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -432,9 +492,9 @@ components: mac: mac mask: 255.255.255.0 - tap: tap - num_queues: 4 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 1 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -488,26 +548,46 @@ components: shared: false mergeable: false balloon: false - file: file size: 7 + hotplugged_size: 3 + zones: + - hugepages: false + shared: false + mergeable: false + file: file + size: 4 + hotplugged_size: 1 + host_numa_node: 7 + id: id + hotplug_size: 1 + - hugepages: false + shared: false + mergeable: false + file: file + size: 4 + hotplugged_size: 1 + host_numa_node: 7 + id: id + hotplug_size: 1 hotplug_size: 9 hotplug_method: acpi + balloon_size: 2 disks: - path: path - num_queues: 3 + num_queues: 1 readonly: false iommu: false - queue_size: 2 + queue_size: 6 vhost_socket: vhost_socket vhost_user: false direct: false poll_queue: true id: id - path: path - num_queues: 3 + num_queues: 1 readonly: false iommu: false - queue_size: 2 + queue_size: 6 vhost_socket: vhost_socket vhost_user: false direct: false @@ -530,25 +610,50 @@ components: id: id kernel: path: path + numa: + - distances: + - distance: 6 + destination: 3 + - distance: 6 + destination: 3 + cpus: + - 6 + - 6 + memory_zones: + - memory_zones + - memory_zones + guest_numa_id: 9 + - distances: + - distance: 6 + destination: 3 + - distance: 6 + destination: 3 + cpus: + - 6 + - 6 + memory_zones: + - memory_zones + - memory_zones + guest_numa_id: 9 rng: iommu: false src: /dev/urandom sgx_epc: - prefault: false - size: 1 + size: 8 - prefault: false - size: 1 + size: 8 fs: - - num_queues: 1 - queue_size: 1 - cache_size: 1 + - num_queues: 4 + queue_size: 5 + cache_size: 9 dax: true tag: tag socket: socket id: id - - num_queues: 1 - queue_size: 1 - cache_size: 1 + - num_queues: 4 + queue_size: 5 + cache_size: 9 dax: true tag: tag socket: socket @@ -561,13 +666,13 @@ components: pmem: - mergeable: false file: file - size: 6 + size: 9 iommu: false id: id discard_writes: false - mergeable: false file: file - size: 6 + size: 9 iommu: false id: id discard_writes: false @@ -582,9 +687,9 @@ components: path: path net: - tap: tap - num_queues: 4 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 1 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -592,9 +697,9 @@ components: mac: mac mask: 255.255.255.0 - tap: tap - num_queues: 4 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 1 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -644,11 +749,14 @@ components: items: $ref: '#/components/schemas/SgxEpcConfig' type: array + numa: + items: + $ref: '#/components/schemas/NumaConfig' + type: array iommu: default: false type: boolean required: - - cmdline - kernel type: object CpuTopology: @@ -691,16 +799,77 @@ components: - boot_vcpus - max_vcpus type: object + MemoryZoneConfig: + example: + hugepages: false + shared: false + mergeable: false + file: file + size: 4 + hotplugged_size: 1 + host_numa_node: 7 + id: id + hotplug_size: 1 + properties: + id: + type: string + size: + format: int64 + type: integer + file: + type: string + mergeable: + default: false + type: boolean + shared: + default: false + type: boolean + hugepages: + default: false + type: boolean + host_numa_node: + format: uint32 + type: integer + hotplug_size: + format: int64 + type: integer + hotplugged_size: + format: int64 + type: integer + required: + - id + - size + type: object MemoryConfig: example: hugepages: false shared: false mergeable: false balloon: false - file: file size: 7 + hotplugged_size: 3 + zones: + - hugepages: false + shared: false + mergeable: false + file: file + size: 4 + hotplugged_size: 1 + host_numa_node: 7 + id: id + hotplug_size: 1 + - hugepages: false + shared: false + mergeable: false + file: file + size: 4 + hotplugged_size: 1 + host_numa_node: 7 + id: id + hotplug_size: 1 hotplug_size: 9 hotplug_method: acpi + balloon_size: 2 properties: size: format: int64 @@ -708,8 +877,9 @@ components: hotplug_size: format: int64 type: integer - file: - type: string + hotplugged_size: + format: int64 + type: integer mergeable: default: false type: boolean @@ -725,6 +895,13 @@ components: balloon: default: false type: boolean + balloon_size: + format: uint64 + type: integer + zones: + items: + $ref: '#/components/schemas/MemoryZoneConfig' + type: array required: - size type: object @@ -759,10 +936,10 @@ components: DiskConfig: example: path: path - num_queues: 3 + num_queues: 1 readonly: false iommu: false - queue_size: 2 + queue_size: 6 vhost_socket: vhost_socket vhost_user: false direct: false @@ -802,9 +979,9 @@ components: NetConfig: example: tap: tap - num_queues: 4 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 1 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -856,9 +1033,9 @@ components: type: object FsConfig: example: - num_queues: 1 - queue_size: 1 - cache_size: 1 + num_queues: 4 + queue_size: 5 + cache_size: 9 dax: true tag: tag socket: socket @@ -890,7 +1067,7 @@ components: example: mergeable: false file: file - size: 6 + size: 9 iommu: false id: id discard_writes: false @@ -978,7 +1155,7 @@ components: SgxEpcConfig: example: prefault: false - size: 1 + size: 8 properties: size: format: uint64 @@ -989,6 +1166,55 @@ components: required: - size type: object + NumaDistance: + example: + distance: 6 + destination: 3 + properties: + destination: + format: uint32 + type: integer + distance: + format: uint8 + type: integer + required: + - destination + - distance + type: object + NumaConfig: + example: + distances: + - distance: 6 + destination: 3 + - distance: 6 + destination: 3 + cpus: + - 6 + - 6 + memory_zones: + - memory_zones + - memory_zones + guest_numa_id: 9 + properties: + guest_numa_id: + format: uint32 + type: integer + cpus: + items: + format: uint8 + type: integer + type: array + distances: + items: + $ref: '#/components/schemas/NumaDistance' + type: array + memory_zones: + items: + type: string + type: array + required: + - guest_numa_id + type: object VmResize: example: desired_vcpus: 1 @@ -1007,6 +1233,18 @@ components: format: int64 type: integer type: object + VmResizeZone: + example: + id: id + desired_ram: 0 + properties: + id: + type: string + desired_ram: + description: desired memory zone size in bytes + format: int64 + type: integer + type: object VmAddDevice: example: path: path diff --git a/virtcontainers/pkg/cloud-hypervisor/client/api_default.go b/virtcontainers/pkg/cloud-hypervisor/client/api_default.go index c6bcc555e6..83daeae939 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/api_default.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/api_default.go @@ -1292,6 +1292,73 @@ func (a *DefaultApiService) VmResizePut(ctx _context.Context, vmResize VmResize) return localVarHTTPResponse, nil } +/* +VmResizeZonePut Resize a memory zone + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param vmResizeZone The target size for the memory zone +*/ +func (a *DefaultApiService) VmResizeZonePut(ctx _context.Context, vmResizeZone VmResizeZone) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/vm.resize-zone" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &vmResizeZone + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + /* VmRestorePut Restore a VM from a snapshot. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md index d29a8a868d..7d4ed80355 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md @@ -22,6 +22,7 @@ Method | HTTP request | Description [**VmInfoGet**](DefaultApi.md#VmInfoGet) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance. [**VmRemoveDevicePut**](DefaultApi.md#VmRemoveDevicePut) | **Put** /vm.remove-device | Remove a device from the VM [**VmResizePut**](DefaultApi.md#VmResizePut) | **Put** /vm.resize | Resize the VM +[**VmResizeZonePut**](DefaultApi.md#VmResizeZonePut) | **Put** /vm.resize-zone | Resize a memory zone [**VmRestorePut**](DefaultApi.md#VmRestorePut) | **Put** /vm.restore | Restore a VM from a snapshot. [**VmSnapshotPut**](DefaultApi.md#VmSnapshotPut) | **Put** /vm.snapshot | Returns a VM snapshot. [**VmmPingGet**](DefaultApi.md#VmmPingGet) | **Get** /vmm.ping | Ping the VMM to check for API server availability @@ -568,6 +569,38 @@ No authorization required [[Back to README]](../README.md) +## VmResizeZonePut + +> VmResizeZonePut(ctx, vmResizeZone) + +Resize a memory zone + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vmResizeZone** | [**VmResizeZone**](VmResizeZone.md)| The target size for the memory zone | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## VmRestorePut > VmRestorePut(ctx, restoreConfig) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md index f7b3f7acd0..ccafc86a73 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md @@ -6,12 +6,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Size** | **int64** | | **HotplugSize** | **int64** | | [optional] -**File** | **string** | | [optional] +**HotpluggedSize** | **int64** | | [optional] **Mergeable** | **bool** | | [optional] [default to false] **HotplugMethod** | **string** | | [optional] [default to acpi] **Shared** | **bool** | | [optional] [default to false] **Hugepages** | **bool** | | [optional] [default to false] **Balloon** | **bool** | | [optional] [default to false] +**BalloonSize** | **int32** | | [optional] +**Zones** | [**[]MemoryZoneConfig**](MemoryZoneConfig.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryZoneConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryZoneConfig.md new file mode 100644 index 0000000000..ad1393defe --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryZoneConfig.md @@ -0,0 +1,19 @@ +# MemoryZoneConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Size** | **int64** | | +**File** | **string** | | [optional] +**Mergeable** | **bool** | | [optional] [default to false] +**Shared** | **bool** | | [optional] [default to false] +**Hugepages** | **bool** | | [optional] [default to false] +**HostNumaNode** | **int32** | | [optional] +**HotplugSize** | **int64** | | [optional] +**HotpluggedSize** | **int64** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/NumaConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/NumaConfig.md new file mode 100644 index 0000000000..15bf88e2ca --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/NumaConfig.md @@ -0,0 +1,14 @@ +# NumaConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GuestNumaId** | **int32** | | +**Cpus** | **[]int32** | | [optional] +**Distances** | [**[]NumaDistance**](NumaDistance.md) | | [optional] +**MemoryZones** | **[]string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/NumaDistance.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/NumaDistance.md new file mode 100644 index 0000000000..97b006af0b --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/NumaDistance.md @@ -0,0 +1,12 @@ +# NumaDistance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Destination** | **int32** | | +**Distance** | **int32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/VmConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmConfig.md index fa2a8d21c0..f15007cc00 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/VmConfig.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmConfig.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **Memory** | [**MemoryConfig**](MemoryConfig.md) | | [optional] **Kernel** | [**KernelConfig**](KernelConfig.md) | | **Initramfs** | Pointer to [**InitramfsConfig**](InitramfsConfig.md) | | [optional] -**Cmdline** | [**CmdLineConfig**](CmdLineConfig.md) | | +**Cmdline** | [**CmdLineConfig**](CmdLineConfig.md) | | [optional] **Disks** | [**[]DiskConfig**](DiskConfig.md) | | [optional] **Net** | [**[]NetConfig**](NetConfig.md) | | [optional] **Rng** | [**RngConfig**](RngConfig.md) | | [optional] @@ -19,6 +19,7 @@ Name | Type | Description | Notes **Devices** | [**[]DeviceConfig**](DeviceConfig.md) | | [optional] **Vsock** | [**VsockConfig**](VsockConfig.md) | | [optional] **SgxEpc** | [**[]SgxEpcConfig**](SgxEpcConfig.md) | | [optional] +**Numa** | [**[]NumaConfig**](NumaConfig.md) | | [optional] **Iommu** | **bool** | | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResizeZone.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResizeZone.md new file mode 100644 index 0000000000..251d4f8185 --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResizeZone.md @@ -0,0 +1,12 @@ +# VmResizeZone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] +**DesiredRam** | **int64** | desired memory zone size in bytes | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/virtcontainers/pkg/cloud-hypervisor/client/go.mod b/virtcontainers/pkg/cloud-hypervisor/client/go.mod index 7406f2bda1..f55c1461f8 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/go.mod +++ b/virtcontainers/pkg/cloud-hypervisor/client/go.mod @@ -3,7 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID require ( github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 - + ) - -go 1.13 diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go index 4b05540dad..b0ccbc0348 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go @@ -12,10 +12,12 @@ package openapi type MemoryConfig struct { Size int64 `json:"size"` HotplugSize int64 `json:"hotplug_size,omitempty"` - File string `json:"file,omitempty"` + HotpluggedSize int64 `json:"hotplugged_size,omitempty"` Mergeable bool `json:"mergeable,omitempty"` HotplugMethod string `json:"hotplug_method,omitempty"` Shared bool `json:"shared,omitempty"` Hugepages bool `json:"hugepages,omitempty"` Balloon bool `json:"balloon,omitempty"` + BalloonSize int32 `json:"balloon_size,omitempty"` + Zones []MemoryZoneConfig `json:"zones,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_memory_zone_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_memory_zone_config.go new file mode 100644 index 0000000000..aacd718330 --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_memory_zone_config.go @@ -0,0 +1,22 @@ +/* + * Cloud Hypervisor API + * + * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine. + * + * API version: 0.3.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +// MemoryZoneConfig struct for MemoryZoneConfig +type MemoryZoneConfig struct { + Id string `json:"id"` + Size int64 `json:"size"` + File string `json:"file,omitempty"` + Mergeable bool `json:"mergeable,omitempty"` + Shared bool `json:"shared,omitempty"` + Hugepages bool `json:"hugepages,omitempty"` + HostNumaNode int32 `json:"host_numa_node,omitempty"` + HotplugSize int64 `json:"hotplug_size,omitempty"` + HotpluggedSize int64 `json:"hotplugged_size,omitempty"` +} diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_numa_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_numa_config.go new file mode 100644 index 0000000000..378b92fd44 --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_numa_config.go @@ -0,0 +1,17 @@ +/* + * Cloud Hypervisor API + * + * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine. + * + * API version: 0.3.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +// NumaConfig struct for NumaConfig +type NumaConfig struct { + GuestNumaId int32 `json:"guest_numa_id"` + Cpus []int32 `json:"cpus,omitempty"` + Distances []NumaDistance `json:"distances,omitempty"` + MemoryZones []string `json:"memory_zones,omitempty"` +} diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_numa_distance.go b/virtcontainers/pkg/cloud-hypervisor/client/model_numa_distance.go new file mode 100644 index 0000000000..4b96816970 --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_numa_distance.go @@ -0,0 +1,15 @@ +/* + * Cloud Hypervisor API + * + * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine. + * + * API version: 0.3.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +// NumaDistance struct for NumaDistance +type NumaDistance struct { + Destination int32 `json:"destination"` + Distance int32 `json:"distance"` +} diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go index 528406f2cd..e696d64c0d 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go @@ -14,7 +14,7 @@ type VmConfig struct { Memory MemoryConfig `json:"memory,omitempty"` Kernel KernelConfig `json:"kernel"` Initramfs *InitramfsConfig `json:"initramfs,omitempty"` - Cmdline CmdLineConfig `json:"cmdline"` + Cmdline CmdLineConfig `json:"cmdline,omitempty"` Disks []DiskConfig `json:"disks,omitempty"` Net []NetConfig `json:"net,omitempty"` Rng RngConfig `json:"rng,omitempty"` @@ -25,5 +25,6 @@ type VmConfig struct { Devices []DeviceConfig `json:"devices,omitempty"` Vsock VsockConfig `json:"vsock,omitempty"` SgxEpc []SgxEpcConfig `json:"sgx_epc,omitempty"` + Numa []NumaConfig `json:"numa,omitempty"` Iommu bool `json:"iommu,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize_zone.go b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize_zone.go new file mode 100644 index 0000000000..c86e02f0ff --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize_zone.go @@ -0,0 +1,16 @@ +/* + * Cloud Hypervisor API + * + * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine. + * + * API version: 0.3.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +// VmResizeZone struct for VmResizeZone +type VmResizeZone struct { + Id string `json:"id,omitempty"` + // desired memory zone size in bytes + DesiredRam int64 `json:"desired_ram,omitempty"` +} diff --git a/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml b/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml index 8b9f26e494..138378127a 100644 --- a/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml +++ b/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml @@ -150,6 +150,22 @@ paths: 404: description: The VM instance could not be resized because it is not created. + /vm.resize-zone: + put: + summary: Resize a memory zone + requestBody: + description: The target size for the memory zone + content: + application/json: + schema: + $ref: '#/components/schemas/VmResizeZone' + required: true + responses: + 204: + description: The memory zone was successfully resized. + 500: + description: The memory zone could not be resized. + /vm.add-device: put: summary: Add a new device to the VM @@ -369,7 +385,6 @@ components: VmConfig: required: - kernel - - cmdline type: object properties: cpus: @@ -414,6 +429,10 @@ components: type: array items: $ref: '#/components/schemas/SgxEpcConfig' + numa: + type: array + items: + $ref: '#/components/schemas/NumaConfig' iommu: type: boolean default: false @@ -448,6 +467,39 @@ components: topology: $ref: '#/components/schemas/CpuTopology' + MemoryZoneConfig: + required: + - id + - size + type: object + properties: + id: + type: string + size: + type: integer + format: int64 + default: 512 MB + file: + type: string + mergeable: + type: boolean + default: false + shared: + type: boolean + default: false + hugepages: + type: boolean + default: false + host_numa_node: + type: integer + format: uint32 + hotplug_size: + type: integer + format: int64 + hotplugged_size: + type: integer + format: int64 + MemoryConfig: required: - size @@ -460,8 +512,9 @@ components: hotplug_size: type: integer format: int64 - file: - type: string + hotplugged_size: + type: integer + format: int64 mergeable: type: boolean default: false @@ -477,6 +530,13 @@ components: balloon: type: boolean default: false + balloon_size: + type: integer + format: uint64 + zones: + type: array + items: + $ref: '#/components/schemas/MemoryZoneConfig' KernelConfig: required: @@ -686,6 +746,41 @@ components: type: boolean default: false + NumaDistance: + required: + - destination + - distance + type: object + properties: + destination: + type: integer + format: uint32 + distance: + type: integer + format: uint8 + + NumaConfig: + required: + - guest_numa_id + type: object + properties: + guest_numa_id: + type: integer + format: uint32 + cpus: + type: array + items: + type: integer + format: uint8 + distances: + type: array + items: + $ref: '#/components/schemas/NumaDistance' + memory_zones: + type: array + items: + type: string + VmResize: type: object properties: @@ -701,6 +796,16 @@ components: type: integer format: int64 + VmResizeZone: + type: object + properties: + id: + type: string + desired_ram: + description: desired memory zone size in bytes + type: integer + format: int64 + VmAddDevice: type: object properties: