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

Raw Disk is not found during refresh because format is a driver instead of raw #571

Open
markush81 opened this issue Sep 11, 2024 · 4 comments

Comments

@markush81
Copy link

markush81 commented Sep 11, 2024

Description

With vCenter a RAW disk is going to be created each time again, because FORMAT in TEMPLATE is vcenter instead of raw.

Terraform and Provider version

Terraform v1.9.3
on darwin_arm64

  • provider registry.terraform.io/hashicorp/vsphere v2.7.0
  • provider registry.terraform.io/opennebula/opennebula v1.4.0

Your version of Terraform is out of date! The latest version
is 1.9.5. You can update by downloading from https://www.terraform.io/downloads.html

Affected resources and data sources

opennebula_virtual_machine

Terraform configuration

disk {
      image_id = ...
      size            = 10240
      target          = "sda"
    }
    disk {
      volatile_format = "raw"
      volatile_type   = "fs"
      size            = 10240
      target          = "sdb"
    }


### Expected behavior

terraform apply -> Creation
terraform apply -> No Change

### Actual behavior

terraform apply -> Creation
terraform apply -> Change

  + disk {
      + image_id        = -1
      + size            = 10240
      + target          = "sdb"
      + volatile_format = "raw"
      + volatile_type   = "fs"
    }

### Steps to Reproduce

> 1x time `terraform apply`

### Debug output

Compile Plugin with certain additional output


DISK=[
ALLOW_ORPHANS="NO",
CLUSTER_ID="100",
DATASTORE="ssd-003279(SYS)",
DATASTORE_ID="109",
DEV_PREFIX="sd",
DISK_ID="1",
DISK_TYPE="FILE",
DRIVER="vcenter",
FORMAT="vcenter", <----------
SIZE="10240",
TARGET="sdb",
TM_MAD="vcenter",
TYPE="fs",
VCENTER_DS_REF="datastore-1056",
VCENTER_INSTANCE_ID="a59e28b4-7adc-4118-8338-e2a3462aa431" ]
...
2024-09-11T15:35:15.244+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 sdb sdb true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 10240 10240 true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 vcenter true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 sd true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 fs fs true: timestamp="2024-09-11T15:35:15.244+0200"
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 raw vcenter false: timestamp="2024-09-11T15:35:15.244+0200"
...
2024-09-11T15:35:15.245+0200 [INFO] provider.terraform-provider-opennebula: 2024/09/11 15:35:15 [WARN] Configuration for disk ID: 1 not found.: timestamp="2024-09-11T15:35:15.244+0200"
...
2024-09-11T15:35:15.248+0200 [WARN] Provider "registry.terraform.io/opennebula/opennebula" produced an unexpected new value for opennebula_virtual_machine.opennebula_vm during refresh.
- .disk: block count changed from 2 to 1

The part being response for the "wrong" FORMAT seems to be https://github.com/OpenNebula/one/blob/master/src/datastore/Datastore.cc#L218, also

TM_MAD_CONF = [
    NAME = "vcenter", LN_TARGET = "NONE", CLONE_TARGET = "SYSTEM", SHARED = "YES"
]

does not define a DRIVER.

It is unclear to me, to what exactly "system DS template" is referring to, but i haven't found any "DRIVER = ..." configuration at all, related to vcenter.

Panic output

No response

Important factoids

No response

References

No response

Copy link

This issue is stale because it has been open for 30 days with no activity and it has not the 'status: confirmed' label or it is not in a milestone. Remove the 'status: stale' label or comment, or this will be closed in 5 days.

@markush81 markush81 changed the title Raw Disk is not found during refresh because format is vcenter instead of raw Raw Disk is not found during refresh because format is a driver instead of raw Oct 12, 2024
@markush81
Copy link
Author

still relevant and not only for vcenter, according to code

Copy link

This issue is stale because it has been open for 30 days with no activity and it has not the 'status: confirmed' label or it is not in a milestone. Remove the 'status: stale' label or comment, or this will be closed in 5 days.

@markush81
Copy link
Author

still relevant and not only for vcenter, according to code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant