-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openstack: Add support for using multiple data volumes #688
openstack: Add support for using multiple data volumes #688
Conversation
@@ -34,7 +34,7 @@ def __init__(self, disk_spec, name, zone, image=None): | |||
self.name = name | |||
self.zone = zone | |||
self.device = "" | |||
self.virtual_disks = (c for c in "cdefghijklmnopqrstuvwxyz") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing a PicklingError when the spec was being pickled. The error was caused by the generator.
Looks good to me. |
FYI we added a "Provider" contact list here - This should help is getting reviews from the original developers. Feel On Wed, Dec 2, 2015 at 10:52 AM, Carlos Torres notifications@github.com
Anthony F. Voellm (aka Tony) |
@meteorfox looks good for me :) I haven't currently environment to test it :( |
@meteorfox , Run error in my env version liberty. I don't know how to fix it yeah. default_config_constants.yaml: OpenStack: ./pkb.py --cloud=OpenStack --benchmarks=fio --noinstall_packages 2015-12-04 10:11:56,727 0c7659b8 Thread-1 fio(1/1) ERROR Got exception running FormatDisk: Got non-zero return code (1) executing sudo mke2fs -F -E lazy_itable_init=0 -O ^has_journal -t ext4 -b 4096 /dev/disk/by-id/virtio-ef21dff6-2e72-4a4e-9 mke2fs 1.42.9 (4-Feb-2014) |
@9723 Thanks for testing! Hmm.. what's your hypervisor backend, is it KVM? Also, do you consistently hit the error every time you try to run it or is it occasionally? |
@meteorfox , yes, I got the error every time when running fio benchmark and hypervisor backend use KVM. |
@9723 ok, thanks for catching the bug. I'm investigating the issue, most likely the bug is because it assumes all device paths for attachments start with |
0c23199
to
616bb08
Compare
@9723 Can you pull again and try the latest commit and check if it fixed the problem? Before this last commit, I was able to replicate the issue but not consistently. After this last commit, I ran several tests with fio using 1 and 4 volumes and it has been consistently working for me. Let me know if it works for you. Thanks! |
I caught another bug. It's not deleting all the volumes when using more than one. |
- Fix Pickling error caused by use of generator in class attributes. - Improve error handling of disk creation - Add switch for enabling verbose http log
616bb08
to
874170d
Compare
@kivio Ok, turned out that the exception classes in @9723 Ok, this time should work and also clean up the volumes. |
@meteorfox 👍 LGTM, Thanks. tested in liberty. |
@9723 @meteorfox i known this error on OpenStack Juno long since but this is little problematic. First thing, path returned by nova client is just suggestion not sure path. It's described in Nova Client documentation. Second thing when you start more than one volume in one time you can have race condition with /virtio- path. For me best try was getting next /dev/vd(bced..) on each machine. But it still is not that easy. This problem is based on KVM i don't known how other hypervisors on OpenStack works with it. |
Should we cherry pick this into v1.0.0? About ready? On Fri, Dec 4, 2015 at 12:09 AM, Marcin Karkocha notifications@github.com
Anthony F. Voellm (aka Tony) |
@@ -95,6 +95,13 @@ def Attach(self, vm): | |||
is_unattached = not(volume.status == "in-use" | |||
and volume.attachments) | |||
|
|||
for attachment in volume.attachments: | |||
if self.attach_id == attachment.get('volume_id'): | |||
self.device = attachment.get('device') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kivio I think using the 'device' property from the attachments list of dict objects we get back from volumes.get()
should be OK.
If you noticed at line 85, instead of giving a device hint, I just let OpenStack return the device path it got, then I just retrieve the actual device path once the volume is attached. I believe this is reliable, and will work for other kind of hypervisors.
For later releases of OpenStack, we will need to introduce the python-cinderclient library for volume management since these operations have been deprecated out of the nova client.
@meteorfox ok, sounds good to me. 👍 |
time.sleep(sleep) | ||
sleep_count += 1 | ||
if sleep_count == 10: | ||
sleep = 5 | ||
except (os_utils.NotFound, os_utils.BadRequest): | ||
except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth including some information on this in the logging statement? This could swallow an exception unrelated to the volume not being found...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmccoy Good point. I can append the exception message to the log.
@meteorfox: I just added a few questions. |
Reduce broadness of exception clause by catching specific exceptions instead of the broad Exception class.
e259681
to
bfb02ae
Compare
@cmccoy: I've narrowed down the exception scope to just the errors it expects to handle. I brought back the imports, directly in |
@meterfox - Thanks. 👍 |
Thanks everyone for the CRs |
openstack: Add support for using multiple data volumes
Before this PR, data disks where not working. This PR fixes that and adds the ability to use multiple volumes as well.