apache / libcloud

Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API.
https://libcloud.apache.org
Apache License 2.0
2.04k stars 925 forks source link

Add resize node function for azure driver #1965

Closed rajat-garg-del closed 11 months ago

rajat-garg-del commented 11 months ago

Add resize node function for azure driver

Description

Background

https://github.com/apache/libcloud/issues/1964

To start with we have def ex_change_node_size(self, node, new_size) function in [https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/ec2.py] which supports instance type change for AWS.

We need similar functionality for Azure cloud as well where we could change the vmSize for Azure cloud. This could be done by adding node_resize function at (https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/azure_arm.py )

Implementation

  1. Added ex_resize_node to change the azure vm instance type.
  2. Added equivalent test test_resize_node to test ex_resize_node

Status

Checklist (tick everything that applies)

rajat-garg-del commented 11 months ago

@Kami Can u take a look into this?

codecov-commenter commented 11 months ago

Codecov Report

Merging #1965 (5530f54) into trunk (a9f0dcf) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##            trunk    #1965   +/-   ##
=======================================
  Coverage   83.19%   83.20%           
=======================================
  Files         353      353           
  Lines       81412    81423   +11     
  Branches     8591     8591           
=======================================
+ Hits        67729    67740   +11     
  Misses      10875    10875           
  Partials     2808     2808           
Files Coverage Δ
libcloud/compute/drivers/azure_arm.py 60.43% <100.00%> (+0.28%) :arrow_up:
libcloud/test/compute/test_azure_arm.py 98.98% <100.00%> (+0.01%) :arrow_up:
Kami commented 11 months ago

Merged into trunk. Thanks for the contribution.