Bug 1401278

Summary: [RFE] Add option to copy a template's disk between several SDs upon template creation
Product: [oVirt] ovirt-engine Reporter: sefi litmanovich <slitmano>
Component: BLL.VirtAssignee: Michal Skrivanek <michal.skrivanek>
Status: NEW --- QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, tjelinek
Target Milestone: ---Keywords: FutureFeature
Target Release: ---Flags: michal.skrivanek: ovirt-future?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
engine log none

Description sefi litmanovich 2016-12-04 09:28:16 UTC
Created attachment 1227889 [details]
engine log

Description of problem:

https://bugzilla.redhat.com/show_bug.cgi?id=1081536 introduces the ability to create a vm pool that allocates vms disks to different SDs dynamically by looking at SDs free space.
In order to allow this option one should have the template's disk copied between the different SDs.
Another feature - 'template versions' allows the user to create a vm pool pointing to a 'latest' template flag which will update the pool's vms if a new template version will be created under the 'original' template of the pool.
When creating a pool with both features what happens is that upon creation the vms of the pool will be distributed between the SDs BUT when creating a new template version for the pool's template, the vms will be re created only on the first SD.

This happened in 2 scenarios:

1. Creating the new template version from a vm with 1 disk on 1 of the SDs - this case makes sense and seems like the logical behaviour.

2. Creating the new template version from a vm with disk on all the SDs - In this case I'd expect the new vms to be distributed between SDs like in pool creation or vm addition to the pool.

Version-Release number of selected component (if applicable):
ovirt-engine-4.1.0-0.0.master.20161127231313.git9bb30a5.el7.centos.noarch

How reproducible:
always

Steps to Reproduce:
1. Create a template - copy disk to 2 SDs.
2. Create a vm pool from the template - set template version to 'latest' and in resource allocation choose to the 'auto storage target' option.
3. After pool creation is done, create a new template from a vm with disks on both SDs

Actual results:
All the vms in the pool are re created to be based on the new template, but all are created on the first SD only.

Expected results:
All the vms in the pool are re created to be based on the new template and are distributed between both SDs

Additional info:
Both SDs have the same free space (2 nfs folders on the same nfs share).

Comment 1 sefi litmanovich 2016-12-04 09:43:04 UTC
Small amendment to the outcome of this case - in fact after the new template version is created all the vms are created on both SDs - so at first I see them on the first SD but after a while the disks are copied to the other SD as well, which is also not the wanted outcome

Comment 2 Tomas Jelinek 2016-12-07 12:19:51 UTC
when you create a new template version, are the disks of the template distributed on all storage domains?

Comment 3 sefi litmanovich 2016-12-08 10:24:12 UTC
To summarize our conversations on this matter:
When creating a new template it's not possible to create it with 1 disk that has copies on multiple SDs, so when creating a template from a vm with 1 disk all the pooled vms will be created on 1 SD, and when creating the template from a vm with multiple disks then the pooled vms will all be created with multiple disks.
In order to get the pooled vms distributed between SDs with a new template version there are one of 2 W/A:

1. Starting all the vms in the pool before the new template is created, copying the new tmeplate's disk after it's created and then stopping the vms which will then invoke a re creation after a new version was detected during vm's run.

2. After creating the new template and copying it's disk to the other SD Detach vms from the pool and then edit the pool and increase the number of vms.

Both aren't ideal and mistake prone.

Opening an RFE for the capability of creating a new template with few disk copies