Bug 1772853 - Cannot create VMs from Template when using thin provisioning
Summary: Cannot create VMs from Template when using thin provisioning
Keywords:
Status: CLOSED DUPLICATE of bug 1758048
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: 4.3.6.6
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: ---
Assignee: bugs@ovirt.org
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-15 10:30 UTC by Marko Vrgotic
Modified: 2019-12-22 14:46 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-12-18 14:16:09 UTC
oVirt Team: Storage
Embargoed:


Attachments (Terms of Use)
ovirt-engine log file (49.34 KB, text/plain)
2019-11-15 10:30 UTC, Marko Vrgotic
no flags Details
vdsm log 3 (952.36 KB, application/x-xz)
2019-11-15 10:31 UTC, Marko Vrgotic
no flags Details
vdsm log 2 (970.87 KB, application/x-xz)
2019-11-15 10:31 UTC, Marko Vrgotic
no flags Details
vdsm log 1 (933.59 KB, application/x-xz)
2019-11-15 10:32 UTC, Marko Vrgotic
no flags Details

Description Marko Vrgotic 2019-11-15 10:30:55 UTC
Created attachment 1636424 [details]
ovirt-engine log file

Description of problem:

When creating VMs via Ansible, creation fails at attaching the disk image.
Via WebUI works just fine.

Version-Release number of selected component (if applicable):

oVirt release 4.3.6.6

How reproducible:

Every time.

Steps to Reproduce:
1. create vm template (I was working with CentOS7) in oVIrt
2. using ovirt_vm ansible module try to instantiate a VM based on template


Actual results:

VM object created but no DISK attached. VM is rendered down and needs manual disk creation/cone and attaching.


Expected results:


VM is created from template with disk attached and ready to use.

Additional info:

tested with following pipenv:
ansible==2.7.13
asn1crypto==1.0.0
bcrypt==3.1.7
cffi==1.12.3
cryptography==2.7
dnspython==1.16.0
ipaddress==1.0.22
Jinja2==2.10.1
lxml==4.4.1
MarkupSafe==1.1.1
netaddr==0.7.19
ovirt-engine-sdk-python==4.3.3
paramiko==2.6.0
pycparser==2.19
pycurl==7.43.0.3
PyNaCl==1.3.0
PyYAML==5.1.2
six==1.12.0

ansible playbooks used:
main_baker.yml
============
- name: "oVirt Template Bakery"
  hosts: all
  gather_facts: false
  tasks:
    - name: "Login to oVirt"
      ovirt_auth:
         url: "{{ ovirt_engine_url }}"
         username: "{{ ovirt_engine_user }}"
         password: "{{ ovirt_engine_password }}"
         ca_file: "{{ ovirt_engine_cafile | default(omit) }}"
         insecure: "{{ ovirt_engine_insecure | default(true) }}"
      delegate_to: localhost
      run_once: true

- import_playbook: 00-check-ovirt-env.yml
#- import_playbook: 01-build-vm-image.yml
#- import_playbook: 02-prepare-centos-image.yml
#  when: inventory_hostname in groups['centos-baker']
#- import_playbook: 02-prepare-ubuntu-image.yml
#  when: inventory_hostname in groups['ubuntu-baker']
#- import_playbook: 03-bake-template-image.yml
- import_playbook: 04-validate-image.yml
#- import_playbook  05-distribute-image.yml
===============
04-validate_image.yml
=============
---
- name: Create VM in oVirt
  hosts: test-vms
  connection: local
  gather_facts: false

  vars:
    - vmstate: running
    - keyfile: "{{ lookup('file', lookup('env', 'OVIRT_SSH_PUBKEY') | default(lookup('env', 'HOME') + '/.ssh/id_rsa.pub'))}}"

  tasks:
    - name: Create new VMs from template
      delegate_to: localhost
      ovirt_vm:
        auth: "{{ ovirt_auth }}"
        name: "{{ inventory_hostname_short }}"
        comment: "{{ comment_vms }} Validation"
        instance_type: Small
        nics:
        - name: nic1
          profile_name: tenant1
          interface: virtio
        cloud_init:
          user_name: "{{ ansible_user }}"
          host_name: "{{ inventory_hostname }}"
          authorized_ssh_keys: "{{ keyfile }}"
        template: "{{ ovirt_template_name }}"
        state: "{{ vmstate }}"
        cluster: avshared1

    - name: "Wait until the ansible user can log into the host (cloud-init needs to have finished)"
      command: ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no {{ansible_user}}@{{ansible_host}} exit
      register: ssh_output
      delegate_to: localhost
      until: ssh_output.rc == 0
      retries: 30
      delay: 5
      changed_when: False

  post_tasks:
    - name: Logout from oVirt
      delegate_to: localhost
      ovirt_auth:
        state: absent
        ovirt_auth: "{{ ovirt_auth }}"
      tags:
        - always
=====================

attached are the engine.log and host vdsm.log

Comment 1 Marko Vrgotic 2019-11-15 10:31:32 UTC
Created attachment 1636425 [details]
vdsm log 3

Comment 2 Marko Vrgotic 2019-11-15 10:31:54 UTC
Created attachment 1636426 [details]
vdsm log 2

Comment 3 Marko Vrgotic 2019-11-15 10:32:13 UTC
Created attachment 1636428 [details]
vdsm log 1

Comment 4 RHEL Program Management 2019-11-16 02:29:53 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 5 Marko Vrgotic 2019-11-17 18:55:41 UTC
I am sorry, but I do not understand your request.
I simply submitted bug request and attached log files. 
Please clarify what else is required of me to do.

Comment 6 Michal Skrivanek 2019-11-18 10:19:21 UTC
fails during CreateSnapshotFromTemplate with
2019-11-12 11:45:28,610+0000 ERROR (tasks/3) [storage.Volume] Requested capacity 8589934592 < parent capacity 42949672960 (volume:1211)
2019-11-12 11:45:28,610+0000 ERROR (tasks/3) [storage.TaskManager.Task] (Task='91e0faed-2e02-4f57-a58a-2f0680a1fa20') Unexpected error (task:875)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 882, in _run
    return fn(*args, **kargs)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 336, in run
    return self.cmd(*self.argslist, **self.argsdict)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/securable.py", line 79, in wrapper
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/sp.py", line 1940, in createVolume
    initial_size=initialSize)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/sd.py", line 930, in createVolume
    initial_size=initial_size)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 1212, in create
    raise se.InvalidParameterException("capacity", capacity)
InvalidParameterException: Invalid parameter: 'capacity=8589934592'

looks like a storage problem? Tal?

Comment 7 Marko Vrgotic 2019-11-21 08:03:27 UTC
Hi all,

I was able to reproduce the issue via oVirt engine WebUI as well.

It seems to be a problem when "Thin" provisioning is selected from  "Resource Allocation" TAB.

If I leave the default, which is Clone, than disk is created without problem.

Comment 8 Eyal Shenitzky 2019-11-25 09:08:49 UTC
This looks like a duplication of bug 1758048.

Vojtech can you please have a look?

Comment 9 Tal Nisan 2019-12-18 14:16:09 UTC

*** This bug has been marked as a duplicate of bug 1758048 ***


Note You need to log in before you can comment on or make changes to this bug.