Open Melius-Group opened 8 years ago
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)
Thank You, but how can I MODIFY (extend) disk size without add a new disk?
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)
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,..
i've tested it myself and they seems to be ok
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?
In my own script...i've added these commands only when i have to change cpu and ram quantity on Pro VMs
Maybe can you send me a working example file for upgrade pro vm?
it's available here : https://github.com/mikamakusa/Providers4
@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.
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? :)
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.
Thank You... I'm on python less then 5 hours :)))
Hi,
Please provide an upgrade methode to pro vm too.
Thank You