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"}
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.
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]
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?