You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "CodeBleu (via GitHub)" <gi...@apache.org> on 2024/12/09 17:13:19 UTC

[I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

CodeBleu opened a new issue, #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148

   I have the following in my resource config:
   
   ```
   resource "cloudstack_instance" "test_box" {
       name = test_box
       display_name  = "test_box"
       details = {cpuNumber = "4", memory = "4096"}
   }
   
   ```
   but I get this error when I try to apply.  I have tried several different ways and it still fails.  
   ```
   │ Error: Error creating the new instance ace-test-box-0: invalid character '<' looking for beginning of value
   │
   │   with cloudstack_instance.test_box[0],
   │   on main.tf line 46, in resource "cloudstack_instance" "test_box":
   │   46: resource "cloudstack_instance" "test_box" {
   
   
   ```
   I'm running this agains the latest provider version 0.5.0 and on CS 4.19.1.0


-- 
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-unsubscribe@cloudstack.apache.org.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "chrxmvtik (via GitHub)" <gi...@apache.org>.
chrxmvtik commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2537107279

   > @chrxmvtik I just tested with an `unconstrained` offering and get the same error as you when trying to update an existing instance that had a different offering and was going to change it, but if you create the instance from scratch and specify the `details`, it will work!
   > 
   > I got the same error as you only when I initially tried to change the offering from `constrained` to `unconstrained`. If the instance is already using the `unconstrained` and I try to change the CPU (for example), then it will behave the same as `constrained` and show no issue it TF apply, but not actually change anything.
   > 
   > I still think this is an upstream [issue](https://github.com/apache/cloudstack/issues/6865) with apache/cloudstack that needs to be resolved.
   
   Ah yes, thanks! When I created a new instance with g1.Custom service offering then everything worked fine and I was able to define resources using details parameter. Seems like an workaround for a while..


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "CodeBleu (via GitHub)" <gi...@apache.org>.
CodeBleu commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536134994

   @chrxmvtik What version of TF and TF Cloudstack provider you using?
   
   Any more info of your "custom offering" might be helpful too.
   
   


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "kiranchavala (via GitHub)" <gi...@apache.org>.
kiranchavala closed issue #148: Issue with Details in cloudstack_instance resource
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2612134456

   @CodeBleu This issue looks like a duplicate of #58. I have created #158 to fix the update of details for a VM.


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "CodeBleu (via GitHub)" <gi...@apache.org>.
CodeBleu commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536837437

   @chrxmvtik  I just tested with an `unconstrained` offering and get the same error as you when trying to update an existing instance, but if you create the instance from scratch and specify the `details`, it will work!
   
   With the `constrained` it doesn't error out, but doesn't change anything on existing instance, but with the `unconstrained` it does actually error out.  I still think this is an upstream [issue](https://github.com/apache/cloudstack/issues/6865) with apache/cloudstack that needs to be resolved.


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "CodeBleu (via GitHub)" <gi...@apache.org>.
CodeBleu commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536538347

   linking this [issue](https://github.com/apache/cloudstack/issues/6865) here as I think it's related


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "CodeBleu (via GitHub)" <gi...@apache.org>.
CodeBleu commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2529038513

   OK, I believe It has something to do with my firewall it is going through.  If I go directly to the CS instance it will work.
   
   HOWEVER: I went to change the memory to a value that is outside of the constrained offering, and it applied it in the TF with NO errors, and did not change anything in the actual `cloudstack_instance` resource.  I would have expected this to return with an error like it does when the instance is being created with values outside the scope of the constrained resources.


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "CodeBleu (via GitHub)" <gi...@apache.org>.
CodeBleu commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536429474

   @chrxmvtik if you can use [CloudMonkey](https://github.com/apache/cloudstack-cloudmonkey) ( cmk ) it would be helpful to see the other info that the UI doesn't show for the offering.
   
   So far, nothing is standing out to me, but it would be helpful to see more detail on how the offering is setup.
   
   `cmk list serviceofferings --filter name="g1.Custom"`


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "chrxmvtik (via GitHub)" <gi...@apache.org>.
chrxmvtik commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536257655

   > @chrxmvtik What version of TF and TF Cloudstack provider you using?
   > 
   > Any more info of your "custom offering" might be helpful too.
   
   Of course:
   
   Terraform version: 1.10.1
   Cloudstack terraform [provider](https://registry.terraform.io/providers/cloudstack/cloudstack/0.5.0) 0.5.0
   
   Custom offering:
   ![image](https://github.com/user-attachments/assets/626d06b1-c2c7-49dc-8cc0-0bffecc8d632)
   
   Custom offering details:
   ```
   Name: g1.Custom
   ID: 7729006c-c6f6-444e-a6f7-xxxxx
   Description: Custom Instance HDD
   Offer HA: true
   Provisioning type: thin
   Storage type: shared
   Custom disk size: true
   CPU cap: false
   Host tags: WBHO
   Storage tags: Primary-HDD
   Domain: ROOT
   Zone: XX
   Created: 13 Jul 2024 15:53:40
   Dynamic scaling enabled: true
   Disk offering strictness: false
   Encrypt Root Disk: false
   ```


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "CodeBleu (via GitHub)" <gi...@apache.org>.
CodeBleu commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2634288870

   @vishesh92  in regards to #158  , I have tested those changes, but still having issues.
   
   ![Image](https://github.com/user-attachments/assets/89c08847-1f0c-4303-b077-421ef524bd81)
   
   Even thought it gives the error it actually applies the settings to state and another Plan will show no changes.
   
   Also when purposely setting values not in the proper range it does not output from the plan/apply command that it's not in range, but gives the same error as above.  It also, still applies those settings to state and another plan will come back clean.
   
   Here is the logs from the management server:
   
   > 2025-02-04 15:04:35,717 DEBUG [c.c.u.AccountManagerImpl] (qtp1789718525-741:ctx-85eea5a8 ctx-d3628ba6 ctx-afc6ef30) (logid:781668f2) Access to VM instance {"id":8428,"instanceName":"i-676-8428-VM","type":"User","uuid":"16eb8cbd-62b2-4b02-82fa-94cdefbc3da2"} granted to Account [{"accountName":"n8widgets","id":676,"uuid":"5216af48-d506-45f6-8cd3-873b5beb6e1f"}] by DomainChecker
   > 2025-02-04 15:04:35,719 DEBUG [o.a.c.u.UserDataManagerImpl] (qtp1789718525-741:ctx-85eea5a8 ctx-d3628ba6 ctx-afc6ef30) (logid:781668f2) Null/empty base64 encoded user data set
   > 2025-02-04 15:04:35,741 ERROR [c.c.a.ApiServer] (qtp1789718525-741:ctx-85eea5a8 ctx-d3628ba6 ctx-afc6ef30) (logid:781668f2) unhandled exception executing api command: [Ljava.lang.String;@255549e0
   > com.cloud.utils.exception.CloudRuntimeException: Failed to update VM, due to: Invalid memory value, specify a value between 1024 and 65536
   >     at org.apache.cloudstack.api.command.user.vm.UpdateVMCmd.execute(UpdateVMCmd.java:287)
   >     at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:172)
   
   The error is saying it needs to be in the specified range or `1024 -> 65536` for `memory`, and as you can see it is using `4096`
   


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "chrxmvtik (via GitHub)" <gi...@apache.org>.
chrxmvtik commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536081039

   Hi @CodeBleu sorry for the offtop, but I just wanted to know, how you managed to make `details` work.
   
   When I specified custom compute service offering and then set details with proper values I got an error like:
   
   ```
   │ Error: Error changing the service offering for instance worker: CloudStack API error 431 (CSExceptionErrorCode: 4350): 
   | Need to specify custom parameter values cpu, cpu speed and memory when using custom offering
   │ 
   │   with worker,
   │   on modules/cloudstack/main.tf line 125, in resource "cloudstack_instance" "worker":
   │  125: resource "cloudstack_instance" "worker" {
   │ 
   ╵
   ```
   
   Terraform instance definition has details parameter set like this:
   
   `details          = { cpuNumber = "8", cpuSpeed = "2000", memory = "6144" }`
   
   There is basically no documentation how that should work, maybe any clues?


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "chrxmvtik (via GitHub)" <gi...@apache.org>.
chrxmvtik commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536534852

   > @chrxmvtik if you can use [CloudMonkey](https://github.com/apache/cloudstack-cloudmonkey) ( cmk ) it would be helpful to see the other info that the UI doesn't show for the offering.
   > 
   > So far, nothing is standing out to me, but it would be helpful to see more detail on how the offering is setup.
   > 
   > `cmk list serviceofferings --filter name="g1.Custom"`
   > 
   > Also, what Cloudstack Ver. are you running?
   
   Cloudstack version is **4.19.1.3**
   
   Here is result offering info from CMK:
   ```json
   (localcloud) 🐱 > list serviceofferings --filter name="g1.Custom"
   {
     "count": 1,
     "serviceoffering": [
       {
         "cacheMode": "writeback",
         "created": "2024-07-13T16:53:40+0200",
         "defaultuse": false,
         "diskofferingstrictness": false,
         "displaytext": "Custom Instance HDD",
         "domain": "ROOT",
         "domainid": "687a14xac120002",
         "dynamicscalingenabled": true,
         "encryptroot": false,
         "hasannotations": false,
         "hosttags": "WBHO",
         "id": "77290x4c9ff2686",
         "iscustomized": true,
         "issystem": false,
         "isvolatile": false,
         "limitcpuuse": false,
         "name": "g1.Custom",
         "offerha": true,
         "provisioningtype": "thin",
         "rootdisksize": 0,
         "serviceofferingdetails": {
           "domainid": "1",
           "zoneid": "1"
         },
         "state": "Active",
         "storagetags": "Primary-HDD",
         "storagetype": "shared",
         "zone": "XX",
         "zoneid": "730cb3x1399"
       }
     ]
   }
   ```
   
   Neither do I really see anything suspicious in here, tho.


-- 
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-unsubscribe@cloudstack.apache.org

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


Re: [I] Issue with Details in cloudstack_instance resource [cloudstack-terraform-provider]

Posted by "CodeBleu (via GitHub)" <gi...@apache.org>.
CodeBleu commented on issue #148:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/148#issuecomment-2536698257

   > > @chrxmvtik if you can use [CloudMonkey](https://github.com/apache/cloudstack-cloudmonkey) ( cmk ) it would be helpful to see the other info that the UI doesn't show for the offering.
   > > So far, nothing is standing out to me, but it would be helpful to see more detail on how the offering is setup.
   > > `cmk list serviceofferings --filter name="g1.Custom"`
   > > Also, what Cloudstack Ver. are you running?
   > 
   > Cloudstack version is **4.19.1.3**
   > 
   > Here is result offering info from CMK:
   > 
   > ```json
   > (localcloud) 🐱 > list serviceofferings --filter name="g1.Custom"
   > {
   >   "count": 1,
   >   "serviceoffering": [
   >     {
   >       "cacheMode": "writeback",
   >       "created": "2024-07-13T16:53:40+0200",
   >       "defaultuse": false,
   >       "diskofferingstrictness": false,
   >       "displaytext": "Custom Instance HDD",
   >       "domain": "ROOT",
   >       "domainid": "687a14xac120002",
   >       "dynamicscalingenabled": true,
   >       "encryptroot": false,
   >       "hasannotations": false,
   >       "hosttags": "WBHO",
   >       "id": "77290x4c9ff2686",
   >       "iscustomized": true,
   >       "issystem": false,
   >       "isvolatile": false,
   >       "limitcpuuse": false,
   >       "name": "g1.Custom",
   >       "offerha": true,
   >       "provisioningtype": "thin",
   >       "rootdisksize": 0,
   >       "serviceofferingdetails": {
   >         "domainid": "1",
   >         "zoneid": "1"
   >       },
   >       "state": "Active",
   >       "storagetags": "Primary-HDD",
   >       "storagetype": "shared",
   >       "zone": "XX",
   >       "zoneid": "730cb3x1399"
   >     }
   >   ]
   > }
   > ```
   > 
   > Neither do I really see anything suspicious in here, tho.
   
   1. My previous comment was for my initial issue, not our conversation :smile: 
   2. I'm using a custom `constrained` with `min` and `max` settings for CPU and RAM in my offering.  Maybe this is a bug with the `unconstrained` offering?
   
   ```json
   {
     "count": 1,
     "serviceoffering": [
       {
         "cacheMode": "none",
         "cpuspeed": 2600,
         "created": "2024-10-17T15:49:28+0000",
         "defaultuse": false,
         "diskofferingstrictness": false,
         "displaytext": "jwh-customed-constrained",
         "dynamicscalingenabled": true,
         "encryptroot": false,
         "hasannotations": false,
         "hosttags": "standard",
         "id": "c99c0b1a-ac09-4eb4-a05b-afe5192445d4",
         "iscustomized": true,
         "issystem": false,
         "isvolatile": false,
         "limitcpuuse": true,
         "name": "jwh-customed-constrained-2-8-2-4",
         "offerha": false,
         "provisioningtype": "thin",
         "rootdisksize": 0,
         "serviceofferingdetails": {
           "maxcpunumber": "8",
           "maxmemory": "4096",
           "mincpunumber": "2",
           "minmemory": "2048"
         },
         "state": "Active",
         "storagetags": "standard_storage",
         "storagetype": "local"
       }
     ]
   }
   
   ```
   
   Maybe try using a custom `constrained` and limit the CPU and RAM like me to see if that works for you.


-- 
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-unsubscribe@cloudstack.apache.org

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