Terraform volatile disk issue

Hi,
I couldn’t resolve myself this issue.

I’ve created a terraform script to provide a vm with a additional volatile disk that I want to mount after creation. The datastore in a ceph rdb datastore (no issue in this side).
I’ve created templates with or without a second volatile disk. (first is a Ubuntu 22.04 image)

First: Terraform script doesn’t create the second disk although the template disk is specified. I had to specified the second disk in terraform script. No interest to use a template for this option.

Second: I tried different options to create my volatile disk :

  • volatile_format = “raw” or “qcow2” → always create a raw disk
  • volatile_type = “fs”
  • driver = “raw” or not specified
  • size = 100000 (the final size is 97.5 at this end, I didn’t understand why)

Problem: The vm is created, the disk is attach. Everything seems OK but:
The additional disk send this error on mounting : wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error.
It’s a ceph block behind, formatted in ext4. I checked the device with classic linux disk tools (e2fsck, fsck, etc…) always the same problem. Superblock issue.
With the same vm, if I detached the previous disk and I added a new disk with sunstone UI, miracle,
the new disk has been recognized, no error and mounting had not problem (with the right size 100Go).
The lonely difference is in terraform I can’t indicate the filesystem (etx4 in my case), no option of that.

Have you see this behavior before ?

Best regards
Olivier

HI,
I found why there’s this problem on ONE 6.6.0.

When you create a volatile disk with the GUI, you can specify the filesystem (ext4,…). In the template, this information is given by the key “FS”, in disk section. If you omit to precise it, you’re going to have the same problem (superbloc error).

This additional information is not present in terraform and there’s no documentation for this feature in OpenNebula. I’ve informed the maintainer of the terraform provider but he didn’t find a real information about that in One code. He found just a post about the FSTYPE and FS.

For the moment, I solved my problem in adding this line in the start-script:
mkfs -t ext4 /dev/vdb

I precise I’ve only used ceph datastore.

Best regards,