Comments (15)
Smart instances can only be cloned manually.
from pyarubacloud.
For example https://github.com/szepeviktor/debian-server-tools/blob/master/clone-server-debconf.sh
from pyarubacloud.
The web dashboard allows to upgrade smart instances too. eg: small to large
So may be api can do this...
from pyarubacloud.
Hello, at the moment is not possible to upgrade a VM via API. I'm going to add the method.
from pyarubacloud.
Thank You. When expected?
from pyarubacloud.
I just added the method on the library with the relative example, try it.
from pyarubacloud.
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.
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.
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.
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.
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.
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.
Oh, maybe because u were storing it as string and not as integer. I need to add documentation for methods.
from pyarubacloud.
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.
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)
- ProVmCreator failing HOT 1
- [request] SSH Public Key instead of password in VM creation HOT 1
- Support full DNS API HOT 1
- Bug during/after python3 installation + temp fix HOT 1
- ResultCode: -500 HOT 1
- REST API Documentation or Swagger ? HOT 5
- Support for location roulette HOT 1
- Add feature to Create 1 EUR Smart VM - Random DC HOT 11
- set_ssh_key when reinitializing smart vm HOT 2
- SetEnqueueReinitializeServer and vm.reinitialize() failure when ConfigureIPv6=True HOT 1
- remove_ip broken
- add_public_ip for vm Pro object
- Authentication failed, token not found HOT 2
- Remove ip from server
- Create multiple objects in one script
- Provide HTTP RESTful API HOT 1
- GetVMMetrics
- Snapshot
- Unable to create Smart VM by API ExceptionCode 19
- List LoadBalancer and servers linked to it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyarubacloud.