Code Monkey home page Code Monkey logo

Comments (15)

szepeviktor avatar szepeviktor commented on May 26, 2024

Smart instances can only be cloned manually.

from pyarubacloud.

szepeviktor avatar szepeviktor commented on May 26, 2024

For example https://github.com/szepeviktor/debian-server-tools/blob/master/clone-server-debconf.sh

from pyarubacloud.

Melius-Group avatar Melius-Group commented on May 26, 2024

The web dashboard allows to upgrade smart instances too. eg: small to large
So may be api can do this...

from pyarubacloud.

blackms avatar blackms commented on May 26, 2024

Hello, at the moment is not possible to upgrade a VM via API. I'm going to add the method.

from pyarubacloud.

Melius-Group avatar Melius-Group commented on May 26, 2024

Thank You. When expected?

from pyarubacloud.

blackms avatar blackms commented on May 26, 2024

I just added the method on the library with the relative example, try it.

from pyarubacloud.

Melius-Group avatar Melius-Group commented on May 26, 2024

The method can't work for me.

import argparse

from ArubaCloud.PyArubaAPI import CloudInterface

if name == 'main':
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--datacenter', help='Specify datacenter to login.', action='store', dest='dc')
parser.add_argument('-p', '--pattern', help='Specify pattern to search.', action='store', dest='pattern')
parser.add_argument('-u', '--username', help='Specify username.', action='store', dest='username')
parser.add_argument('-w', '--password', help='Specify password.', action='store', dest='password')
parser.add_argument('-n', '--new_pkg', help='Specify password.', action='store', dest='newpkg')
p = parser.parse_args()

i = CloudInterface(dc=p.dc)
i.login(username=p.username, password=p.password, load=True)

i.get_servers()

#vm = i.vmlist.find(name='Test')[0]
vm = i.get_vm(pattern=p.pattern)[0]
vm.upgrade_vm(package_id=p.newpkg)

And I initiate it with
python /pyArubaCloud/examples/upgrade_smart.py -d 6 -u FHU-4**5 -w pa****0-p -p Teszt -n 2

Nothing happen.

When I run this
python /pyArubaCloud/examples/upgrade_smart.py -d 6 -u FHU-4**5 -w pa****0-p -p Teszt -n 20

Nothing happen, but the init.py contains
if package_id > 4 or package_id <= 0:
return MalformedJsonRequest("Packages available are: 1, 2, 3, 4.")

Why I can't get any response?

from pyarubacloud.

blackms avatar blackms commented on May 26, 2024

In the first case, you should have upgraded the vm correctly, call the method in this way to see the response:

vm.upgrade_vm(package_id=p.newpkg, debug=True)

Let me know.

from pyarubacloud.

Melius-Group avatar Melius-Group commented on May 26, 2024

Nothing, no response, just some wait and shows prompt.
If I mistype the function name, drop error, but if correct seems exit with ture.
If I hardcode debug=True in init.py also nothing... no error, no json output, nothing...

from pyarubacloud.

blackms avatar blackms commented on May 26, 2024

I tried right now, and I'm able to upgrade the VM, have you turned off the vm before call the API method?

from pyarubacloud.

Melius-Group avatar Melius-Group commented on May 26, 2024

yes pf course,, but the fuction examine the state of vm and drop error msg if the state not equal 2....
I tryed and drop exception as required:

Traceback (most recent call last):
File "/pyArubaCloud/examples/upgrade_smart.py", line 21, in
vm.upgrade_vm(package_id=p.newpkg, debug=True)
File "build/bdist.linux-x86_64/egg/ArubaCloud/objects/VmTypes/init.py", line 22, in upgrade_vm

But if status stopped, and run the script,... no response...

from pyarubacloud.

Melius-Group avatar Melius-Group commented on May 26, 2024

This syntax fails:
vm.upgrade_vm(package_id=p.newpkg)

If I use vm.upgrade_vm(package_id=2)
it was correct....

I add parser.add_argument('-g', '--newpkg', help='Specify new package id.', action='store', dest='newpkg')

and use -g 2 when i start script....

from pyarubacloud.

blackms avatar blackms commented on May 26, 2024

Oh, maybe because u were storing it as string and not as integer. I need to add documentation for methods.

from pyarubacloud.

Melius-Group avatar Melius-Group commented on May 26, 2024

vm.upgrade_vm(package_id=int(p.newpkg)) solv the problem :)))
Sorry :) I'm waiting for upgrade methode for pro vm, and os change methodes :))
Thank You for lots of help

from pyarubacloud.

blackms avatar blackms commented on May 26, 2024

Perfect, I'm glad that it works. I have to ask you to open another Issue for upgrade_vm method on Pro Servers, so we can track it easily.

I'm going to close this ticket now.

Thank you!

from pyarubacloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.