Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
payloads: Remove local disk support from payload
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rbradford committed Jan 25, 2017
1 parent 8963f02 commit 0b03240
Show file tree
Hide file tree
Showing 18 changed files with 4 additions and 83 deletions.
8 changes: 1 addition & 7 deletions ciao-controller/internal/datastore/sqlite3db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,12 +979,6 @@ users:
Mandatory: false,
}

disk := payloads.RequestedResource{
Type: payloads.DiskMB,
Value: 1024,
Mandatory: false,
}

storage := types.StorageResource{
ID: "",
Ephemeral: false,
Expand All @@ -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},
}

Expand Down
1 change: 0 additions & 1 deletion ciao-controller/tables/resources.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
1, instances
2, vcpus
3, mem_mb
4, disk_mb
5, network_node
4 changes: 0 additions & 4 deletions ciao-launcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions ciao-launcher/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand All @@ -186,7 +184,6 @@ func parseStartPayload(data []byte) (*vmConfig, *payloadError) {

return &vmConfig{Cpus: cpus,
Mem: mem,
Disk: disk,
Instance: instance,
Image: image,
Legacy: legacy,
Expand Down
9 changes: 0 additions & 9 deletions ciao-launcher/payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/tests/examples/start_efi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/tests/examples/start_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/tests/examples/start_legacy_volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/tests/examples/start_legacy_volume_boot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/tests/examples/start_nn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/tests/examples/stress/efi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ciao-launcher/tests/examples/stress/legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions ciao-scheduler/scheduler_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 1 addition & 11 deletions payloads/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -56,21 +51,16 @@ 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
cmd.Restart.ImageUUID = testutil.ImageUUID
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

Expand Down
4 changes: 0 additions & 4 deletions payloads/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 1 addition & 11 deletions payloads/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -56,21 +51,16 @@ 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
cmd.Start.ImageUUID = testutil.ImageUUID
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
Expand Down
10 changes: 0 additions & 10 deletions testutil/payloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down Expand Up @@ -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: ""
Expand Down

0 comments on commit 0b03240

Please sign in to comment.