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

[Bug]: VM Disk Creation error #756

Closed
xriot2 opened this issue Apr 16, 2024 · 16 comments · Fixed by #944 or #945
Closed

[Bug]: VM Disk Creation error #756

xriot2 opened this issue Apr 16, 2024 · 16 comments · Fixed by #944 or #945
Labels
bug Bug community Community related

Comments

@xriot2
Copy link

xriot2 commented Apr 16, 2024

Terraform Core Version

v1.7.4

Cloud Avenue Provider Version

0.18.4

Affected Resource(s)

CloudAvenue Disk

Expected Behavior

SCSI Disk creation (attached disk)

Actual Behavior

error during the creation:

cloudavenue_vm.res_vm[0]: Still creating... [2m10s elapsed]
cloudavenue_vm.res_vm[0]: Creation complete after 2m13s [id=urn:vcloud:vm:a571b842-388d-49a1-9688-505ba1e0f515]
cloudavenue_vm_disk.disk[0]: Creating...
cloudavenue_vm_disk.disk[0]: Still creating... [10s elapsed]
cloudavenue_vm_disk.disk[0]: Still creating... [20s elapsed]
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to cloudavenue_vm_disk.disk[0], provider
│ "provider[\"registry.terraform.io/orange-cloudavenue/cloudavenue\"]"
│ produced an unexpected new value: .bus_type: was cty.StringVal("SCSI"), but
│ now cty.StringVal("SATA").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
Uploading artifacts for failed job

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "cloudavenue_vm_disk" "disk" {

  depends_on = [cloudavenue_vm.res_vm]

  count           = var.vm_config.count

  size_in_mb      = var.disk_config.disk_size_in_gb * 1024
  bus_type        = var.disk_config.bus_type
  bus_number      = var.disk_config.bus_number
  is_detachable   = var.disk_config.disk_is_detachable
  name            = var.disk_config.disk_is_detachable ? "${local.disk_name_prefix}${format("%02d", count.index)}" : null
  storage_profile = var.disk_config.storage_profile
  unit_number     = var.disk_config.unit_number
  vapp_id         = null
  vapp_name       = try(cloudavenue_vm.res_vm[count.index].vapp_name, null)
  vm_id           = null
  vm_name         = try(cloudavenue_vm.res_vm[count.index].name, null)
}

with variables

disk_config = {
    bus_type = "SCSI"
    bus_number = 0
    unit_number = 1
    disk_is_detachable = false
    storage_profile = "silver"
    disk_size_in_gb = 10
    disk_mount_point = "/var/lib/vital"
}

Steps to Reproduce

just request a creation of vm with an attached disk with SCSI bus

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@xriot2 xriot2 added the bug label Apr 16, 2024
@azrod
Copy link
Member

azrod commented Apr 16, 2024

Hello

Please add terraform configuration for cloudavenue_vm resource

Thanks

@xriot2
Copy link
Author

xriot2 commented Apr 16, 2024

vm ressource is defined by

// VM
resource "cloudavenue_vm" "res_vm" {

  depends_on = [cloudavenue_vapp.vapp]

  count    = var.vm_config.count

  name     = "${local.vm_name_prefix}${format("%02d", count.index)}"
  description = var.vm_config.description

  vapp_name = cloudavenue_vapp.vapp.name
  vapp_id = null

  deploy_os = {
    vapp_template_id = data.cloudavenue_catalog_vapp_template.template.id
  }

  resource = {
    cpu_hot_add_enabled    = true
    cpus                   = var.vm_config.cpu
    cpus_cores             = var.vm_config.cpu_cores
    memory                 = var.vm_config.memory_in_gb * 1024
    memory_hot_add_enabled = true
    networks               = [
        {
          type = "org"
          adapter_type = "VMXNET3"
          ip_allocation_mode = "POOL"
          connected = true
          name = var.vm_config.networknames[0]
          is_primary = true
        }
      ]
  }

  settings = {
    affinity_rule_id               = null
    expose_hardware_virtualization = var.vm_config.expose_hardware_virtualization
    guest_properties               = {}
    os_type                        = var.vm_config.os_type
    storage_profile                = var.disk_config.storage_profile
    customization = {
      admin_password                      = var.vm_config.admin_password
      allow_local_admin_password          = var.vm_config.allow_local_admin_password
      # comment below if allow_local_admin_password is set
      #auto_generate_password              = false
      change_sid                          = false
      enabled                             = var.vm_config.enabled_guest_config
      force                               = var.vm_config.reboot
      hostname                            = "${local.vm_name_prefix}${format("%02d", count.index)}"
      init_script                         = local.vm_init_script
      join_domain                         = false
      join_domain_account_ou              = null
      join_domain_name                    = null
      join_domain_password                = null
      join_domain_user                    = null
      join_org_domain                     = false
      must_change_password_on_first_login = false
      number_of_auto_logons               = null
    }
  }

  state = {
    power_on = true
  }
}

with variables

# vm definition
vm_config = {
      description  = "Antivirus engine"
      catalog_name = "Orange-Linux-Internal"
      os           = "OBSMASTER_UBUNTU_22.04"
      os_type      = "ubuntu64Guest"
      count        = 1
      expose_hardware_virtualization = true
      cpu          = 4
      cpu_cores    = 1
      memory_in_gb = 8
      networknames = [ "obsitlabiaas" ]
      admin_password = "XXXXXXX"
      allow_local_admin_password = true
      enabled_guest_config       = true
      # after each vm update, reboot the server
      reboot = true
}

@xriot2
Copy link
Author

xriot2 commented May 17, 2024

Hi,
any news about this problem ?
best regards

@azrod
Copy link
Member

azrod commented May 21, 2024

Hi @xriot2,

Please try to create disk with parameters :

disk_config = {
    bus_type = "SCSI"
    bus_number = 2
    unit_number = 0
    disk_is_detachable = false
    storage_profile = "silver"
    disk_size_in_gb = 10
    disk_mount_point = "/var/lib/vital"
}

@xriot2
Copy link
Author

xriot2 commented May 21, 2024

It's the same behaviour with the configuration:

disk_config = {
    bus_type = "SCSI"
    bus_number = 2
    unit_number = 0
    disk_is_detachable = false
    storage_profile = "silver"
    disk_size_in_gb = 10
    disk_mount_point = "/var/lib/vital"
}
cloudavenue_vm.res_vm[0]: Creation complete after 3m35s [id=urn:vcloud:vm:eb438227-a417-4584-b3c4-189b2287689b]
cloudavenue_vm_disk.disk[0]: Creating...
cloudavenue_vm_disk.disk[0]: Still creating... [10s elapsed]
cloudavenue_vm_disk.disk[0]: Still creating... [20s elapsed]
cloudavenue_vm_disk.disk[0]: Still creating... [30s elapsed]
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to cloudavenue_vm_disk.disk[0], provider
│ "provider[\"registry.terraform.io/orange-cloudavenue/cloudavenue\"]"
│ produced an unexpected new value: .bus_type: was cty.StringVal("SCSI"), but
│ now cty.StringVal("SATA").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

@xriot2
Copy link
Author

xriot2 commented May 24, 2024

Hi,
any news about this problem because we are blocked since a long time ?
best regards

@azrod azrod added the community Community related label Jul 31, 2024
@azrod
Copy link
Member

azrod commented Aug 2, 2024

Hi,

Sorry for the delay in response.

The problem does not seem to come from the terraform provider.

When you define "SCSI" what is the value actually defined on the IHM ?

Regards

@xriot2
Copy link
Author

xriot2 commented Aug 27, 2024

into the GUI, it indicates 'SATA' and not 'SCSI'

@vivekanandita
Copy link

vivekanandita commented Dec 5, 2024

I agree with @xriot2. I'm also facing same issue, when trying to create disk.

earlier I used to use vcd provider disk schema was like below and it worked fine.
bus_type - (Required) The type of disk controller. Possible values: ide, parallel( LSI Logic Parallel SCSI), sas(LSI Logic SAS (SCSI)), paravirtual(Paravirtual (SCSI)), sata, nvme. Note nvme requires

for CloudAvenue it is different as below:

bus_type (String) (ForceNew) The type of disk controller. Attribute require replacement if is_detachable is false. Value must be one of : IDE, SATA, SCSI, NVME. Value defaults to SCSI.

Note: on my GUI portal for New cloud avenue I have bus_type values as below terraform provider on cloud avenue does not have any option to provide SCSI as bus_type:
values:
ide,
parallel( LSI Logic Parallel SCSI),
sas(LSI Logic SAS (SCSI)),
paravirtual(Paravirtual (SCSI)),
sata,
nvme

@azrod ?

@github-actions github-actions bot removed the bug label Jan 2, 2025
@azrod
Copy link
Member

azrod commented Jan 6, 2025

Hello,

Sorry for the delay.

Can your try to set NVME in your terraform ?

Thanks

@azrod azrod added the bug Bug label Jan 6, 2025
@xriot2
Copy link
Author

xriot2 commented Jan 7, 2025

I've tested with nvme always the same problem

cloudavenue_vm_disk.disk[0]: Creating...
cloudavenue_vm_disk.disk[0]: Still creating... [10s elapsed]
cloudavenue_vm_disk.disk[0]: Still creating... [20s elapsed]

│ Error: Provider produced inconsistent result after apply

│ When applying changes to cloudavenue_vm_disk.disk[0], provider
│ "provider["registry.terraform.io/orange-cloudavenue/cloudavenue"]"
│ produced an unexpected new value: .bus_type: was cty.StringVal("NVME"), but
│ now cty.StringVal("SATA").

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

the plan is ok

cloudavenue_vm_disk.disk[0] will be created

  • resource "cloudavenue_vm_disk" "disk" {
    • bus_number = 2
    • bus_type = "NVME"
    • id = (known after apply)
    • is_detachable = false
    • size_in_mb = 10240
    • storage_profile = "silver"
    • unit_number = 0
    • vapp_name = "vapp-ua-clini"
    • vdc = (known after apply)
    • vm_name = "uaclini00"
      }

@azrod
Copy link
Member

azrod commented Jan 7, 2025

@xriot2 Many thanks for your test.

I'm currently working to try to fix this problem.

@azrod azrod linked a pull request Jan 8, 2025 that will close this issue
3 tasks
@azrod azrod closed this as completed in #944 Jan 8, 2025
@xriot2
Copy link
Author

xriot2 commented Jan 8, 2025

I've switch on version 0.26.0 for the source orange-cloudavenue/cloudavenue

I've tested in scsi and nvme.

It's now ok with nvme but for information the error is always the same for scsi bus_type setting:

cloudavenue_vm.res_vm[0]: Creation complete after 3m15s [id=urn:vcloud:vm:58c1d448-5ee1-49db-afd7-8b641d3ef81f]
cloudavenue_vm_disk.disk[0]: Creating...
cloudavenue_vm_disk.disk[0]: Still creating... [10s elapsed]
cloudavenue_vm_disk.disk[0]: Still creating... [20s elapsed]

│ Error: Provider produced inconsistent result after apply

│ When applying changes to cloudavenue_vm_disk.disk[0], provider
│ "provider["registry.terraform.io/orange-cloudavenue/cloudavenue"]"
│ produced an unexpected new value: .bus_type: was cty.StringVal("SCSI"), but
│ now cty.StringVal("SATA").

The update is now sufficient for our ubuntu case.

@azrod azrod reopened this Jan 8, 2025
@azrod
Copy link
Member

azrod commented Jan 8, 2025

Hello @xriot2,

In your test the disk is_detachable ?

@xriot2
Copy link
Author

xriot2 commented Jan 8, 2025

no

@azrod azrod linked a pull request Jan 8, 2025 that will close this issue
3 tasks
@azrod azrod closed this as completed in #945 Jan 8, 2025
@azrod
Copy link
Member

azrod commented Jan 8, 2025

@xriot2

Please try why release v0.26.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug community Community related
Projects
None yet
3 participants