| Summary: | bad error message reporting when rhevm is missing a plugin, need doc for admin | |||
|---|---|---|---|---|
| Product: | [Retired] CloudForms Cloud Engine | Reporter: | dgao | |
| Component: | deltacloud-core | Assignee: | Michal Fojtik <mfojtik> | |
| Status: | CLOSED ERRATA | QA Contact: | Ronelle Landy <rlandy> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 1.0.0 | CC: | akarol, dajohnso, deltacloud-maint, dgao, jrd, lutter, rananda, ssachdev, whayutin | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | r1233874 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 769851 783560 (view as bug list) | Environment: | ||
| Last Closed: | 2012-05-15 20:32:24 UTC | Type: | --- | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 769851, 783560 | |||
|
Description
dgao
2011-12-09 15:06:33 UTC
I think this error is very related to this one on upstream JIRA: https://issues.apache.org/jira/browse/DTACLOUD-108 I will send a patch to make the error message more nice. However my though is that this is more RHEV-M bug than Deltacloud. Deltacloud is just 'proxyfying' the error message from RHEV-M. Our solution will be to catch this particular error and translate it, but the should be RHEV-M job :-) This should be fixed. A special method "capability?" was added to rhevm_client.rb. This method is called before VM is created and user_data injection is requested. Method return 'true' if RHEV-M has floppyinject custom_hook installed.
Revisions: r1233874
diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
index ca09e92..26b15b7 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
@@ -119,6 +119,16 @@ module RHEVM
(result_xml/'/cluster/version').first[:major].strip == major
end
+ def capability?(name)
+ headers = {
+ :content_type => 'application/xml',
+ :accept => 'application/xml'
+ }
+ headers.merge!(auth_header)
+ result_xml = Nokogiri::XML(RHEVM::client(@api_entrypoint)["/capabilities"].get(headers))
+ !(result_xml/"/capabilities/version/custom_properties/custom_property[@name='#{name}']").empty?
+ end
+
def create_vm(template_id, opts={})
opts ||= {}
templ = template(template_id)
@@ -135,6 +145,7 @@ module RHEVM
}
if opts[:user_data] and not opts[:user_data].empty?
if api_version?('3') and cluster_version?((opts[:realm_id] || clusters.first.id), '3')
+ raise "Required VDSM hook 'floppyinject' not supported by RHEV-M" unless capability?(:floppyinject)
custom_properties {
custom_property({
:name => "floppyinject",
If RHEVM does not have 'floppyinject' capability, the following error is returned (API output copied below): curl -X POST -F "image_id=14ba9684-41c5-4917-858c-13303bf710bd" -F "user_data=1|https://xxx|xxx_key|xxxxxxxx" --user 'username:password' "http://server:3001/api/instances?format=xml" <error status='500' url='/api/instances?format=xml'> <kind>backend_error</kind> <backend driver='rhevm'> <code>500</code> </backend> <message><![CDATA[Unhandled exception or status code (Required VDSM hook 'floppyinject' not supported by RHEV-M)]]></message> </error> When the 'floppyinject' capability is added to that same RHEVM server: curl -X POST -F "image_id=14ba9684-41c5-4917-858c-13303bf710bd" -F "user_data=1|https://xxxx|xxxx_key|xxxxxxxxx" --user 'username:password' "http://server:3001/api/instances?format=xml" <?xml version='1.0' encoding='utf-8' ?> <instance href='http://server:3001/api/instances/e3ed6fab-52c8-4a3e-95f3-05c381d84b49' id='e3ed6fab-52c8-4a3e-95f3-05c381d84b49'> <name>xxx</name> <owner_id>xxx</owner_id> <image href='http://server:3001/api/images/14ba9684-41c5-4917-858c-13303bf710bd' id='14ba9684-41c5-4917-858c-13303bf710bd'></image> <realm href='http://server:3001/api/realms/ba2b3a52-4303-11e1-b6c2-5cf3fc1c861c' id='ba2b3a52-4303-11e1-b6c2-5cf3fc1c861c'></realm> <state>PENDING</state> <hardware_profile href='http://server:3001/api/hardware_profiles/DESKTOP' id='DESKTOP'> <property kind='fixed' name='storage' unit='GB' value='1'></property> <property kind='fixed' name='cpu' unit='count' value='1'></property> <property kind='fixed' name='memory' unit='MB' value='512'></property> </hardware_profile> <actions> <link href='http://server:3001/api/images;instance_id=e3ed6fab-52c8-4a3e-95f3-05c381d84b49' method='post' rel='create_image' /> </actions> <launch_time>2012-01-20T14:17:17.038-05:00</launch_time> <public_addresses><address port='xxxx' type='vnc'>127.0.0.1</address></public_addresses> <private_addresses></private_addresses> </instance> Can someone provide the steps to configure rhevm to have the floppy inject capability and we'll make this a doc bug moving back to dc, there is a messaging fix put in.. GREAT! Cloning the bug to make sure we have the appropriate doc for the rhevm setup Marking this bug as verified as per test comments (in Comment 4) above. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2012-0587.html |