Re: [PR] Changing executeAPI to utilize POST request [cloudstack-csbench]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #18:
URL: https://github.com/apache/cloudstack-csbench/pull/18#discussion_r2053924621


##
apirunner/apirunner.go:
##
@@ -251,12 +253,24 @@ func saveData(apiURL string, count float64, minTime 
float64, maxTime float64, av
log.Info(message)
 }
 
-func executeAPI(apiURL string, params url.Values) (float64, float64, bool) {
+func executeAPI(apiURL string, params url.Values, post bool) (float64, 
float64, bool) {
// Send the API request and calculate the time
-   apiURL = fmt.Sprintf("%s?%s", apiURL, params.Encode())
+   var resp *http.Response
+   var err error
+   dataBody := strings.NewReader(params.Encode())

Review Comment:
   keep this in `if post {`, at line#264



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053635978


##
source/adminguide/virtual_machines.rst:
##
@@ -960,6 +960,147 @@ restoreVirtualMachine call. In this case, the Instance's 
root disk is
 destroyed and recreated, but from the same Template or ISO that was
 already in use by the Instance.
 
+Instance Lease
+--
+
+CloudStack offers the option to create Instances with a Lease. A Lease defines 
a set time period after which a selected action, such as stopping or destroying 
the instance, 
+will be automatically performed. This helps optimize cloud resource usage by 
automatically freeing up resources that are no longer in use. 
+If a user needs an instance only for a limited time, this feature can be 
useful. When deploying an instance, users can either choose a Compute Offering 
that includes 

Review Comment:
   ```suggestion
   It is better to lease an instance if you need it only for a limited time. 
When deploying an instance, you can either choose a Compute Offering that 
includes 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053647745


##
source/adminguide/virtual_machines.rst:
##
@@ -960,6 +960,147 @@ restoreVirtualMachine call. In this case, the Instance's 
root disk is
 destroyed and recreated, but from the same Template or ISO that was
 already in use by the Instance.
 
+Instance Lease
+--
+
+CloudStack offers the option to create Instances with a Lease. A Lease defines 
a set time period after which a selected action, such as stopping or destroying 
the instance, 
+will be automatically performed. This helps optimize cloud resource usage by 
automatically freeing up resources that are no longer in use. 
+If a user needs an instance only for a limited time, this feature can be 
useful. When deploying an instance, users can either choose a Compute Offering 
that includes 
+the Instance Lease feature or enable it specifically for that instance, 
setting the number of days after which the instance should be stopped or 
destroyed once their task is complete.
+
+
+**Configuring Instance Lease feature**
+
+The cloud administrator can use global configuration variables to control the 
behavior of Instance Lease.
+To set these variables, API or CloudStack UI can be used:
+
+=== 
+ConfigurationDescription
+=== 
+instance.lease.enabled   Indicates whether to enable the 
Instance lease feature, will be applicable only on instances created after 
lease is enabled. **Default: false**
+instance.lease.scheduler.intervalBackground task interval in 
seconds that executes Lease expiry action on eligibile expired instances. 
Default: 3600.
+instance.lease.alertscheduler.interval   Background task interval in seconds 
that executes Lease alert for instances about to be expired in next N days. 
Default: 86400
+instance.lease.alert.daysbefore  Denotes number of days (N) for alert 
task. Default: 7 days
+=== 
+
+
+**Lease Parameters**
+
+
+**leaseduration**: Lease duration is specified in days. This can take Natural 
numbers and -1 to disable the lease.
+
+Lease may require to be disabled in following scenarios:
+
+- Users can disable the Instance Lease feature during instance deployment by 
unchecking the 'Enable Lease' option when using a Compute Offering that 
supports it.
+- For existing instances with a lease already enabled, the lease can be 
removed by editing the instance and unchecking the 'Enable Lease' option.
+
+**leaseexpiryaction**: There are two expiry action supported:
+
+- STOP: The instance is stopped, and it will be out of lease. The user can 
restart the instance manually.
+- DESTROY: The instance is destroyed when the lease expires.
+
+.. note:: Expiry action is executed at most once on the instance, e.g. STOP 
action will bring instance in Stoppped state on expiry and instance will be out 
of lease. User may choose to start it again.
+
+
+**Using Instance Lease**
+
+Lease information is associated to an Instance and following parameters are 
used to enable lease for it:
+
+#. leaseduration
+#. leaseexpiryaction
+
+Instance remains active for specified leaseduration (in days). Upon lease 
expiry, configured expiryaction is executed on the instance and 
+lease is removed from the instance for any further action.
+
+**Notes:**
+
+#. Lease Assignment: A lease can only be assigned to an instance during 
deployment.
+#. Lease Acquisition: Instances without a lease cannot acquire one by 
switching to a different compute offering or by editing the instance.
+#. Lease Inheritance: Instances inherit the lease from a compute offering with 
'Instance Lease' feature enabled. This lease can be overridden or disabled in 
the “Advanced Settings”.
+#. Lease Persistence: A lease is always tied to the instance. Modifications to 
the compute offering do not affect the instance's lease.
+#. Non-Lease Compute offering: Instances can have a lease by enabling it in 
the "Advanced Settings" for non-lease based compute offering too.
+#. Lease Duration Management: The lease duration can be extended or reduced 
for instances before expiry. However, once the lease is disabled, it cannot be 
re-enabled for that instance.
+#. Lease Expiry: Once the lease expires and the associated action is 
completed, the lease is annulled and cannot be reattached or extended.
+#. Feature Disablement: If the lease feature is disabled, the lease associated 
with instances is canceled. Re-enabling the feature will not automatically 
reapply the lease to previously grandfathered instances.
+#. Delete Protection: The DESTROY lease expiry action is skipped for instances 
with delete protection enabled.
+
+**Deployment of Instance with lease**
+
+There are 2 ways to deploy instanc

Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053623385


##
source/adminguide/service_offerings.rst:
##
@@ -401,6 +401,32 @@ To create a new compute offering:
  -  **Disk Offering Strictness**: This flag defines the strictness of 
the disk offering association 
 with the compute offering. When set to true, overriding of disk 
offering is not allowed on deploy instance
 and change disk offering is not allowed for the ROOT disk
+  
+   -  **Enable Lease**: When this flag is enabled, Compute Offering is created 
with 'Instance Lease' feature enabled. 

Review Comment:
   ```suggestion
  -  **Enable Lease**: When this flag is enabled, 'Instance Lease' settings 
can be specified in the Compute Offering. 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053615334


##
source/adminguide/service_offerings.rst:
##
@@ -401,6 +401,32 @@ To create a new compute offering:
  -  **Disk Offering Strictness**: This flag defines the strictness of 
the disk offering association 
 with the compute offering. When set to true, overriding of disk 
offering is not allowed on deploy instance
 and change disk offering is not allowed for the ROOT disk
+  
+   -  **Enable Lease**: When this flag is enabled, Compute Offering is created 
with 'Instance Lease' feature enabled. 

Review Comment:
   check the indentation here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053627415


##
source/adminguide/service_offerings.rst:
##
@@ -401,6 +401,32 @@ To create a new compute offering:
  -  **Disk Offering Strictness**: This flag defines the strictness of 
the disk offering association 
 with the compute offering. When set to true, overriding of disk 
offering is not allowed on deploy instance
 and change disk offering is not allowed for the ROOT disk
+  
+   -  **Enable Lease**: When this flag is enabled, Compute Offering is created 
with 'Instance Lease' feature enabled. 
+  In CloudStack, a lease sets a specific time duration after which a 
chosen lease action action, such as stopping or destroying the instance, will 
take place. 

Review Comment:
   ```suggestion
 In CloudStack, a lease for an instance sets a specific time duration 
(in days) after which a chosen lease action, such as STOP or DESTROY will be 
performed.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053635978


##
source/adminguide/virtual_machines.rst:
##
@@ -960,6 +960,147 @@ restoreVirtualMachine call. In this case, the Instance's 
root disk is
 destroyed and recreated, but from the same Template or ISO that was
 already in use by the Instance.
 
+Instance Lease
+--
+
+CloudStack offers the option to create Instances with a Lease. A Lease defines 
a set time period after which a selected action, such as stopping or destroying 
the instance, 
+will be automatically performed. This helps optimize cloud resource usage by 
automatically freeing up resources that are no longer in use. 
+If a user needs an instance only for a limited time, this feature can be 
useful. When deploying an instance, users can either choose a Compute Offering 
that includes 

Review Comment:
   ```suggestion
   f a user needs an instance only for a limited time, this option can be very 
helpful. When deploying an instance, users can either choose a Compute Offering 
that includes
   ```



##
source/adminguide/virtual_machines.rst:
##
@@ -960,6 +960,147 @@ restoreVirtualMachine call. In this case, the Instance's 
root disk is
 destroyed and recreated, but from the same Template or ISO that was
 already in use by the Instance.
 
+Instance Lease
+--
+
+CloudStack offers the option to create Instances with a Lease. A Lease defines 
a set time period after which a selected action, such as stopping or destroying 
the instance, 
+will be automatically performed. This helps optimize cloud resource usage by 
automatically freeing up resources that are no longer in use. 
+If a user needs an instance only for a limited time, this feature can be 
useful. When deploying an instance, users can either choose a Compute Offering 
that includes 

Review Comment:
   ```suggestion
   If a user needs an instance only for a limited time, this option can be very 
helpful. When deploying an instance, users can either choose a Compute Offering 
that includes
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053623385


##
source/adminguide/service_offerings.rst:
##
@@ -401,6 +401,32 @@ To create a new compute offering:
  -  **Disk Offering Strictness**: This flag defines the strictness of 
the disk offering association 
 with the compute offering. When set to true, overriding of disk 
offering is not allowed on deploy instance
 and change disk offering is not allowed for the ROOT disk
+  
+   -  **Enable Lease**: When this flag is enabled, Compute Offering is created 
with 'Instance Lease' feature enabled. 

Review Comment:
   ```suggestion
  -  **Enable Lease**: When this flag is enabled, Compute Offering is 
created with 'Instance Lease' enabled. 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053623385


##
source/adminguide/service_offerings.rst:
##
@@ -401,6 +401,32 @@ To create a new compute offering:
  -  **Disk Offering Strictness**: This flag defines the strictness of 
the disk offering association 
 with the compute offering. When set to true, overriding of disk 
offering is not allowed on deploy instance
 and change disk offering is not allowed for the ROOT disk
+  
+   -  **Enable Lease**: When this flag is enabled, Compute Offering is created 
with 'Instance Lease' feature enabled. 

Review Comment:
   ```suggestion
  -  **Enable Lease**: When this flag is enabled, Compute Offering is 
created with lease enabled. 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053623385


##
source/adminguide/service_offerings.rst:
##
@@ -401,6 +401,32 @@ To create a new compute offering:
  -  **Disk Offering Strictness**: This flag defines the strictness of 
the disk offering association 
 with the compute offering. When set to true, overriding of disk 
offering is not allowed on deploy instance
 and change disk offering is not allowed for the ROOT disk
+  
+   -  **Enable Lease**: When this flag is enabled, Compute Offering is created 
with 'Instance Lease' feature enabled. 

Review Comment:
   ```suggestion
  -  **Enable Lease**: When this flag is enabled, Compute Offering is 
created with 'Instance Lease' enabled. 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053627415


##
source/adminguide/service_offerings.rst:
##
@@ -401,6 +401,32 @@ To create a new compute offering:
  -  **Disk Offering Strictness**: This flag defines the strictness of 
the disk offering association 
 with the compute offering. When set to true, overriding of disk 
offering is not allowed on deploy instance
 and change disk offering is not allowed for the ROOT disk
+  
+   -  **Enable Lease**: When this flag is enabled, Compute Offering is created 
with 'Instance Lease' feature enabled. 
+  In CloudStack, a lease sets a specific time duration after which a 
chosen lease action action, such as stopping or destroying the instance, will 
take place. 

Review Comment:
   ```suggestion
 In CloudStack, a lease for an instance sets a specific time duration 
(in days) after which a chosen lease action, such as stopping or destroying the 
instance, will take place.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Documentation related to Instance lease feature [cloudstack-documentation]

2025-04-22 Thread via GitHub


sureshanaparti commented on code in PR #492:
URL: 
https://github.com/apache/cloudstack-documentation/pull/492#discussion_r2053635978


##
source/adminguide/virtual_machines.rst:
##
@@ -960,6 +960,147 @@ restoreVirtualMachine call. In this case, the Instance's 
root disk is
 destroyed and recreated, but from the same Template or ISO that was
 already in use by the Instance.
 
+Instance Lease
+--
+
+CloudStack offers the option to create Instances with a Lease. A Lease defines 
a set time period after which a selected action, such as stopping or destroying 
the instance, 
+will be automatically performed. This helps optimize cloud resource usage by 
automatically freeing up resources that are no longer in use. 
+If a user needs an instance only for a limited time, this feature can be 
useful. When deploying an instance, users can either choose a Compute Offering 
that includes 

Review Comment:
   ```suggestion
a user needs an instance only for a limited time, they can either choose a 
Compute Offering that includes 
   ```



##
source/adminguide/virtual_machines.rst:
##
@@ -960,6 +960,147 @@ restoreVirtualMachine call. In this case, the Instance's 
root disk is
 destroyed and recreated, but from the same Template or ISO that was
 already in use by the Instance.
 
+Instance Lease
+--
+
+CloudStack offers the option to create Instances with a Lease. A Lease defines 
a set time period after which a selected action, such as stopping or destroying 
the instance, 
+will be automatically performed. This helps optimize cloud resource usage by 
automatically freeing up resources that are no longer in use. 
+If a user needs an instance only for a limited time, this feature can be 
useful. When deploying an instance, users can either choose a Compute Offering 
that includes 

Review Comment:
   ```suggestion
If a user needs an instance only for a limited time, they can either choose 
a Compute Offering that includes 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org