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

Add VSAN policy update code to admin api #450

Merged
merged 1 commit into from
Jun 15, 2016

Conversation

andrewjstone
Copy link
Contributor

Add unit test for vsan_policy.update in admin cli

Add docs for vsan policy update in admin cli

Tested via make all and CI, as well as manual tests.

Fixes #329

@@ -151,6 +151,21 @@ def commands():
'func': policy_ls,
'help':
'List storage policies and volumes using those policies'
},
'update': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - and easy to review / read :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha :D

@msterin
Copy link
Contributor

msterin commented Jun 9, 2016

All in all the code looks good.

  • A few nits and suggestions (mainly about logging).
  • Main concern - the CI actually fails (out of space - see below), but the status does show OK - so
  • (1) something is still broken in CI reporting, most likely 'make test-esx' (I thought I've fixed it though) , and it may hide other issues
  • (2) you mentioned manual tests - can you also provide what exactly did you test manually, what was the result and why did you decide against piutting it in automatesd testing

CI log says:

Running unit tests in /tmp/vmdk_ops_unittest11080/vmdk_ops_test.py...
....FF
======================================================================
FAIL: testPolicy (__main__.VmdkCreateRemoveTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/vmdk_ops_unittest11080/vmdk_ops_test.py", line 125, in testPolicy
    self.assertEqual(err == None, unit[2], err)
AssertionError: {u'Error': 'Failed to create /vmfs/volumes/vsan:5204bc8bc03e1c20-5a4696067b772017/dockvols/vol_UnitTest_Create0.vmdk. Failed to create virtual disk: There is not enough space on the file system for the selected operation (13).\n'}

@andrewjstone
Copy link
Contributor Author

The automated tests are actually more comprehensive than the manual tests I performed. Manually, I only created and updated a policy file to check the output, and then tried to update wiht the same content to watch it fail. I didn't actually create any volumes to use a policy manually.

The only reason I did the manual tests was to sanity check my vsan/nimbus install and see the output before I ran make all.

@msterin
Copy link
Contributor

msterin commented Jun 11, 2016

I still see

AssertionError: {u'Error': 'Failed to create /vmfs/volumes/vsan:5204bc8bc03e1c20-5a4696067b772017/dockvols/vol_UnitTest_Create.vmdk. Failed to create virtual disk: There is not enough space on the file system for the selected operation (13).\n'}

in the CI log (which still shows as PASSED). Please take a look (the rest looks good, after merge conflicts cleanup)

failed_updates.append(volume_name)

if len(failed_updates) != 0:
# All volumes failed to update, so reset the original policy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: All => Some

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant All. I just moved it inside the next conditional to be more clear.

@pdhamdhere
Copy link
Contributor

Overall LGTM. Some minor suggestions above.

@andrewjstone
Copy link
Contributor Author

@msterin I have no idea why failing tests wouldn't cause CI to fail. Clearly they are failing correctly due to lack of space and being marked as failures by python test infrastructure. make test-esx also seems to work correctly so I'm at a bit of a loss. Will dig a bit further when CI comes back online and I rebase to latest master, before merge.

Add unit test for vsan_policy.update in admin cli

Add docs for vsan policy update in admin cli

Tested via make all and CI, as well as manual tests.

Fixes #329
@andrewjstone andrewjstone force-pushed the admin-cli-vsan-policy-update.ajs branch from 6782102 to edce62a Compare June 14, 2016 01:48
@andrewjstone
Copy link
Contributor Author

This branch was rebased on main and comments were addressed. make all passes against my nimbus setup with VSAN. Since this merge requires VSAN testing, it should probably wait until CI covers that, although I believe it's safe to merge now.

@msterin
Copy link
Contributor

msterin commented Jun 14, 2016

LGTM - but please wait with merge until VSAN in CI is back on-line and CI passes (/cc @kerneltime )

@msterin
Copy link
Contributor

msterin commented Jun 15, 2016

LGTM

@andrewjstone andrewjstone merged commit 37af53c into master Jun 15, 2016
@kerneltime kerneltime deleted the admin-cli-vsan-policy-update.ajs branch July 25, 2016 21:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants