From 345a8e9e45f9b6f000981b5ec1a0a7c40d280e5b Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 24 Jan 2017 15:35:42 +0000 Subject: [PATCH 1/3] ciao-cli: Remove disk_mb from example workloads Setting the disk_mb has zero effect on the instance and so we should update the examples and doumentation to not give the impression it does anything Fixes: #1052 Signed-off-by: Rob Bradford --- ciao-cli/examples/README.md | 3 +-- ciao-cli/examples/fedora_cloud.yaml | 1 - ciao-cli/examples/fedora_cloud_disk.yaml | 1 - ciao-cli/examples/ubuntu_latest.yaml | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ciao-cli/examples/README.md b/ciao-cli/examples/README.md index 5173fc574..b720fe666 100644 --- a/ciao-cli/examples/README.md +++ b/ciao-cli/examples/README.md @@ -99,14 +99,13 @@ disks: Valid values for the source `service` field are `image` or `volume` Workload definitions must also contain default values for resources -that the workload will need to use when it runs. There are three resources +that the workload will need to use when it runs. There are two resources which must be specified: ``` defaults: vcpus: 2 mem_mb: 512 - disk_mb: 1024 ``` Finally, the filename for the cloud config file must be included in the diff --git a/ciao-cli/examples/fedora_cloud.yaml b/ciao-cli/examples/fedora_cloud.yaml index 9f5711e04..4b4c5d0a9 100644 --- a/ciao-cli/examples/fedora_cloud.yaml +++ b/ciao-cli/examples/fedora_cloud.yaml @@ -4,7 +4,6 @@ fw_type: legacy defaults: vcpus: 2 mem_mb: 512 - disk_mb: 1024 cloud_init: fedora_vm.yaml disks: - source: diff --git a/ciao-cli/examples/fedora_cloud_disk.yaml b/ciao-cli/examples/fedora_cloud_disk.yaml index 6fce9370b..962666241 100644 --- a/ciao-cli/examples/fedora_cloud_disk.yaml +++ b/ciao-cli/examples/fedora_cloud_disk.yaml @@ -4,7 +4,6 @@ fw_type: legacy defaults: vcpus: 2 mem_mb: 512 - disk_mb: 1024 cloud_init: "fedora_vm.yaml" disks: - source: diff --git a/ciao-cli/examples/ubuntu_latest.yaml b/ciao-cli/examples/ubuntu_latest.yaml index 87dabb379..b317b15bb 100644 --- a/ciao-cli/examples/ubuntu_latest.yaml +++ b/ciao-cli/examples/ubuntu_latest.yaml @@ -4,5 +4,4 @@ image_name: "ubuntu:latest" defaults: vcpus: 2 mem_mb: 512 - disk_mb: 80 cloud_init: "docker-ubuntu.yaml" From 8963f0282c282e3948fb95663cdee7f23d320aaa Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 24 Jan 2017 15:38:38 +0000 Subject: [PATCH 2/3] ciao-cli: Remove disk_mb parsing from workload creation Remove DiskMB from the structure used when creating a workload as this has no effect right now. Fixes: #1052 Signed-off-by: Rob Bradford --- ciao-cli/workload.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ciao-cli/workload.go b/ciao-cli/workload.go index ad4848987..2388e5a1a 100644 --- a/ciao-cli/workload.go +++ b/ciao-cli/workload.go @@ -157,9 +157,8 @@ type disk struct { } type defaultResources struct { - VCPUs int `yaml:"vcpus"` - MemMB int `yaml:"mem_mb"` - DiskMB int `yaml:"disk_mb"` + VCPUs int `yaml:"vcpus"` + MemMB int `yaml:"mem_mb"` } // we currently only use the first disk due to lack of support @@ -268,12 +267,6 @@ func optToReq(opt workloadOptions, req *types.Workload) error { } req.Defaults = append(req.Defaults, r) - r = payloads.RequestedResource{ - Type: payloads.DiskMB, - Value: defaults.DiskMB, - } - req.Defaults = append(req.Defaults, r) - return nil } From 0b03240bf09f304244c5c6f2da4421998c6e977e Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 24 Jan 2017 15:45:21 +0000 Subject: [PATCH 3/3] payloads: Remove local disk support from payload Now that storage is currently always remote and we don't yet have a plan for local storage then remove the support. Fixes: #1052 Signed-off-by: Rob Bradford --- ciao-controller/internal/datastore/sqlite3db_test.go | 8 +------- ciao-controller/tables/resources.csv | 1 - ciao-launcher/README.md | 4 ---- ciao-launcher/payload.go | 5 +---- ciao-launcher/payload_test.go | 9 --------- ciao-launcher/start_test.go | 2 -- ciao-launcher/tests/examples/start_efi.yaml | 2 -- ciao-launcher/tests/examples/start_legacy.yaml | 2 -- .../tests/examples/start_legacy_volume.yaml | 2 -- .../tests/examples/start_legacy_volume_boot.yaml | 2 -- ciao-launcher/tests/examples/start_nn.yaml | 2 -- ciao-launcher/tests/examples/stress/efi.sh | 2 -- ciao-launcher/tests/examples/stress/legacy.sh | 2 -- ciao-scheduler/scheduler_internal_test.go | 6 ------ payloads/restart_test.go | 12 +----------- payloads/start.go | 4 ---- payloads/start_test.go | 12 +----------- testutil/payloads.go | 10 ---------- 18 files changed, 4 insertions(+), 83 deletions(-) diff --git a/ciao-controller/internal/datastore/sqlite3db_test.go b/ciao-controller/internal/datastore/sqlite3db_test.go index d80c306e2..a12c79700 100644 --- a/ciao-controller/internal/datastore/sqlite3db_test.go +++ b/ciao-controller/internal/datastore/sqlite3db_test.go @@ -979,12 +979,6 @@ users: Mandatory: false, } - disk := payloads.RequestedResource{ - Type: payloads.DiskMB, - Value: 1024, - Mandatory: false, - } - storage := types.StorageResource{ ID: "", Ephemeral: false, @@ -999,7 +993,7 @@ users: ImageID: uuid.Generate().String(), ImageName: "", Config: testConfig, - Defaults: []payloads.RequestedResource{cpus, mem, disk}, + Defaults: []payloads.RequestedResource{cpus, mem}, Storage: []types.StorageResource{storage}, } diff --git a/ciao-controller/tables/resources.csv b/ciao-controller/tables/resources.csv index b8d963a5d..f14178414 100644 --- a/ciao-controller/tables/resources.csv +++ b/ciao-controller/tables/resources.csv @@ -1,5 +1,4 @@ 1, instances 2, vcpus 3, mem_mb -4, disk_mb 5, network_node diff --git a/ciao-launcher/README.md b/ciao-launcher/README.md index 400d613b9..fe45fb279 100644 --- a/ciao-launcher/README.md +++ b/ciao-launcher/README.md @@ -174,10 +174,6 @@ Actually, this is sort of an odd situation as the START command partially succee ciao-launcher returns an error code, but the instance has been created and could be booted a later stage via RESTART. -If the user specifies a size for disk_mb that is smaller than the virtual size of the -backing image, launcher ignores the user specified value and creates an image for the -instance whose virtual size matches that size of the chosen backing image. - ciao-launcher only supports persistent instances at the moment. Any VM instances created by the START command are persistent, i.e., the persistence YAML field is currently ignored. diff --git a/ciao-launcher/payload.go b/ciao-launcher/payload.go index fd1f0f0c2..bb48c0047 100644 --- a/ciao-launcher/payload.go +++ b/ciao-launcher/payload.go @@ -146,7 +146,7 @@ func parseStartPayload(data []byte) (*vmConfig, *payloadError) { } legacy := fwType == payloads.Legacy - var disk, cpus, mem int + var cpus, mem int var networkNode bool container, image, err := parseVMTtype(start) if err != nil { @@ -159,8 +159,6 @@ func parseStartPayload(data []byte) (*vmConfig, *payloadError) { cpus = start.RequestedResources[i].Value case payloads.MemMB: mem = start.RequestedResources[i].Value - case payloads.DiskMB: - disk = start.RequestedResources[i].Value case payloads.NetworkNode: networkNode = start.RequestedResources[i].Value != 0 } @@ -186,7 +184,6 @@ func parseStartPayload(data []byte) (*vmConfig, *payloadError) { return &vmConfig{Cpus: cpus, Mem: mem, - Disk: disk, Instance: instance, Image: image, Legacy: legacy, diff --git a/ciao-launcher/payload_test.go b/ciao-launcher/payload_test.go index 84a7679af..f83e3f606 100644 --- a/ciao-launcher/payload_test.go +++ b/ciao-launcher/payload_test.go @@ -39,8 +39,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: d7d86208-b46c-4465-9018-ee14087d415f tenant_uuid: 67d86208-000-4465-9018-fe14087d415f fw_type: legacy @@ -59,7 +57,6 @@ start: &vmConfig{ Cpus: 2, Mem: 370, - Disk: 8000, Instance: "d7d86208-b46c-4465-9018-ee14087d415f", Legacy: true, VnicMAC: "02:00:e6:f5:af:f9", @@ -90,8 +87,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: imnotvalid tenant_uuid: 67d86208-000-4465-9018-fe14087d415f fw_type: legacy @@ -116,8 +111,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: d7d86208-b46c-4465-9018-ee14087d415f tenant_uuid: 67d86208-000-4465-9018-fe14087d415f fw_type: imnotvalid @@ -142,8 +135,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: d7d86208-b46c-4465-9018-ee14087d415f vm_type: askajajlsj tenant_uuid: 67d86208-000-4465-9018-fe14087d415f diff --git a/ciao-launcher/start_test.go b/ciao-launcher/start_test.go index 604591b06..df71d287f 100644 --- a/ciao-launcher/start_test.go +++ b/ciao-launcher/start_test.go @@ -35,8 +35,6 @@ runcmd: value: 2 - type: mem_mb value: 256 - - type: disk_mb - value: 80000 instance_uuid: 67d86208-b46c-4465-9018-fe14087d415f image_uuid: b286cd45-7d0c-4525-a140-4db6c95e41fa ` diff --git a/ciao-launcher/tests/examples/start_efi.yaml b/ciao-launcher/tests/examples/start_efi.yaml index ec546895f..714516c45 100644 --- a/ciao-launcher/tests/examples/start_efi.yaml +++ b/ciao-launcher/tests/examples/start_efi.yaml @@ -5,8 +5,6 @@ start: value: 2 - type: mem_mb value: 256 - - type: disk_mb - value: 80000 instance_uuid: 67d86208-b46c-4465-9018-fe14087d415 tenant_uuid: 67d86208-000-4465-9018-fe14087d415f image_uuid: clear-1ff6bf3883708a56446d863f20c810c99b3aea6f diff --git a/ciao-launcher/tests/examples/start_legacy.yaml b/ciao-launcher/tests/examples/start_legacy.yaml index 535526c8c..4bc84fbfc 100644 --- a/ciao-launcher/tests/examples/start_legacy.yaml +++ b/ciao-launcher/tests/examples/start_legacy.yaml @@ -5,8 +5,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: d7d86208-b46c-4465-9018-fe14087d415f tenant_uuid: 67d86208-000-4465-9018-fe14087d415f image_uuid: b286cd45-7d0c-4525-a140-4db6c95e41fa diff --git a/ciao-launcher/tests/examples/start_legacy_volume.yaml b/ciao-launcher/tests/examples/start_legacy_volume.yaml index aa00d7e79..d92ffbfde 100644 --- a/ciao-launcher/tests/examples/start_legacy_volume.yaml +++ b/ciao-launcher/tests/examples/start_legacy_volume.yaml @@ -5,8 +5,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: d7d86208-b46c-4465-9018-fe14087d415f tenant_uuid: 67d86208-000-4465-9018-fe14087d415f image_uuid: b286cd45-7d0c-4525-a140-4db6c95e41fa diff --git a/ciao-launcher/tests/examples/start_legacy_volume_boot.yaml b/ciao-launcher/tests/examples/start_legacy_volume_boot.yaml index 47c082b21..5907abd56 100644 --- a/ciao-launcher/tests/examples/start_legacy_volume_boot.yaml +++ b/ciao-launcher/tests/examples/start_legacy_volume_boot.yaml @@ -5,8 +5,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: d7d86208-b46c-4465-9018-ee14087d415f tenant_uuid: 67d86208-000-4465-9018-fe14087d415f fw_type: legacy diff --git a/ciao-launcher/tests/examples/start_nn.yaml b/ciao-launcher/tests/examples/start_nn.yaml index 8cc1bfdc1..3e188027b 100644 --- a/ciao-launcher/tests/examples/start_nn.yaml +++ b/ciao-launcher/tests/examples/start_nn.yaml @@ -8,8 +8,6 @@ start: value: 2 - type: mem_mb value: 256 - - type: disk_mb - value: 80000 - type: network_node value: 1 instance_uuid: 67d86208-b46c-4465-0000-fe14087d415f diff --git a/ciao-launcher/tests/examples/stress/efi.sh b/ciao-launcher/tests/examples/stress/efi.sh index 68043970d..6c8cc637b 100755 --- a/ciao-launcher/tests/examples/stress/efi.sh +++ b/ciao-launcher/tests/examples/stress/efi.sh @@ -15,8 +15,6 @@ start: value: 1 - type: mem_mb value: 128 - - type: disk_mb - value: 8000 instance_uuid: 67d86208-b46c-4465-9018-fe14087d$i tenant_uuid: 67d86208-000-4465-9018-fe14087d415f image_uuid: clear-5590-cloud-supernova.qcow diff --git a/ciao-launcher/tests/examples/stress/legacy.sh b/ciao-launcher/tests/examples/stress/legacy.sh index 3efb44604..ee3298716 100755 --- a/ciao-launcher/tests/examples/stress/legacy.sh +++ b/ciao-launcher/tests/examples/stress/legacy.sh @@ -15,8 +15,6 @@ start: value: 2 - type: mem_mb value: 370 - - type: disk_mb - value: 8000 instance_uuid: d7d86208-b46c-4465-9018-fe14087d4$i tenant_uuid: 67d86208-000-4465-9018-fe14087d415f image_uuid: b286cd45-7d0c-4525-a140-4db6c95e41fa diff --git a/ciao-scheduler/scheduler_internal_test.go b/ciao-scheduler/scheduler_internal_test.go index ba4cff895..c0bd6a243 100644 --- a/ciao-scheduler/scheduler_internal_test.go +++ b/ciao-scheduler/scheduler_internal_test.go @@ -136,14 +136,8 @@ func createStartWorkload(vCpus int, memMB int, diskMB int) *payloads.Start { Value: memMB, Mandatory: true, } - reqDisk := payloads.RequestedResource{ - Type: "disk_mb", - Value: diskMB, - Mandatory: true, - } work.Start.RequestedResources = append(work.Start.RequestedResources, reqVcpus) work.Start.RequestedResources = append(work.Start.RequestedResources, reqMem) - work.Start.RequestedResources = append(work.Start.RequestedResources, reqDisk) //TODO: add EstimatedResources diff --git a/payloads/restart_test.go b/payloads/restart_test.go index 86ffaa9d5..05594e210 100644 --- a/payloads/restart_test.go +++ b/payloads/restart_test.go @@ -43,11 +43,6 @@ func TestRestartMarshal(t *testing.T) { Value: 4096, Mandatory: true, } - reqDisk := RequestedResource{ - Type: "disk_mb", - Value: 10000, - Mandatory: true, - } estVcpus := EstimatedResource{ Type: "vcpus", Value: 1, @@ -56,10 +51,7 @@ func TestRestartMarshal(t *testing.T) { Type: "mem_mb", Value: 128, } - estDisk := EstimatedResource{ - Type: "disk_mb", - Value: 4096, - } + var cmd Restart cmd.Restart.TenantUUID = testutil.TenantUUID cmd.Restart.InstanceUUID = testutil.InstanceUUID @@ -67,10 +59,8 @@ func TestRestartMarshal(t *testing.T) { cmd.Restart.WorkloadAgentUUID = testutil.AgentUUID cmd.Restart.RequestedResources = append(cmd.Restart.RequestedResources, reqVcpus) cmd.Restart.RequestedResources = append(cmd.Restart.RequestedResources, reqMem) - cmd.Restart.RequestedResources = append(cmd.Restart.RequestedResources, reqDisk) cmd.Restart.EstimatedResources = append(cmd.Restart.EstimatedResources, estVcpus) cmd.Restart.EstimatedResources = append(cmd.Restart.EstimatedResources, estMem) - cmd.Restart.EstimatedResources = append(cmd.Restart.EstimatedResources, estDisk) cmd.Restart.FWType = EFI cmd.Restart.InstancePersistence = Host diff --git a/payloads/start.go b/payloads/start.go index 55dce9141..706889851 100644 --- a/payloads/start.go +++ b/payloads/start.go @@ -64,10 +64,6 @@ const ( // in MBs MemMB = "mem_mb" - // DiskMB indicates that a resource struct specifies a quantity of disk - // space in MBs - DiskMB = "disk_mb" - // NetworkNode indicates that a resource struct specifies whether the // command in which it is embedded applies to a network node. NetworkNode = "network_node" diff --git a/payloads/start_test.go b/payloads/start_test.go index 1ebcd5541..6cbe44b65 100644 --- a/payloads/start_test.go +++ b/payloads/start_test.go @@ -43,11 +43,6 @@ func TestStartMarshal(t *testing.T) { Value: 4096, Mandatory: true, } - reqDisk := RequestedResource{ - Type: "disk_mb", - Value: 10000, - Mandatory: true, - } estVcpus := EstimatedResource{ Type: "vcpus", Value: 1, @@ -56,10 +51,7 @@ func TestStartMarshal(t *testing.T) { Type: "mem_mb", Value: 128, } - estDisk := EstimatedResource{ - Type: "disk_mb", - Value: 4096, - } + var cmd Start cmd.Start.TenantUUID = testutil.TenantUUID cmd.Start.InstanceUUID = testutil.InstanceUUID @@ -67,10 +59,8 @@ func TestStartMarshal(t *testing.T) { cmd.Start.DockerImage = testutil.DockerImage cmd.Start.RequestedResources = append(cmd.Start.RequestedResources, reqVcpus) cmd.Start.RequestedResources = append(cmd.Start.RequestedResources, reqMem) - cmd.Start.RequestedResources = append(cmd.Start.RequestedResources, reqDisk) cmd.Start.EstimatedResources = append(cmd.Start.EstimatedResources, estVcpus) cmd.Start.EstimatedResources = append(cmd.Start.EstimatedResources, estMem) - cmd.Start.EstimatedResources = append(cmd.Start.EstimatedResources, estDisk) cmd.Start.FWType = EFI cmd.Start.InstancePersistence = Host cmd.Start.VMType = QEMU diff --git a/testutil/payloads.go b/testutil/payloads.go index 493629e6b..471e65233 100644 --- a/testutil/payloads.go +++ b/testutil/payloads.go @@ -132,16 +132,11 @@ const StartYaml = `start: - type: mem_mb value: 4096 mandatory: true - - type: disk_mb - value: 10000 - mandatory: true estimated_resources: - type: vcpus value: 1 - type: mem_mb value: 128 - - type: disk_mb - value: 4096 networking: vnic_mac: "" vnic_uuid: "" @@ -217,16 +212,11 @@ const RestartYaml = `restart: - type: mem_mb value: 4096 mandatory: true - - type: disk_mb - value: 10000 - mandatory: true estimated_resources: - type: vcpus value: 1 - type: mem_mb value: 128 - - type: disk_mb - value: 4096 networking: vnic_mac: "" vnic_uuid: ""