BAT enhancements for storage#997
Conversation
The source type for cloning the volume from should be specified with -source_type not -source-type. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
When creating a volume from image using the Open Stack volume API it is necessary to derive the new rbd image from the rbd image snapshot of the Ciao image. This is the same method as volumes created by booting instances. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Add tests to test creating volumes from images and from other volumes using "ciao-cli volume add". Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Address some mismatches between the numbers of arguments used in the format string relative to the number of arguments given. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2778085 to
7d60bc1
Compare
tpepper
left a comment
There was a problem hiding this comment.
What's the rationale for everything being a snapshot? Is this needed because each user needs to be able to write, and you can only have one writer?
| break | ||
| } | ||
|
|
||
| volumeUUID, err := bat.AddVolume(ctx, "", imageUUID, "image", &bat.VolumeOptions{}) |
There was a problem hiding this comment.
If there are no images this will probably fail which would be a bit misleading. Might be best to skip the rest of the test if imageUUID == "" or len(images) == 0
There was a problem hiding this comment.
Updated version of the patch now creates a test image to use.
|
Works fine for me although I did have one comment about one of the tests. Thanks for the go vet fixes. I'm working on a PR that enables static anaylsis on the BAT tests, and fixes a few other small issues. |
1 similar comment
By moving this function from the image_bat package to the bat package it can be used by other BAT test packages. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This removes the requirement that the cluster is populated with at least one image before running BAT. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Throughout the ciao code base we're trying to stardise on MiB rather than MB. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
4988fc7 to
90f91a7
Compare
We always use a snapshot for images. This fix should really have been part of #811 but we didn't have any test coverage of "ciao-cl volume add -source_type image -source Using snapshots gives us CoW behaviour of images allowing the underlying blocks to be shared across different volumes. This both saves space but also improves the cachability as more blocks are common across volumes. |
This PR adds some new BAT tests for storage that test the different source types whilst also testing the new size reporting and calculation.
This identified some issues also fixed by this PR.
@kaccardi to review ciao-controller change as owner
@markdryan to review bat changes as owner