You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com> on 2013/04/05 03:57:02 UTC
Review Request: Remove 2k limitation for user data on a deployVMCmd issued
as an HTTP POST request
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs
-----
api/src/com/cloud/vm/UserVmService.java 2c33d41
api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
setup/db/create-schema.sql b1feb02
setup/db/db/schema-410to420.sql ab9df05
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
> On April 11, 2013, 8:55 p.m., Min Chen wrote:
> > In your description, you mentioned that it is not extensively tested yet. Is this still true? If not, please revise your description to avoid confusing people.
Not true anymore - apologies for the confusion. I'll put in details of all testing done when I upload the new diffs (wip).
- Venkata Siva Vijayendra
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19032
-----------------------------------------------------------
On April 16, 2013, 2:53 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 16, 2013, 2:53 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java d963b74
> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 77ba9fe
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java d281e5b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java fd826d9
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql fb760bf
> tools/marvin/marvin/cloudstackConnection.py 1caeef3
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Min Chen <mi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19032
-----------------------------------------------------------
In your description, you mentioned that it is not extensively tested yet. Is this still true? If not, please revise your description to avoid confusing people.
- Min Chen
On April 10, 2013, 9:59 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 10, 2013, 9:59 p.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 8fef422
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 1c3764a
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql c7c8b5b
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19572
-----------------------------------------------------------
- Venkata Siva Vijayendra Bhamidipati
On April 23, 2013, 1:55 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 23, 2013, 1:55 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java aa21136
> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
> api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
> server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql 10cdbba
> test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Prasanna Santhanam <ts...@apache.org>.
On Tue, Apr 23, 2013 at 02:08:09PM -0700, Vijayendra Bhamidipati wrote:
> Hi Prasanna,
>
> Thanks for catching the absence of license in the new file - I'll make the required changes.
>
> Regarding the POST, the whole query needs to be sent in as a POST
> query and not only the userdata as POST data, because CS APIs are
> supposed to work with either GET or POST. The doGet() and doPost()
> httpservlet routines in the mgmt. server's ApiServlet.java will
> process them in the appropriate way. The integration port code path
> also calls into the same code path that the latter routines call
> into.
Ok - because you said the following to Rohit on this thread, I changed marvin
to allow POST only in the body and the rest of the args as params in the url
GET-style. Is it something you decided against later?
"""
Yes, the POST will be handled by ApiServlet's doPost() only, and the userdata
will need to be put into the POST body.
"""
I'm ok with your implementation however and have applied it with changes to
your test. I also added an additional test to do the userdata via GET. The
tests will run on both devcloud and simulator.
These are the rebased commits on master:
4e9e7937ed5e56cbd7f678b2ed9863a56af16635 Fix Vijay's test to use the marvin integratin libararies
b0caae6b33347f36721f28dca1fa12e7b18f1cd1 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
~/workspace/cloudstack/incubator-cloudstack(branch:master) » nosetests --with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/component/test_deploy_vm_with_userdata.py --load --pdb
Test userdata as GET, size > 2k ... ok
Test userdata as POST, size > 2k ... ok
----------------------------------------------------------------------
Ran 2 tests in 15.791s
OK
I have another related request on how to handle this for marvin, apidocs and
cloudmonkey. Will raise a separate thread on that.
Thanks,
--
Prasanna.,
------------------------
Powered by BigRock.com
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Prasanna Santhanam <pr...@citrix.com>.
On Tue, Apr 23, 2013 at 02:08:09PM -0700, Vijayendra Bhamidipati wrote:
> Hi Prasanna,
>
> Thanks for catching the absence of license in the new file - I'll make the required changes.
>
> Regarding the POST, the whole query needs to be sent in as a POST
> query and not only the userdata as POST data, because CS APIs are
> supposed to work with either GET or POST. The doGet() and doPost()
> httpservlet routines in the mgmt. server's ApiServlet.java will
> process them in the appropriate way. The integration port code path
> also calls into the same code path that the latter routines call
> into.
Ok - because you said the following to Rohit on this thread, I changed marvin
to allow POST only in the body and the rest of the args as params in the url
GET-style. Is it something you decided against later?
"""
Yes, the POST will be handled by ApiServlet's doPost() only, and the userdata
will need to be put into the POST body.
"""
I'm ok with your implementation however and have applied it with changes to
your test. I also added an additional test to do the userdata via GET. The
tests will run on both devcloud and simulator.
These are the rebased commits on master:
4e9e7937ed5e56cbd7f678b2ed9863a56af16635 Fix Vijay's test to use the marvin integratin libararies
b0caae6b33347f36721f28dca1fa12e7b18f1cd1 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
~/workspace/cloudstack/incubator-cloudstack(branch:master) » nosetests --with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/component/test_deploy_vm_with_userdata.py --load --pdb
Test userdata as GET, size > 2k ... ok
Test userdata as POST, size > 2k ... ok
----------------------------------------------------------------------
Ran 2 tests in 15.791s
OK
I have another related request on how to handle this for marvin, apidocs and
cloudmonkey. Will raise a separate thread on that.
Thanks,
--
Prasanna.,
RE: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Vijayendra Bhamidipati <vi...@citrix.com>.
Hi Prasanna,
Thanks for catching the absence of license in the new file - I'll make the required changes.
Regarding the POST, the whole query needs to be sent in as a POST query and not only the userdata as POST data, because CS APIs are supposed to work with either GET or POST. The doGet() and doPost() httpservlet routines in the mgmt. server's ApiServlet.java will process them in the appropriate way. The integration port code path also calls into the same code path that the latter routines call into.
Regards,
Vijay
-----Original Message-----
From: Prasanna Santhanam [mailto:tsp@apache.org]
Sent: Tuesday, April 23, 2013 11:51 AM
To: Vijayendra Bhamidipati; Min Chen; Chip Childers; CloudStack Dev
Subject: Re: Review Request: Remove 2k limitation for user data on a deployVMCmd issued as an HTTP POST request
Also - you need to run a RAT test before the merge (if and when it happens). The test file doesn't have a license header for ASF.
--
Prasanna.,
On Wed, Apr 24, 2013 at 12:13:33AM +0530, Prasanna Santhanam wrote:
> Vijay - Min applied the patch in the branch http_post. I made changes
> to your test to make it use libraries from marvin appropriately. Don't
> hesitate to go change marvin if it makes sense to next time.
>
> What I'm seeing is that in your examples you've attached - you send
> all the request for deployVMCmd as POST whereas I imagine the user
> would only want to send his userdata as POST and the rest of the
> arguments to deployVM as GET. Is this not the case?
>
> I'm doing :
> deployVM [ GET(template = builtin, service = Small, zone = myzone) and
> POST( userdata = 2ksizeData) ]
>
> while you're doing
>
> deployVM [ POST(template = builtin, service = Small, zone = myzone,
> userdata = 2kSizeData) ]
>
> It's not clear how this POST data should go from the spec. Can you
> please clarify? Is it sensible to make either style work? Do we flout
> any RFC?
>
> Thanks,
>
> --
> Prasanna.,
>
> On Tue, Apr 23, 2013 at 04:08:14AM -0000, Prasanna Santhanam wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/10294/#review19574
> > -----------------------------------------------------------
> >
> >
> > The patch doesn't apply for me:
> >
> > ~/workspace/cloudstack/incubator-cloudstack/patch(branch:master) ?? git am -s 10294.patch
> > Applying: CLOUDSTACK-1086: DeployVirtualMachine userdata
> > enhancements
> > error: patch failed:
> > api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java:3
> > 12
> > error:
> > api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java:
> > patch does not apply
> > error: patch failed:
> > server/test/com/cloud/vm/dao/UserVmDaoImplTest.java:20
> > error: server/test/com/cloud/vm/dao/UserVmDaoImplTest.java: patch
> > does not apply
> > error: patch failed: setup/db/db/schema-410to420.sql:777
> > error: setup/db/db/schema-410to420.sql: patch does not apply
> > /Users/tsp/workspace/cloudstack/incubator-cloudstack/.git/rebase-apply/patch:1153: new blank line at EOF.
> > +
> > Patch failed at 0001 CLOUDSTACK-1086: DeployVirtualMachine userdata
> > enhancements When you have resolved this problem run "git am --resolved".
> > If you would prefer to skip this patch, instead run "git am --skip".
> > To restore the original branch and stop patching run "git am --abort".
> >
> > I'm trying to run your marvin test and see what the issue is in sending through post data. All commands now take postdata as a parameter.
> >
> > - Prasanna Santhanam
> >
> >
> > On April 23, 2013, 1:57 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
> > >
> > > -----------------------------------------------------------
> > > This is an automatically generated e-mail. To reply, visit:
> > > https://reviews.apache.org/r/10294/
> > > -----------------------------------------------------------
> > >
> > > (Updated April 23, 2013, 1:57 a.m.)
> > >
> > >
> > > Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
> > >
> > >
> > > Description
> > > -------
> > >
> > > Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
> > >
> > > This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
> > >
> > >
> > > This addresses bug CLOUDSTACK-1086.
> > >
> > >
> > > Diffs
> > > -----
> > >
> > > api/src/com/cloud/vm/UserVmService.java aa21136
> > > api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> > > api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
> > > api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
> > > core/src/com/cloud/vm/UserVmVO.java a16eaf9
> > > server/src/com/cloud/api/ApiDispatcher.java 925d90a
> > > server/src/com/cloud/api/ApiServer.java d842819
> > > server/src/com/cloud/api/ApiServerService.java 12d8b52
> > > server/src/com/cloud/api/ApiServlet.java 03bfb5f
> > > server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
> > > server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
> > > server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> > > server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> > > server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> > > setup/db/db/schema-410to420.sql 10cdbba
> > > test/integration/component/test_deploy_vm_with_userdata.py
> > > PRE-CREATION
> > >
> > > Diff: https://reviews.apache.org/r/10294/diff/
> > >
> > >
> > > Testing
> > > -------
> > >
> > > Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
> > >
> > > Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
> > >
> > >
> > > Thanks,
> > >
> > > Venkata Siva Vijayendra Bhamidipati
> > >
> > >
> >
>
>
> ------------------------
> Powered by BigRock.com
------------------------
Powered by BigRock.com
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Prasanna Santhanam <ts...@apache.org>.
Also - you need to run a RAT test before the merge (if and when it
happens). The test file doesn't have a license header for ASF.
--
Prasanna.,
On Wed, Apr 24, 2013 at 12:13:33AM +0530, Prasanna Santhanam wrote:
> Vijay - Min applied the patch in the branch http_post. I made changes
> to your test to make it use libraries from marvin appropriately. Don't
> hesitate to go change marvin if it makes sense to next time.
>
> What I'm seeing is that in your examples you've attached - you send
> all the request for deployVMCmd as POST whereas I imagine the user
> would only want to send his userdata as POST and the rest of the
> arguments to deployVM as GET. Is this not the case?
>
> I'm doing :
> deployVM [ GET(template = builtin, service = Small, zone = myzone) and POST( userdata = 2ksizeData) ]
>
> while you're doing
>
> deployVM [ POST(template = builtin, service = Small, zone = myzone, userdata = 2kSizeData) ]
>
> It's not clear how this POST data should go from the spec. Can you
> please clarify? Is it sensible to make either style work? Do we flout
> any RFC?
>
> Thanks,
>
> --
> Prasanna.,
>
> On Tue, Apr 23, 2013 at 04:08:14AM -0000, Prasanna Santhanam wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/10294/#review19574
> > -----------------------------------------------------------
> >
> >
> > The patch doesn't apply for me:
> >
> > ~/workspace/cloudstack/incubator-cloudstack/patch(branch:master) ?? git am -s 10294.patch
> > Applying: CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
> > error: patch failed: api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java:312
> > error: api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java: patch does not apply
> > error: patch failed: server/test/com/cloud/vm/dao/UserVmDaoImplTest.java:20
> > error: server/test/com/cloud/vm/dao/UserVmDaoImplTest.java: patch does not apply
> > error: patch failed: setup/db/db/schema-410to420.sql:777
> > error: setup/db/db/schema-410to420.sql: patch does not apply
> > /Users/tsp/workspace/cloudstack/incubator-cloudstack/.git/rebase-apply/patch:1153: new blank line at EOF.
> > +
> > Patch failed at 0001 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
> > When you have resolved this problem run "git am --resolved".
> > If you would prefer to skip this patch, instead run "git am --skip".
> > To restore the original branch and stop patching run "git am --abort".
> >
> > I'm trying to run your marvin test and see what the issue is in sending through post data. All commands now take postdata as a parameter.
> >
> > - Prasanna Santhanam
> >
> >
> > On April 23, 2013, 1:57 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
> > >
> > > -----------------------------------------------------------
> > > This is an automatically generated e-mail. To reply, visit:
> > > https://reviews.apache.org/r/10294/
> > > -----------------------------------------------------------
> > >
> > > (Updated April 23, 2013, 1:57 a.m.)
> > >
> > >
> > > Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
> > >
> > >
> > > Description
> > > -------
> > >
> > > Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
> > >
> > > This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
> > >
> > >
> > > This addresses bug CLOUDSTACK-1086.
> > >
> > >
> > > Diffs
> > > -----
> > >
> > > api/src/com/cloud/vm/UserVmService.java aa21136
> > > api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> > > api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
> > > api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
> > > core/src/com/cloud/vm/UserVmVO.java a16eaf9
> > > server/src/com/cloud/api/ApiDispatcher.java 925d90a
> > > server/src/com/cloud/api/ApiServer.java d842819
> > > server/src/com/cloud/api/ApiServerService.java 12d8b52
> > > server/src/com/cloud/api/ApiServlet.java 03bfb5f
> > > server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
> > > server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
> > > server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> > > server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> > > server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> > > setup/db/db/schema-410to420.sql 10cdbba
> > > test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
> > >
> > > Diff: https://reviews.apache.org/r/10294/diff/
> > >
> > >
> > > Testing
> > > -------
> > >
> > > Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
> > >
> > > Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
> > >
> > >
> > > Thanks,
> > >
> > > Venkata Siva Vijayendra Bhamidipati
> > >
> > >
> >
>
>
> ------------------------
> Powered by BigRock.com
------------------------
Powered by BigRock.com
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Prasanna Santhanam <ts...@apache.org>.
Vijay - Min applied the patch in the branch http_post. I made changes
to your test to make it use libraries from marvin appropriately. Don't
hesitate to go change marvin if it makes sense to next time.
What I'm seeing is that in your examples you've attached - you send
all the request for deployVMCmd as POST whereas I imagine the user
would only want to send his userdata as POST and the rest of the
arguments to deployVM as GET. Is this not the case?
I'm doing :
deployVM [ GET(template = builtin, service = Small, zone = myzone) and POST( userdata = 2ksizeData) ]
while you're doing
deployVM [ POST(template = builtin, service = Small, zone = myzone, userdata = 2kSizeData) ]
It's not clear how this POST data should go from the spec. Can you
please clarify? Is it sensible to make either style work? Do we flout
any RFC?
Thanks,
--
Prasanna.,
On Tue, Apr 23, 2013 at 04:08:14AM -0000, Prasanna Santhanam wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/#review19574
> -----------------------------------------------------------
>
>
> The patch doesn't apply for me:
>
> ~/workspace/cloudstack/incubator-cloudstack/patch(branch:master) ?? git am -s 10294.patch
> Applying: CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
> error: patch failed: api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java:312
> error: api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java: patch does not apply
> error: patch failed: server/test/com/cloud/vm/dao/UserVmDaoImplTest.java:20
> error: server/test/com/cloud/vm/dao/UserVmDaoImplTest.java: patch does not apply
> error: patch failed: setup/db/db/schema-410to420.sql:777
> error: setup/db/db/schema-410to420.sql: patch does not apply
> /Users/tsp/workspace/cloudstack/incubator-cloudstack/.git/rebase-apply/patch:1153: new blank line at EOF.
> +
> Patch failed at 0001 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
>
> I'm trying to run your marvin test and see what the issue is in sending through post data. All commands now take postdata as a parameter.
>
> - Prasanna Santhanam
>
>
> On April 23, 2013, 1:57 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/10294/
> > -----------------------------------------------------------
> >
> > (Updated April 23, 2013, 1:57 a.m.)
> >
> >
> > Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
> >
> >
> > Description
> > -------
> >
> > Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
> >
> > This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
> >
> >
> > This addresses bug CLOUDSTACK-1086.
> >
> >
> > Diffs
> > -----
> >
> > api/src/com/cloud/vm/UserVmService.java aa21136
> > api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> > api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
> > api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
> > core/src/com/cloud/vm/UserVmVO.java a16eaf9
> > server/src/com/cloud/api/ApiDispatcher.java 925d90a
> > server/src/com/cloud/api/ApiServer.java d842819
> > server/src/com/cloud/api/ApiServerService.java 12d8b52
> > server/src/com/cloud/api/ApiServlet.java 03bfb5f
> > server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
> > server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
> > server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> > server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> > server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> > setup/db/db/schema-410to420.sql 10cdbba
> > test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
> >
> > Diff: https://reviews.apache.org/r/10294/diff/
> >
> >
> > Testing
> > -------
> >
> > Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
> >
> > Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
> >
> >
> > Thanks,
> >
> > Venkata Siva Vijayendra Bhamidipati
> >
> >
>
------------------------
Powered by BigRock.com
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Prasanna Santhanam <ts...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19574
-----------------------------------------------------------
The patch doesn't apply for me:
~/workspace/cloudstack/incubator-cloudstack/patch(branch:master) » git am -s 10294.patch
Applying: CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
error: patch failed: api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java:312
error: api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java: patch does not apply
error: patch failed: server/test/com/cloud/vm/dao/UserVmDaoImplTest.java:20
error: server/test/com/cloud/vm/dao/UserVmDaoImplTest.java: patch does not apply
error: patch failed: setup/db/db/schema-410to420.sql:777
error: setup/db/db/schema-410to420.sql: patch does not apply
/Users/tsp/workspace/cloudstack/incubator-cloudstack/.git/rebase-apply/patch:1153: new blank line at EOF.
+
Patch failed at 0001 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
I'm trying to run your marvin test and see what the issue is in sending through post data. All commands now take postdata as a parameter.
- Prasanna Santhanam
On April 23, 2013, 1:57 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 23, 2013, 1:57 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java aa21136
> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
> api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
> server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql 10cdbba
> test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
> Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
>
> Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Marcus Sorensen <sh...@gmail.com>.
Anything special required to do this POST? Just read this thread when
searching for "userdata 2k" and noticed that POST is supposed to be
supported, but if I run the following it doesn't work:
curl --request POST 'http://localhost:8096/client/api' --data
'command=listVirtualMachines'
On Wed, Apr 24, 2013 at 5:30 PM, Min Chen <mi...@citrix.com> wrote:
>
>
>> On April 24, 2013, 11:29 p.m., Min Chen wrote:
>> > Ship It!
>
> Prasanna has fixed the marvin test and pushed to master.
> These are the rebased commits on master:
> 4e9e7937ed5e56cbd7f678b2ed9863a56af16635 Fix Vijay's test to use the marvin integratin libararies
> b0caae6b33347f36721f28dca1fa12e7b18f1cd1 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
>
>
> - Min
>
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/#review19680
> -----------------------------------------------------------
>
>
> On April 23, 2013, 9:45 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>>
>> -----------------------------------------------------------
>> This is an automatically generated e-mail. To reply, visit:
>> https://reviews.apache.org/r/10294/
>> -----------------------------------------------------------
>>
>> (Updated April 23, 2013, 9:45 p.m.)
>>
>>
>> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>>
>>
>> Description
>> -------
>>
>> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>>
>> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>>
>>
>> This addresses bug CLOUDSTACK-1086.
>>
>>
>> Diffs
>> -----
>>
>> api/src/com/cloud/vm/UserVmService.java aa21136
>> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
>> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
>> api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
>> core/src/com/cloud/vm/UserVmVO.java a16eaf9
>> server/src/com/cloud/api/ApiDispatcher.java 925d90a
>> server/src/com/cloud/api/ApiServer.java d842819
>> server/src/com/cloud/api/ApiServerService.java 12d8b52
>> server/src/com/cloud/api/ApiServlet.java 03bfb5f
>> server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
>> server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
>> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
>> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
>> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
>> setup/db/db/schema-410to420.sql 10cdbba
>> test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
>>
>> Diff: https://reviews.apache.org/r/10294/diff/
>>
>>
>> Testing
>> -------
>>
>> Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
>>
>> Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
>>
>>
>> Thanks,
>>
>> Venkata Siva Vijayendra Bhamidipati
>>
>>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Min Chen <mi...@citrix.com>.
> On April 24, 2013, 11:29 p.m., Min Chen wrote:
> > Ship It!
Prasanna has fixed the marvin test and pushed to master.
These are the rebased commits on master:
4e9e7937ed5e56cbd7f678b2ed9863a56af16635 Fix Vijay's test to use the marvin integratin libararies
b0caae6b33347f36721f28dca1fa12e7b18f1cd1 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
- Min
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19680
-----------------------------------------------------------
On April 23, 2013, 9:45 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 23, 2013, 9:45 p.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java aa21136
> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
> api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
> server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql 10cdbba
> test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
> Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
>
> Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Min Chen <mi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19680
-----------------------------------------------------------
Ship it!
Ship It!
- Min Chen
On April 23, 2013, 9:45 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 23, 2013, 9:45 p.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java aa21136
> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
> api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
> server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql 10cdbba
> test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
> Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
>
> Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 23, 2013, 9:45 p.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
Hi Prasanna, Min,
Adding the AL header to the marvin testcase. This latest diff is on top of master. I'm not sure why my patches are having issues in the past few submissions - I generate the patch using git format-patch -M -C options and it's worked before.. please do let me know what you follow, and I'll use the same steps going forward. I hope this patch applies.
Regards,
Vijay
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs (updated)
-----
api/src/com/cloud/vm/UserVmService.java aa21136
api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql 10cdbba
test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 23, 2013, 1:57 a.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs
-----
api/src/com/cloud/vm/UserVmService.java aa21136
api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql 10cdbba
test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
Diff: https://reviews.apache.org/r/10294/diff/
Testing (updated)
-------
Manual testing done with scripts generating large/small userdata during creation of VMs, with both GET and POST requests confirmed to work correctly, on both integration port and the 8080 port.
Basic Marvin test to create a VM with user data has been written. Since marvin doesn't yet support POSTable APIs, as soon as that is made available for create/update VM operations, marvin tests will be written for the same. Requesting that this be noted as an AI for the future.
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 23, 2013, 1:55 a.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
Uploading testing scripts.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs
-----
api/src/com/cloud/vm/UserVmService.java aa21136
api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql 10cdbba
test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 23, 2013, 1:52 a.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
Script to create a VM using a GET request to send user data on integration port.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs
-----
api/src/com/cloud/vm/UserVmService.java aa21136
api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql 10cdbba
test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 23, 2013, 1:49 a.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
In this latest patch are fixes for a few issues related to userdata propagation detected during manual testing. I've removed the marvin related changes since Prasanna is making them separately. I have added a marvin test to deploy a VM with user data. However, VirtualMachine.create() isn't written to take POST yet, and it needs to be changed. I did make changes to the framework - but they didn't work as I expected. The VirtualMachine.create() code path uses the python requests package to send out GET/POST requests. Somewhere the post data is not being honoured. Prasanna, if you can take a look, that would be great. At the moment, it doesn't look like marvin supports POST APIs.
I will also be uploading the standalone scripts I used to manually test the GET/POST with small/large userdata. I request that writing the marvin test for POST be taken as an action item for now, so that I can complete it once the marvin API issues are addressed, and that this patch be pushed upstream.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs (updated)
-----
api/src/com/cloud/vm/UserVmService.java aa21136
api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 70c0159
api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java ff8fff1
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 1843f60
server/test/com/cloud/vm/MockUserVmManagerImpl.java 0d0a8f4
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql 10cdbba
test/integration/component/test_deploy_vm_with_userdata.py PRE-CREATION
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 17, 2013, 5:44 a.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
Incorporating changes suggested by Prasanna.
Have tested the code for both GET and POST HTTP calls. GET fails as expected when > 2K of userdata is provided, and succeeds when less than 2K is passed in. POST succeeds when upto 32K of userdata is supplied and fails if the userdata decoded size exceeds 32K.
Random userdata was generated using userdata = b'%s'%(os.urandom(x*1024)) where x is the desired number of KB.
I'm having a few issues with marvin in my development environment, and am working on putting in the marvin test. The standalone test scripts worked, it's just a matter of getting the marvin test in place.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs (updated)
-----
api/src/com/cloud/vm/UserVmService.java d963b74
api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 77ba9fe
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 53a57c8
server/test/com/cloud/vm/MockUserVmManagerImpl.java fd826d9
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql 6a7a72c
tools/marvin/marvin/cloudstackConnection.py 1caeef3
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by prasanna <ts...@apache.org>.
On 17 April 2013 23:13, Chiradeep Vittal <Ch...@citrix.com> wrote:
> Would be great if it passes pep8 also.(just my nitpicky self)
>
Done - I'll clean up the rest of the marvin modules gradually.
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Chiradeep Vittal <Ch...@citrix.com>.
Would be great if it passes pep8 also.(just my nitpicky self)
On 4/17/13 6:49 AM, "prasanna" <ts...@apache.org> wrote:
>On 17 April 2013 17:10, Prasanna Santhanam <ts...@apache.org> wrote:
>> On Wed, Apr 17, 2013 at 11:52:08AM +0530, Prasanna Santhanam wrote:
>>> On Wed, Apr 17, 2013 at 11:10:01AM +0530, Rohit Yadav wrote:
>>> >
>>> >
>>> > If it does not cost much, let's introduce a new dependency for
>>>requesting
>>> > stuff (get or post etc.) using "requests" [1] for both marvin and
>>> > cloudmonkey. Vijay, you can write your own requester, as it's not
>>>much
>>> > effort required to implement your own requester once you how
>>>signature is
>>> > calculated.
>>> >
>>> > IMO, cloudstackConnection could be rewritten using latest ways and
>>>better
>>> > libraries as it's not much code and is totally do-able with much less
>>> > effort. A lot of flows for auth or non-auth are inter-dependent, the
>>> > json->obj and obj->json parts and requesting logic is not straight
>>>forward
>>> > (each method does *only* one thing). We need to make it generic by
>>> > providing both raw and processed outputs, for example the result
>>>expects to
>>> > return an obj and not json (maybe I need json and not an obj), one
>>>reason
>>> > why I chose to write my own for cloudmonkey after I tried to reuse
>>>it.
>>> > Lastly, host marvin on pypi so it's easier for any developer to get
>>>it off
>>> > the shelf and start hacking some cool clients.
>>> >
>>> > Cheers.
>>> >
>>> > [1] http://docs.python-requests.org/en/latest/
>>> >
>>> >
>>>
>>> Yeah - we should simplify cloudstackConnection and make it easily
>>> exportable for both cloudmonkey,marvin and any other tools that might
>>> require to make connections to CS mgmt. requests certainly looks
>>> elegant. I'm trying to experiment with it to see if I can cook up
>>> something for marvin.
>>>
>>> At one point I moved from httplib to urllib2 to overcome an annoying
>>> BadStatusLine issue from httplib. I still find it hard to throttle
>>> multiple tests through a single connection and urllib3 seems to handle
>>> that. requests appears to be based on urllib3. So it would make sense
>>> to move to it.
>>>
>>> The json decode,encode is not done within cloudstackConnection. That
>>> part is annoying and I explored json and simplejson and there doesn't
>>> seem to be an easy way to accomplish marvin's case. Esp. with nested
>>> json objects I find it easier to use a recursive json decoder as in
>>> jsonHelper. I've switched to simplejson and find that it performs
>>> better for large jsons like our listXxx calls. jsonHelper right now
>>> makes plain python objects which can be improved to make it a response
>>> object as returned by the API. So a createPhysicalNetworkResponse
>>> looks like the physicalNetworkResponse and not a plain python dict.
>>>
>>
>> I refactored the cloudstackconnection and pushed a wip branch
>> requestsformarvin. Just need to iron out the POST data passing for
>> cmds and the key signing. I think we can add the login mechanism based
>> on session-based auth that the UI does with requests as well. That way
>> we have a single module for all forms of auth done by CS.
>>
>
>Fixed in master and tested using the bvt. I added some basic support
>for being able to handle POST but it's not yet clear to me which of
>the APIs will handle POST. May be if API discovery exposes the
>mechanism GET/POST for an API we can handle the POST data elegantly
>for marvin and cloudmonkey. What say?
>
>I'm trying to bring in further changes to marvin and add DSL support
>after which I'll look into putting it up on pypi.
>
>
>commit 167781ec0184f1332c0b45ca599f460d7d7b5c92
>Author: Prasanna Santhanam <ts...@apache.org>
>Date: Wed Apr 17 17:06:15 2013 +0530
>
> refactor marvin to use requests instead of urllib2
>
> Use python-requests [1] for Marvin. Requests enables graceful handling
> of http connections. Marvin's cloudstackConnection has been
>refactored,
> cleaned up to act as a single module for all kinds of cloudstack API
> requesting.
>
> TODO:
> 1. session based login mechanism of the UI should work from
> cloudstackConnection
> 2. cloudmonkey can also reuse /import marvin.cloudstackConnection
> 3. More graceful handling of POST requests
>
> [1] http://docs.python-requests.org/en/latest/
>
> Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by prasanna <ts...@apache.org>.
On 17 April 2013 17:10, Prasanna Santhanam <ts...@apache.org> wrote:
> On Wed, Apr 17, 2013 at 11:52:08AM +0530, Prasanna Santhanam wrote:
>> On Wed, Apr 17, 2013 at 11:10:01AM +0530, Rohit Yadav wrote:
>> >
>> >
>> > If it does not cost much, let's introduce a new dependency for requesting
>> > stuff (get or post etc.) using "requests" [1] for both marvin and
>> > cloudmonkey. Vijay, you can write your own requester, as it's not much
>> > effort required to implement your own requester once you how signature is
>> > calculated.
>> >
>> > IMO, cloudstackConnection could be rewritten using latest ways and better
>> > libraries as it's not much code and is totally do-able with much less
>> > effort. A lot of flows for auth or non-auth are inter-dependent, the
>> > json->obj and obj->json parts and requesting logic is not straight forward
>> > (each method does *only* one thing). We need to make it generic by
>> > providing both raw and processed outputs, for example the result expects to
>> > return an obj and not json (maybe I need json and not an obj), one reason
>> > why I chose to write my own for cloudmonkey after I tried to reuse it.
>> > Lastly, host marvin on pypi so it's easier for any developer to get it off
>> > the shelf and start hacking some cool clients.
>> >
>> > Cheers.
>> >
>> > [1] http://docs.python-requests.org/en/latest/
>> >
>> >
>>
>> Yeah - we should simplify cloudstackConnection and make it easily
>> exportable for both cloudmonkey,marvin and any other tools that might
>> require to make connections to CS mgmt. requests certainly looks
>> elegant. I'm trying to experiment with it to see if I can cook up
>> something for marvin.
>>
>> At one point I moved from httplib to urllib2 to overcome an annoying
>> BadStatusLine issue from httplib. I still find it hard to throttle
>> multiple tests through a single connection and urllib3 seems to handle
>> that. requests appears to be based on urllib3. So it would make sense
>> to move to it.
>>
>> The json decode,encode is not done within cloudstackConnection. That
>> part is annoying and I explored json and simplejson and there doesn't
>> seem to be an easy way to accomplish marvin's case. Esp. with nested
>> json objects I find it easier to use a recursive json decoder as in
>> jsonHelper. I've switched to simplejson and find that it performs
>> better for large jsons like our listXxx calls. jsonHelper right now
>> makes plain python objects which can be improved to make it a response
>> object as returned by the API. So a createPhysicalNetworkResponse
>> looks like the physicalNetworkResponse and not a plain python dict.
>>
>
> I refactored the cloudstackconnection and pushed a wip branch
> requestsformarvin. Just need to iron out the POST data passing for
> cmds and the key signing. I think we can add the login mechanism based
> on session-based auth that the UI does with requests as well. That way
> we have a single module for all forms of auth done by CS.
>
Fixed in master and tested using the bvt. I added some basic support
for being able to handle POST but it's not yet clear to me which of
the APIs will handle POST. May be if API discovery exposes the
mechanism GET/POST for an API we can handle the POST data elegantly
for marvin and cloudmonkey. What say?
I'm trying to bring in further changes to marvin and add DSL support
after which I'll look into putting it up on pypi.
commit 167781ec0184f1332c0b45ca599f460d7d7b5c92
Author: Prasanna Santhanam <ts...@apache.org>
Date: Wed Apr 17 17:06:15 2013 +0530
refactor marvin to use requests instead of urllib2
Use python-requests [1] for Marvin. Requests enables graceful handling
of http connections. Marvin's cloudstackConnection has been refactored,
cleaned up to act as a single module for all kinds of cloudstack API
requesting.
TODO:
1. session based login mechanism of the UI should work from
cloudstackConnection
2. cloudmonkey can also reuse /import marvin.cloudstackConnection
3. More graceful handling of POST requests
[1] http://docs.python-requests.org/en/latest/
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Prasanna Santhanam <ts...@apache.org>.
On Wed, Apr 17, 2013 at 11:52:08AM +0530, Prasanna Santhanam wrote:
> On Wed, Apr 17, 2013 at 11:10:01AM +0530, Rohit Yadav wrote:
> >
> >
> > If it does not cost much, let's introduce a new dependency for requesting
> > stuff (get or post etc.) using "requests" [1] for both marvin and
> > cloudmonkey. Vijay, you can write your own requester, as it's not much
> > effort required to implement your own requester once you how signature is
> > calculated.
> >
> > IMO, cloudstackConnection could be rewritten using latest ways and better
> > libraries as it's not much code and is totally do-able with much less
> > effort. A lot of flows for auth or non-auth are inter-dependent, the
> > json->obj and obj->json parts and requesting logic is not straight forward
> > (each method does *only* one thing). We need to make it generic by
> > providing both raw and processed outputs, for example the result expects to
> > return an obj and not json (maybe I need json and not an obj), one reason
> > why I chose to write my own for cloudmonkey after I tried to reuse it.
> > Lastly, host marvin on pypi so it's easier for any developer to get it off
> > the shelf and start hacking some cool clients.
> >
> > Cheers.
> >
> > [1] http://docs.python-requests.org/en/latest/
> >
> >
>
> Yeah - we should simplify cloudstackConnection and make it easily
> exportable for both cloudmonkey,marvin and any other tools that might
> require to make connections to CS mgmt. requests certainly looks
> elegant. I'm trying to experiment with it to see if I can cook up
> something for marvin.
>
> At one point I moved from httplib to urllib2 to overcome an annoying
> BadStatusLine issue from httplib. I still find it hard to throttle
> multiple tests through a single connection and urllib3 seems to handle
> that. requests appears to be based on urllib3. So it would make sense
> to move to it.
>
> The json decode,encode is not done within cloudstackConnection. That
> part is annoying and I explored json and simplejson and there doesn't
> seem to be an easy way to accomplish marvin's case. Esp. with nested
> json objects I find it easier to use a recursive json decoder as in
> jsonHelper. I've switched to simplejson and find that it performs
> better for large jsons like our listXxx calls. jsonHelper right now
> makes plain python objects which can be improved to make it a response
> object as returned by the API. So a createPhysicalNetworkResponse
> looks like the physicalNetworkResponse and not a plain python dict.
>
I refactored the cloudstackconnection and pushed a wip branch
requestsformarvin. Just need to iron out the POST data passing for
cmds and the key signing. I think we can add the login mechanism based
on session-based auth that the UI does with requests as well. That way
we have a single module for all forms of auth done by CS.
--
Prasanna.,
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Prasanna Santhanam <ts...@apache.org>.
On Wed, Apr 17, 2013 at 11:10:01AM +0530, Rohit Yadav wrote:
>
>
> If it does not cost much, let's introduce a new dependency for requesting
> stuff (get or post etc.) using "requests" [1] for both marvin and
> cloudmonkey. Vijay, you can write your own requester, as it's not much
> effort required to implement your own requester once you how signature is
> calculated.
>
> IMO, cloudstackConnection could be rewritten using latest ways and better
> libraries as it's not much code and is totally do-able with much less
> effort. A lot of flows for auth or non-auth are inter-dependent, the
> json->obj and obj->json parts and requesting logic is not straight forward
> (each method does *only* one thing). We need to make it generic by
> providing both raw and processed outputs, for example the result expects to
> return an obj and not json (maybe I need json and not an obj), one reason
> why I chose to write my own for cloudmonkey after I tried to reuse it.
> Lastly, host marvin on pypi so it's easier for any developer to get it off
> the shelf and start hacking some cool clients.
>
> Cheers.
>
> [1] http://docs.python-requests.org/en/latest/
>
>
Yeah - we should simplify cloudstackConnection and make it easily
exportable for both cloudmonkey,marvin and any other tools that might
require to make connections to CS mgmt. requests certainly looks
elegant. I'm trying to experiment with it to see if I can cook up
something for marvin.
At one point I moved from httplib to urllib2 to overcome an annoying
BadStatusLine issue from httplib. I still find it hard to throttle
multiple tests through a single connection and urllib3 seems to handle
that. requests appears to be based on urllib3. So it would make sense
to move to it.
The json decode,encode is not done within cloudstackConnection. That
part is annoying and I explored json and simplejson and there doesn't
seem to be an easy way to accomplish marvin's case. Esp. with nested
json objects I find it easier to use a recursive json decoder as in
jsonHelper. I've switched to simplejson and find that it performs
better for large jsons like our listXxx calls. jsonHelper right now
makes plain python objects which can be improved to make it a response
object as returned by the API. So a createPhysicalNetworkResponse
looks like the physicalNetworkResponse and not a plain python dict.
--
Prasanna.,
Re: Review Request: Remove 2k limitation for user data on a
deployVMCmd issued as an HTTP POST request
Posted by Rohit Yadav <bh...@apache.org>.
On Wed, Apr 17, 2013 at 11:00 AM, Venkata Siva Vijayendra Bhamidipati <
vijayendra.bhamidipati@citrix.com> wrote:
>
>
> > On April 16, 2013, 4:31 a.m., Prasanna Santhanam wrote:
> > > tools/marvin/marvin/cloudstackConnection.py, line 61
> > > <
> https://reviews.apache.org/r/10294/diff/4/?file=281521#file281521line61>
> > >
> > > How and when does marvin decide to use POST? Which commands will
> call the POST httpmethod? May be you can provide a more complete example
> when your test is ready.
>
> I saw that make_request() was calling into make_request_with_auth(), so I
> put in the default value for httpmethod as GET, but missed the fact that
> make_request_with_auth() is calling itself when retrying - thanks for
> catching that - I've put in a default value of GET for this parameter. When
> a unittest calls this function, it would be expected to pass in all
> arguments in case it wants to use POST, but existing tests that simply use
> GET don't need to change.. does that look ok? Or is there a better way for
> me to implement this?
>
>
> > On April 16, 2013, 4:31 a.m., Prasanna Santhanam wrote:
> > > tools/marvin/marvin/cloudstackConnection.py, line 77
> > > <
> https://reviews.apache.org/r/10294/diff/4/?file=281521#file281521line77>
> > >
> > > Are you sure you don't want to urlencode the POST data?
> > >
>
> Yes that is definitely better than doing requestUrl =
> "&".join(["=".join([r[0], urllib.quote_plus(str(r[1]))]) for r in request])
> , which won't take care of spaces either.. have made the change here and
> even in make_request_without_auth()..
>
>
> > On April 16, 2013, 4:31 a.m., Prasanna Santhanam wrote:
> > > tools/marvin/marvin/cloudstackConnection.py, line 79
> > > <
> https://reviews.apache.org/r/10294/diff/4/?file=281521#file281521line79>
> > >
> > > Minor nitpick: urllib2.Request() can be used for both GET and POST
> and you can set the data argument only when you intend to use POST. That
> will reduce some code duplication here.
>
> I changed both cases to use urllib2.Request(), but still it's still the
> same number of lines :) Is there a way I can merge those two separate calls
> to urllib2.Request(url) and urllib2.Request(url, requestUrl) into a single
> call?
>
If it does not cost much, let's introduce a new dependency for requesting
stuff (get or post etc.) using "requests" [1] for both marvin and
cloudmonkey. Vijay, you can write your own requester, as it's not much
effort required to implement your own requester once you how signature is
calculated.
IMO, cloudstackConnection could be rewritten using latest ways and better
libraries as it's not much code and is totally do-able with much less
effort. A lot of flows for auth or non-auth are inter-dependent, the
json->obj and obj->json parts and requesting logic is not straight forward
(each method does *only* one thing). We need to make it generic by
providing both raw and processed outputs, for example the result expects to
return an obj and not json (maybe I need json and not an obj), one reason
why I chose to write my own for cloudmonkey after I tried to reuse it.
Lastly, host marvin on pypi so it's easier for any developer to get it off
the shelf and start hacking some cool clients.
Cheers.
[1] http://docs.python-requests.org/en/latest/
>
>
> - Venkata Siva Vijayendra
>
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/#review19245
> -----------------------------------------------------------
>
>
> On April 16, 2013, 2:53 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/10294/
> > -----------------------------------------------------------
> >
> > (Updated April 16, 2013, 2:53 a.m.)
> >
> >
> > Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven
> Yang, and Min Chen.
> >
> >
> > Description
> > -------
> >
> > Please refer to
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancementsfor a background on the requirements driving this patch.
> >
> > This patch hasn't been extensively tested yet, and I will update this
> request with more info. I am uploading a first diff for initial
> review/comments.
> >
> >
> > This addresses bug CLOUDSTACK-1086.
> >
> >
> > Diffs
> > -----
> >
> > api/src/com/cloud/vm/UserVmService.java d963b74
> > api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> > api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
> 77ba9fe
> > core/src/com/cloud/vm/UserVmVO.java a16eaf9
> > server/src/com/cloud/api/ApiDispatcher.java 925d90a
> > server/src/com/cloud/api/ApiServer.java d842819
> > server/src/com/cloud/api/ApiServerService.java 12d8b52
> > server/src/com/cloud/api/ApiServlet.java 03bfb5f
> > server/src/com/cloud/vm/UserVmManagerImpl.java d281e5b
> > server/test/com/cloud/vm/MockUserVmManagerImpl.java fd826d9
> > server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> > server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java
> PRE-CREATION
> > server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> > setup/db/db/schema-410to420.sql fb760bf
> > tools/marvin/marvin/cloudstackConnection.py 1caeef3
> >
> > Diff: https://reviews.apache.org/r/10294/diff/
> >
> >
> > Testing
> > -------
> >
> >
> > Thanks,
> >
> > Venkata Siva Vijayendra Bhamidipati
> >
> >
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
> On April 16, 2013, 4:31 a.m., Prasanna Santhanam wrote:
> > tools/marvin/marvin/cloudstackConnection.py, line 61
> > <https://reviews.apache.org/r/10294/diff/4/?file=281521#file281521line61>
> >
> > How and when does marvin decide to use POST? Which commands will call the POST httpmethod? May be you can provide a more complete example when your test is ready.
I saw that make_request() was calling into make_request_with_auth(), so I put in the default value for httpmethod as GET, but missed the fact that make_request_with_auth() is calling itself when retrying - thanks for catching that - I've put in a default value of GET for this parameter. When a unittest calls this function, it would be expected to pass in all arguments in case it wants to use POST, but existing tests that simply use GET don't need to change.. does that look ok? Or is there a better way for me to implement this?
> On April 16, 2013, 4:31 a.m., Prasanna Santhanam wrote:
> > tools/marvin/marvin/cloudstackConnection.py, line 77
> > <https://reviews.apache.org/r/10294/diff/4/?file=281521#file281521line77>
> >
> > Are you sure you don't want to urlencode the POST data?
> >
Yes that is definitely better than doing requestUrl = "&".join(["=".join([r[0], urllib.quote_plus(str(r[1]))]) for r in request]) , which won't take care of spaces either.. have made the change here and even in make_request_without_auth()..
> On April 16, 2013, 4:31 a.m., Prasanna Santhanam wrote:
> > tools/marvin/marvin/cloudstackConnection.py, line 79
> > <https://reviews.apache.org/r/10294/diff/4/?file=281521#file281521line79>
> >
> > Minor nitpick: urllib2.Request() can be used for both GET and POST and you can set the data argument only when you intend to use POST. That will reduce some code duplication here.
I changed both cases to use urllib2.Request(), but still it's still the same number of lines :) Is there a way I can merge those two separate calls to urllib2.Request(url) and urllib2.Request(url, requestUrl) into a single call?
- Venkata Siva Vijayendra
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19245
-----------------------------------------------------------
On April 16, 2013, 2:53 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 16, 2013, 2:53 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java d963b74
> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 77ba9fe
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java d281e5b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java fd826d9
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql fb760bf
> tools/marvin/marvin/cloudstackConnection.py 1caeef3
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Prasanna Santhanam <Pr...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19245
-----------------------------------------------------------
tools/marvin/marvin/cloudstackConnection.py
<https://reviews.apache.org/r/10294/#comment39861>
How and when does marvin decide to use POST? Which commands will call the POST httpmethod? May be you can provide a more complete example when your test is ready.
tools/marvin/marvin/cloudstackConnection.py
<https://reviews.apache.org/r/10294/#comment39859>
Are you sure you don't want to urlencode the POST data?
tools/marvin/marvin/cloudstackConnection.py
<https://reviews.apache.org/r/10294/#comment39860>
Minor nitpick: urllib2.Request() can be used for both GET and POST and you can set the data argument only when you intend to use POST. That will reduce some code duplication here.
- Prasanna Santhanam
On April 16, 2013, 2:53 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 16, 2013, 2:53 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java d963b74
> api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 77ba9fe
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java d281e5b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java fd826d9
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql fb760bf
> tools/marvin/marvin/cloudstackConnection.py 1caeef3
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 16, 2013, 2:53 a.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
Please find the latest diff attached with the following changes:
- Marvin client API changes to support POST requests by clients
- Inclusion of unittest files missing from earlier patch (UserVmDaoTestConfiguration.java and UserVMDaoTestContext.xml)
- Fixed a bug discovered during testing w.r.t httpmethod value being populated in the parameter map in the integration port code path
The marvin HTTP API itself is still to be put in. I'm working on it, will put it in at the earliest. Tests already exist for DeployVirtualMachineCmd. I will need to make appropriate changes to add to those tests, a case where userdata > 2K is fired using a POST request.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs (updated)
-----
api/src/com/cloud/vm/UserVmService.java d963b74
api/src/org/apache/cloudstack/api/BaseCmd.java 42c0680
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 77ba9fe
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java d281e5b
server/test/com/cloud/vm/MockUserVmManagerImpl.java fd826d9
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql fb760bf
tools/marvin/marvin/cloudstackConnection.py 1caeef3
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
> On April 11, 2013, 8:54 p.m., Min Chen wrote:
> > server/src/com/cloud/vm/UserVmManagerImpl.java, line 2581
> > <https://reviews.apache.org/r/10294/diff/3/?file=280319#file280319line2581>
> >
> > Based on your comment, for GET, maxBytes = 4K, for POST, maxBytes = 32K. Why not define these constants instead of an intermediate MAX_USER_DATA_LENGTH_BYTES and do some math calculation here? This code is hard to maintain later in case that http length standard changes later.
I just used the existing constant value, but yes, defining explicit constants for userdata length for different http methods will be cleaner. Will do that.
> On April 11, 2013, 8:54 p.m., Min Chen wrote:
> > server/test/com/cloud/vm/dao/UserVmDaoImplTest.java, line 61
> > <https://reviews.apache.org/r/10294/diff/3/?file=280321#file280321line61>
> >
> > This test only tests database persistence. We may need another automated test to issue a POST request.
Will add a marvin test for that.
> On April 11, 2013, 8:54 p.m., Min Chen wrote:
> > server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java, line 1
> > <https://reviews.apache.org/r/10294/diff/3/?file=280322#file280322line1>
> >
> > Where are UserVmDaoTestConfiguration used in your test? You are missing some Spring Junit annotation in your UserVmDaoImplTest.
Thanks for catching this - looks like the Testconfiguration.java and textcontext.xml files slipped out of the diffs - when uploading the new diffs, I'll ensure that they're present.
- Venkata Siva Vijayendra
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19030
-----------------------------------------------------------
On April 10, 2013, 9:59 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 10, 2013, 9:59 p.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 8fef422
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 1c3764a
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql c7c8b5b
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Min Chen <mi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review19030
-----------------------------------------------------------
server/src/com/cloud/vm/UserVmManagerImpl.java
<https://reviews.apache.org/r/10294/#comment39551>
Based on your comment, for GET, maxBytes = 4K, for POST, maxBytes = 32K. Why not define these constants instead of an intermediate MAX_USER_DATA_LENGTH_BYTES and do some math calculation here? This code is hard to maintain later in case that http length standard changes later.
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
<https://reviews.apache.org/r/10294/#comment39553>
This test only tests database persistence. We may need another automated test to issue a POST request.
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java
<https://reviews.apache.org/r/10294/#comment39552>
Where are UserVmDaoTestConfiguration used in your test? You are missing some Spring Junit annotation in your UserVmDaoImplTest.
- Min Chen
On April 10, 2013, 9:59 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 10, 2013, 9:59 p.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 8fef422
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 1c3764a
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
> server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
> server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
> setup/db/db/schema-410to420.sql c7c8b5b
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 10, 2013, 9:59 p.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
Adding unit tests.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs (updated)
-----
api/src/com/cloud/vm/UserVmService.java 2c33d41
api/src/org/apache/cloudstack/api/BaseCmd.java 8fef422
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 1c3764a
server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
server/test/com/cloud/vm/dao/UserVmDaoImplTest.java 0936180
server/test/com/cloud/vm/dao/UserVmDaoTestConfiguration.java PRE-CREATION
server/test/resources/UserVMDaoTestContext.xml PRE-CREATION
setup/db/db/schema-410to420.sql c7c8b5b
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/
-----------------------------------------------------------
(Updated April 5, 2013, 10:22 p.m.)
Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
Changes
-------
Removing column datatype modification in schema-create.sql. Adding a lazy fetch annotation to the user_data column in the UserVMVO class to improve read performance. Having this will cause ehcache to not read in the user_data column every time it loads in the VO object from the db. This helps especially if the userdata is 32k in size and we don't need to work with it. If we do need to access it, ehcache will pull it in dynamically.
Description
-------
Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
This addresses bug CLOUDSTACK-1086.
Diffs (updated)
-----
api/src/com/cloud/vm/UserVmService.java 2c33d41
api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
core/src/com/cloud/vm/UserVmVO.java a16eaf9
server/src/com/cloud/api/ApiDispatcher.java 925d90a
server/src/com/cloud/api/ApiServer.java d842819
server/src/com/cloud/api/ApiServerService.java 12d8b52
server/src/com/cloud/api/ApiServlet.java 03bfb5f
server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
setup/db/db/schema-410to420.sql ab9df05
Diff: https://reviews.apache.org/r/10294/diff/
Testing
-------
Thanks,
Venkata Siva Vijayendra Bhamidipati
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
> On April 5, 2013, 4:03 p.m., Chip Childers wrote:
> > Is there any automated testing of this feature today? Marvin tests of the HTTP service? Unit tests?
> >
> > If not, now seems like a good time to add some. I realize you are just updating the size of the data field, but IMO we should strive to improve automated tests with everything we touch.
There probably are automated tests already for the deployvmcmd itself, and that should cover some of the functionality, for example, current GET requests should continue to work with the expanded userdata field. I will take a look though to see if more tests can be added.
> On April 5, 2013, 4:03 p.m., Chip Childers wrote:
> > setup/db/create-schema.sql, line 1131
> > <https://reviews.apache.org/r/10294/diff/1/?file=278165#file278165line1131>
> >
> > I don't believe we should be modifying create-schema.sql for this. See: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Database+Creator
> >
> > It says: "WE NEVER CHANGE schema files such as create-schema.sql"
Thanks for catching that - I'll remove it.
- Venkata Siva Vijayendra
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review18704
-----------------------------------------------------------
On April 5, 2013, 1:56 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 5, 2013, 1:56 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> setup/db/create-schema.sql b1feb02
> setup/db/db/schema-410to420.sql ab9df05
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Chip Childers <ch...@sungard.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review18704
-----------------------------------------------------------
Is there any automated testing of this feature today? Marvin tests of the HTTP service? Unit tests?
If not, now seems like a good time to add some. I realize you are just updating the size of the data field, but IMO we should strive to improve automated tests with everything we touch.
setup/db/create-schema.sql
<https://reviews.apache.org/r/10294/#comment39130>
I don't believe we should be modifying create-schema.sql for this. See: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Database+Creator
It says: "WE NEVER CHANGE schema files such as create-schema.sql"
- Chip Childers
On April 5, 2013, 1:56 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 5, 2013, 1:56 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> setup/db/create-schema.sql b1feb02
> setup/db/db/schema-410to420.sql ab9df05
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
> On April 5, 2013, 5:46 p.m., Rohit Yadav wrote:
> > As long as we have query based API, the overall base64 encoded payload in the url cannot exceed this limit as per a RFC (I recall discussing this issue on ML when I applied this feature from previous ports).
> > If we handle POST request method on the ApiServlet class and accept userdate from POST request, this would work. Cheers.
>
> Venkata Siva Vijayendra Bhamidipati wrote:
> Yes, the POST will be handled by ApiServlet's doPost() only, and the userdata will need to be put into the POST body. I've put in a check to allow the 2k limit to be exceeded only for userdata that comes in via a post request in the deployVMcmd codepath. I think the length limit that a POST body can reach is specified in the webserver configuration and independent of CS as such, unless that limit is configured too low - in that case I'm assuming the webserver wouldn't even pass on the request to reach the ApiServlet in CS - is that the case?
>
> Rohit Yadav wrote:
> No, it would the trick is to first understand how we parse and create apiname and args from the GET query and I would prefer that we don't look for only userdata in POST request, but create a map of apicmd and list of args from the POST request generically so not just userdata any API can be called or becomes POST-able HTTP request. Summary: Make every API POST-able, that way any param could be sent via a POST request. Cheers.
Actually any POST command can be handled by the ApiServlet code - the map of api command and args list is created and supplied to the servlet by the web server. API calls issued as POST requests currently work with the mgmt server, so no changes are required to that part of the code.
- Venkata Siva Vijayendra
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review18713
-----------------------------------------------------------
On April 5, 2013, 10:22 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 5, 2013, 10:22 p.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> setup/db/db/schema-410to420.sql ab9df05
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Rohit Yadav <bh...@apache.org>.
> On April 5, 2013, 5:46 p.m., Rohit Yadav wrote:
> > As long as we have query based API, the overall base64 encoded payload in the url cannot exceed this limit as per a RFC (I recall discussing this issue on ML when I applied this feature from previous ports).
> > If we handle POST request method on the ApiServlet class and accept userdate from POST request, this would work. Cheers.
>
> Venkata Siva Vijayendra Bhamidipati wrote:
> Yes, the POST will be handled by ApiServlet's doPost() only, and the userdata will need to be put into the POST body. I've put in a check to allow the 2k limit to be exceeded only for userdata that comes in via a post request in the deployVMcmd codepath. I think the length limit that a POST body can reach is specified in the webserver configuration and independent of CS as such, unless that limit is configured too low - in that case I'm assuming the webserver wouldn't even pass on the request to reach the ApiServlet in CS - is that the case?
No, it would the trick is to first understand how we parse and create apiname and args from the GET query and I would prefer that we don't look for only userdata in POST request, but create a map of apicmd and list of args from the POST request generically so not just userdata any API can be called or becomes POST-able HTTP request. Summary: Make every API POST-able, that way any param could be sent via a POST request. Cheers.
- Rohit
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review18713
-----------------------------------------------------------
On April 5, 2013, 10:22 p.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 5, 2013, 10:22 p.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> setup/db/db/schema-410to420.sql ab9df05
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Venkata Siva Vijayendra Bhamidipati <vi...@citrix.com>.
> On April 5, 2013, 5:46 p.m., Rohit Yadav wrote:
> > As long as we have query based API, the overall base64 encoded payload in the url cannot exceed this limit as per a RFC (I recall discussing this issue on ML when I applied this feature from previous ports).
> > If we handle POST request method on the ApiServlet class and accept userdate from POST request, this would work. Cheers.
Yes, the POST will be handled by ApiServlet's doPost() only, and the userdata will need to be put into the POST body. I've put in a check to allow the 2k limit to be exceeded only for userdata that comes in via a post request in the deployVMcmd codepath. I think the length limit that a POST body can reach is specified in the webserver configuration and independent of CS as such, unless that limit is configured too low - in that case I'm assuming the webserver wouldn't even pass on the request to reach the ApiServlet in CS - is that the case?
- Venkata Siva Vijayendra
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review18713
-----------------------------------------------------------
On April 5, 2013, 1:56 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 5, 2013, 1:56 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> setup/db/create-schema.sql b1feb02
> setup/db/db/schema-410to420.sql ab9df05
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>
Re: Review Request: Remove 2k limitation for user data on a deployVMCmd
issued as an HTTP POST request
Posted by Rohit Yadav <bh...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10294/#review18713
-----------------------------------------------------------
As long as we have query based API, the overall base64 encoded payload in the url cannot exceed this limit as per a RFC (I recall discussing this issue on ML when I applied this feature from previous ports).
If we handle POST request method on the ApiServlet class and accept userdate from POST request, this would work. Cheers.
- Rohit Yadav
On April 5, 2013, 1:56 a.m., Venkata Siva Vijayendra Bhamidipati wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10294/
> -----------------------------------------------------------
>
> (Updated April 5, 2013, 1:56 a.m.)
>
>
> Review request for cloudstack, Chip Childers, Hugo Trippaers, Kelven Yang, and Min Chen.
>
>
> Description
> -------
>
> Please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/DeployVirtualMachine+userdata+enhancements for a background on the requirements driving this patch.
>
> This patch hasn't been extensively tested yet, and I will update this request with more info. I am uploading a first diff for initial review/comments.
>
>
> This addresses bug CLOUDSTACK-1086.
>
>
> Diffs
> -----
>
> api/src/com/cloud/vm/UserVmService.java 2c33d41
> api/src/org/apache/cloudstack/api/BaseCmd.java 78a2af3
> api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java 21a45f8
> core/src/com/cloud/vm/UserVmVO.java a16eaf9
> server/src/com/cloud/api/ApiDispatcher.java 925d90a
> server/src/com/cloud/api/ApiServer.java d842819
> server/src/com/cloud/api/ApiServerService.java 12d8b52
> server/src/com/cloud/api/ApiServlet.java 03bfb5f
> server/src/com/cloud/vm/UserVmManagerImpl.java 24bce8b
> server/test/com/cloud/vm/MockUserVmManagerImpl.java dd8dd83
> setup/db/create-schema.sql b1feb02
> setup/db/db/schema-410to420.sql ab9df05
>
> Diff: https://reviews.apache.org/r/10294/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Venkata Siva Vijayendra Bhamidipati
>
>