Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1505974

Summary: Satellite only deploys VMs on RHV compute resource in thin storage mode
Product: Red Hat Satellite Reporter: Daniele <dconsoli>
Component: Compute Resources - RHEVAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.12CC: aperotti, bbuckingham, inecas, mjankula, oprazak, orabin, pmoravec, rbobek, sjagtap
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-02 11:05:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1541321    
Attachments:
Description Flags
foreman tail none

Description Daniele 2017-10-24 17:19:44 UTC
Created attachment 1342917 [details]
foreman tail

Description of problem:
When provisioning a VM on RHV 4.1.9, the VMs are deployed with thin-provisioned storage. We don't seem to have an option to change this.

As per RHV docs:
https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.1/html/administration_guide/chap-virtual_machine_disks

In iSCSI and other block-based data centers, the SPM creates a volume group on top of the Logical Unit Numbers (LUNs) provided, and makes logical volumes to use as virtual disks. Virtual disks on block-based storage are preallocated by default.

So it seems to be Foreman enforcing the "preallocated==0" for some reason.

Version-Release number of selected component (if applicable):
Satellite 6.2.12
RHV 4.1.9

How reproducible:
100%

Steps to Reproduce:
1. Provision a machine on RHV from template
2. Inspect machine
3.

Actual results:
storage is thin-provisioned

Expected results:
storage should be preallocated by default. A way to select options would be ideal.


Additional info:
2017-10-23 15:08:56 057bd82d [app] [I] Processing by HostsController#template_used as */*
2017-10-23 15:08:56 057bd82d [app] [I]   Parameters: {"utf8"=>"â", "authenticity_token"=>"8HbFVB07J1nQAwvS6+TIJ/cjiwgC4jbG4b4R46uvkYI=", "host"=>{"name"=>"wefalj53", "organization_id"=>"1", "location_id"=>"4", "hostgroup_id"=>"10", "compute_resource_id"=>"3", "content_facet_attributes"=>{"lifecycle_environment_id"=>"1", "content_view_id"=>"1", "id"=>"", "kickstart_repository_id"=>"22"}, "environment_id"=>"4", "content_source_id"=>"4", "openscap_proxy_id"=>"", "config_group_ids"=>[""], "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"wefalj53", "domain_id"=>"2", "subnet_id"=>"2", "ip"=>"172.23.224.63", "managed"=>"1", "primary"=>"1", "provision"=>"1", "execution"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"name"=>"nic1", "network"=>"cfd2f591-7467-471e-8b3f-49d1a698da33"}}, "new_interfaces"=>{"_destroy"=>"1", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"0", "execution"=>"0", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"name"=>"", "network"=>"9a18853b-6a95-48d6-86a5-e07f6e6b65ec"}}}, "compute_attributes"=>{"cluster"=>"4eade02a-e5dd-4170-96b5-73ae563e48d8", "cores"=>"2", "memory"=>"4294967296", "start"=>"1", "volumes_attributes"=>{"new_volumes"=>{"_delete"=>"", "size_gb"=>"", "storage_domain"=>"288bcf17-5237-43c8-8887-85b8a28294c4", "id"=>"", "preallocate"=>"0"}}, "image_id"=>"97c63d41-3550-4474-a227-c67b338372af"}, "architecture_id"=>"1", "operatingsystem_id"=>"2", "provision_method"=>"image", "build"=>"1", "ptable_id"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"build image", "provider"=>"Ovirt", "media_selector"=>"synced_content", "fakepassword"=>"[FILTERED]", "bare_metal_capabilities"=>"build", "provisioning"=>"image"}
2017-10-23 15:08:56 057bd82d [app] [I]   Rendered hosts/_provisioning.html.erb (3.7ms)
2017-10-23 15:08:56 057bd82d [app] [I] Completed 200 OK in 123ms (Views: 7.6ms | ActiveRecord: 12.9ms)
2017-10-23 15:08:58 669ab96f [app] [I] Started POST "/compute_resources/3-RHEV_WF_SVIL_COLL_LB/template_selected" for 10.36.240.199 at 2017-10-23 15:08:58 +0200
2017-10-23 15:08:58 669ab96f [app] [I] Processing by ComputeResourcesController#template_selected as */*
2017-10-23 15:08:58 669ab96f [app] [I]   Parameters: {"template_id"=>"5d33918b-0817-4cca-a212-4b0b40ef811d", "id"=>"3-RHEV_WF_SVIL_COLL_LB"}
2017-10-23 15:08:59 142b1c4c [app] [I] Started POST "/hosts/template_used?provisioning=image" for 10.36.240.199 at 2017-10-23 15:08:59 +0200
2017-10-23 15:08:59 142b1c4c [app] [I] Processing by HostsController#template_used as */*
2017-10-23 15:08:59 142b1c4c [app] [I]   Parameters: {"utf8"=>"â", "authenticity_token"=>"8HbFVB07J1nQAwvS6+TIJ/cjiwgC4jbG4b4R46uvkYI=", "host"=>{"name"=>"wefalj53", "organization_id"=>"1", "location_id"=>"4", "hostgroup_id"=>"10", "compute_resource_id"=>"3", "content_facet_attributes"=>{"lifecycle_environment_id"=>"1", "content_view_id"=>"1", "id"=>"", "kickstart_repository_id"=>"22"}, "environment_id"=>"4", "content_source_id"=>"4", "openscap_proxy_id"=>"", "config_group_ids"=>[""], "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"wefalj53", "domain_id"=>"2", "subnet_id"=>"2", "ip"=>"172.23.224.63", "managed"=>"1", "primary"=>"1", "provision"=>"1", "execution"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"name"=>"nic1", "network"=>"cfd2f591-7467-471e-8b3f-49d1a698da33"}}, "new_interfaces"=>{"_destroy"=>"1", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"0", "execution"=>"0", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"name"=>"", "network"=>"9a18853b-6a95-48d6-86a5-e07f6e6b65ec"}}}, "compute_attributes"=>{"cluster"=>"4eade02a-e5dd-4170-96b5-73ae563e48d8", "cores"=>"2", "memory"=>"4294967296", "start"=>"1", "volumes_attributes"=>{"new_volumes"=>{"_delete"=>"", "size_gb"=>"", "storage_domain"=>"288bcf17-5237-43c8-8887-85b8a28294c4", "id"=>"", "preallocate"=>"0"}}, "image_id"=>"5d33918b-0817-4cca-a212-4b0b40ef811d"}, "architecture_id"=>"1", "operatingsystem_id"=>"2", "provision_method"=>"image", "build"=>"1", "ptable_id"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"build image", "provider"=>"Ovirt", "media_selector"=>"synced_content", "fakepassword"=>"[FILTERED]", "bare_metal_capabilities"=>"build", "provisioning"=>"image"}

Comment 1 Roman Bobek 2017-10-27 08:44:45 UTC
Hi all,

the problem here seems to be in the API call the Satellite passes to RHV. The POST line contains this:

POST /ovirt-engine/api/v3/vms HTTP/1.1

But it should look like this:

POST /ovirt-engine/api/vms?clone=true HTTP/1.1

When adding the '?clone=true' part to the call, Fulvio (on-site consultant) was able to provision the vm correctly with preallocated disk policy.

Here is the way how to capture the API calls. Settings must be done on RHV-M server:

# yum -y install mod_security

# vim /etc/httpd/conf/httpd.conf

Add following lines:

SecRuleEngine on
SecAuditEngine on
SecAuditLog /var/log/httpd/satellite-api.log
SecRequestBodyAccess on
SecAuditLogParts ABIFHZ
SecDefaultAction "nolog,noauditlog,allow,phase:2"
SecRule REQUEST_METHOD "^POST$" "chain,allow,phase:2,id:123"
SecRule REQUEST_URI ".*" "auditlog"

# systemctl restart httpd

After provisioning from Satellite, /var/log/httpd/satellite-api.log will contain the API call. Good idea is to search for the vm name because the file contains many information.

Comment 4 Roman Bobek 2017-10-28 07:00:04 UTC
WORKAROUND:

Indeed, we found that the oVirt api seems to accept "clone=true" as a query string parameter and not as a field in the xml describing the VM. Hence, on the ovirt console system we added the following rewrite rule:

RewriteEngine  on
RewriteCond    %{REQUEST_METHOD} POST
RewriteRule    "^/ovirt-engine/api/vms$"  "ajp://127.0.0.1:8702/ovirt-engine/api/vms?clone=true" [P,QSA]

Comment 8 Pavel Moravec 2017-10-31 14:50:01 UTC
General consensus is the remaining bits are due to https://bugzilla.redhat.com/show_bug.cgi?id=1452534 - could you pls. prepare a HF / build to test the precompiled js code, Ivan?