Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade_vm for PRO VM #27

Open
Melius-Group opened this issue May 11, 2016 · 13 comments
Open

Upgrade_vm for PRO VM #27

Melius-Group opened this issue May 11, 2016 · 13 comments
Assignees

Comments

@Melius-Group
Copy link

Hi,

Please provide an upgrade methode to pro vm too.

Thank You

@mikamakusa
Copy link
Collaborator

for upgrading pro VM, you can do like this :
connect = CloudInterface(dc=dc)
connect.login(username, password, load=True)
vm = connect().get_vm(pattern=servername)[0]
vm.poweroff()
to add a disk
vm.add_virtual_disk(size=int(disksize))
to add ram
vm.set_ram_qty(int(ramsize))
to set cpu
vm.set_cpu_qty(int(cpusize))
time.sleep(60)
connect().poweron_server(server_id=serverid)

@blackms blackms self-assigned this May 11, 2016
@Melius-Group
Copy link
Author

Thank You, but how can I MODIFY (extend) disk size without add a new disk?

@mikamakusa
Copy link
Collaborator

the edit_virtual_disk function has not been implemented yet (i've not seen it in the code).
I think it's like the rDNS (the team in charge may be already on it)

@Melius-Group
Copy link
Author

Is this method tested? Because the VM_Type init.py does not contain set_cpu_qty and set_ram_qty methode... only edit_cpu and edit_ram exists,..

@mikamakusa
Copy link
Collaborator

i've tested it myself and they seems to be ok

@blackms
Copy link
Contributor

blackms commented May 11, 2016

set_cpu_qty and set_ram_qty should be only vailable in the ProVmCreator object. How do you manage to call them from the VM object?

@mikamakusa
Copy link
Collaborator

In my own script...i've added these commands only when i have to change cpu and ram quantity on Pro VMs

@Melius-Group
Copy link
Author

Maybe can you send me a working example file for upgrade pro vm?

@mikamakusa
Copy link
Collaborator

it's available here : https://github.com/mikamakusa/Providers4

@blackms
Copy link
Contributor

blackms commented May 11, 2016

@mikamakusa first of all let me say that i really like your job and the quality of the code.
Said that, you are invoking those methods using ProVmCreator object not *VM one.

pvm = ProVmCreator(name=servername,
                                       admin_password=servpass,
                                       template_id=Images.getimageid(image),
                                       auth_obj=connect().auth)
                    pvm.set_cpu_qty(int(cpu))
                    pvm.set_ram_qty(int(ram))

But I like the idea of adding set_cpu, set_ram_qty and so on to ProVM object, and I think that I will go in that way.

@Melius-Group
Copy link
Author

WOW... this is nice job, but I can't use this because of my python knowledge.
Maybe with VM object.... or anything else, without significant modification on the original Aruba code? :)

@mikamakusa
Copy link
Collaborator

Hum...how can I say that...
I'm not a real Python developper, i'm on this language less than a year and i've started this script in Powershell to, finally, convert it in Python (i was stuck on the Aruba Part).
If what i've done so far on this script is useful for you, it's a pleasure for me to help you as best as i can.

@Melius-Group
Copy link
Author

Thank You... I'm on python less then 5 hours :)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants