"missing DISK mandatory attributes" when VM starting

Step 1 .
Upload ISO with OS as Image

IMAGE 18 INFORMATION                                                            
ID             : 18                  
NAME           : CentOS 6.6          
USER           : oneadmin            
GROUP          : oneadmin            
DATASTORE      : default             
TYPE           : CDROM               
REGISTER TIME  : 06/18 22:53:23      
PERSISTENT     : Yes                 
SOURCE         :                     
PATH           : /var/lib/one/iso/CentOS-6.6-x86_64-minimal.iso
SIZE           : 383M                
STATE          : used                
RUNNING_VMS    : 1                   

PERMISSIONS                                                                     
OWNER          : uma                 
GROUP          : ---                 
OTHER          : ---                 

IMAGE TEMPLATE                                                                  
DEV_PREFIX="hd"

Step 2.
Create DATABLOCK for future OS

IMAGE 20 INFORMATION                                                            
ID             : 20                  
NAME           : CentOS - 20GB       
USER           : RomanBogachev       
GROUP          : oneadmin            
DATASTORE      : default             
TYPE           : DATABLOCK           
REGISTER TIME  : 06/18 22:58:39      
PERSISTENT     : Yes                 
SOURCE         : /var/lib/one//datastores/1/6d85d9a3e6c8e13b522e13fd8b01e8ad
FSTYPE         : qcow2               
SIZE           : 19.5G               
STATE          : used                
RUNNING_VMS    : 1                   

PERMISSIONS                                                                     
OWNER          : uma                 
GROUP          : ---                 
OTHER          : ---                 

IMAGE TEMPLATE                                                                  
DEV_PREFIX="sd"
DRIVER="qcow2"

Step 3.
Create template

CPU="1"
MEMORY="512"
SCHED_REQUIREMENTS="ID=\"0\""
OS=[BOOT="cdrom"]
NIC=[NETWORK_UNAME="oneadmin",NETWORK="Private"]
CONTEXT=[SSH_PUBLIC_KEY="",NETWORK="YES"]
DISK=[READONLY="yes",IMAGE="CentOS 6.6",IMAGE_UNAME="oneadmin"]
DISK=[IMAGE="CentOS - 20GB",IMAGE_UNAME="RomanBogachev"]
FEATURES=[ACPI="yes"]
GRAPHICS=[TYPE="VNC",LISTEN="0.0.0.0"]

Step 4.
Create VM, but get error msg

Thu Jun 18 23:05:35 2015 [DiM][I]: New VM state is ACTIVE.
Thu Jun 18 23:05:35 2015 [LCM][I]: New VM state is PROLOG.
Thu Jun 18 23:05:35 2015 [TM][E]: missing DISK mandatory attributes (SOURCE, TM_MAD, CLONE, DATASTORE_ID) for VM 68, DISK 0
Thu Jun 18 23:05:35 2015 [DiM][I]: New VM state is FAILED

What’s th problem and how i can solve it?

hi,

when creating a datablock, you end up with a raw image. If you want to use it as a startup disk, you should change the type from “datablock” to “OS”. Under FSTYPE you mention qcow2, but that should be something else, like ext4 or ntfs.

If you want to use qcow2 images, don’t create datablocks, but use qemi-img to create qcow2 images and then import them to the datastore. (and make sure to use the prefix “vd” instead of “sd”, so it uses virtio).

This thread: RAW vs QCOW2 images; VMs fail
contains ways to create qcow2 images, or convert your existing raw images to qcow2.

hope this helps !

Hi, thanks for your reply, but i do differently.

In continuation to the above…

Step 5.

  1. Instan­ti­ate the tem­plate. This will cre­ate a VM, which will boot from the CDROM (Step 1) and install the OS in the dat­a­block disk (Step2).
  2. Shut­down the VM when instal­la­tion is com­plete and delete the VM. Remem­ber, our dat­a­block is per­sis­tent so the OS is installed and all changes are per­sis­tent.
    3). Goto Images and change its Type from Dat­a­block to OS.

I want manualy install OS, for this i need to startup VM.

Problem solved.

what did you do to solve?

@GabrielDias -> I have the same problem, please help to resolve it.

Or @asist did you find a solution?

Hi,

Paste please error log here and information about your image & template.

Hey,

I just got to the error message “missing DISK mandatory attributes (SOURCE, TM_MAD, CLONE, DATASTORE_ID)” by manually enabling the images, which changes the images from error to ready. I know that was not right. It looks like i have a problem with the images and maybe with the storage. Thank you for your help!

Here are the error messages of the created images.

ImageName: Ubuntu_Server_16_04_ISO

ERROR: Error copying image in the datastore: Error copying /var/tmp/889192448-ubuntu-16044-server-amd64iso to /var/lib/one//datastores/100/c1549cd1cce54d36bf095b086c9f6925

ImageName: Empty
Datablock 20GB (persistent)

ERROR: Error creating datablock: Unable to create filesystem raw in /var/lib/one//datastores/100/bec07c9b31da6988ebf991b3f44846ba

Storage:

]# onedatastore list
ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT
0 system - - 0 0 sys - ssh off
1 default 50G 83% 0 0 img fs ssh on
2 files 50G 83% 0 0 fil fs ssh on
100 Images Datast 465.4G 100% 0 2 img fs shared on
103 System Datast 931.3G 100% 0 0 sys - fs_lvm on

The storage ID100 and ID103 are LUN’s from a iSCSI storage device. Both LUN’s are mapped to the iSCSI initiator to the frontend and the node. The storage ID100, formatted as xfs, is mounted on the path “/var/lib/one/datastores/100”, on the frontend and on the node.

]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 466G 33M 466G 1% /var/lib/one/datastores/100

Attributes
ALLOW_ORPHANS NO
CLONE_TARGET SYSTEM
CLONE_TARGET_SSH SYSTEM
DATASTORE_CAPACITY_CHECK YES
DISK_TYPE FILE
DISK_TYPE_SSH FILE
DS_MAD fs
LN_TARGET NONE
LN_TARGET_SSH SYSTEM
TM_MAD shared
TM_MAD_SYSTEM ssh
TYPE IMAGE_DS

The storage ID103 is formatted as a LVM with a vg “vg-one-103” on the node.

]# vgscan
Found volume group “vg-one-103” using metadata type lvm2

But sometimes the memory is not displayed from the lvm but by the local one. Instead of 1tb -> 50GB.
]# onedatastore list
ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT
103 System Datast 50G 85% 0 0 sys - fs_lvm on

Attributes
ALLOW_ORPHANS NO
BRIDGE_LIST frontend node
DISK_TYPE FILE
DS_MIGRATE YES
SAFE_DIRS /var/tmp
SHARED YES
TM_MAD fs_lvm
TYPE SYSTEM_DS
VG_NAME vg-one-103

Thanks for any help! :slight_smile:

Try to check attributes.
https://docs.opennebula.org/5.4/deployment/open_cloud_storage_setup/iscsi_ds.html#create-an-image-datastore

Did you try manually creating image from console in this directory? Does it create?