Bug 870078 - Deltacloud RHEVM client needs to Base64-decode user_data when vmpayload is used
Summary: Deltacloud RHEVM client needs to Base64-decode user_data when vmpayload is used
Keywords:
Status: CLOSED EOL
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: deltacloud-core
Version: 1.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
Assignee: Michal Fojtik
QA Contact: Ronelle Landy
URL:
Whiteboard:
Depends On:
Blocks: 878084
TreeView+ depends on / blocked
 
Reported: 2012-10-25 14:17 UTC by Ronelle Landy
Modified: 2020-03-27 18:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 878084 (view as bug list)
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)
A patch for deltacloud-core 0.5.0 (3.44 KB, patch)
2012-10-25 14:26 UTC, Michal Fojtik
no flags Details | Diff

Description Ronelle Landy 2012-10-25 14:17:43 UTC
Description of problem:

Following from BZ-868311 ... for RHEVM 3.1 and onwards, vmpayload will be used as the mechanism to do user data injection for RHEVM. When the floppyinject hook was used, this hook included functionality to Base64-decode the user data. Now that vmpayload will be used, the decode functionality need to move to the Deltacloud RHEVM client code.
	
Michal Fojtik already has a patch in place for this.


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

 - RHEVM 3.1
 - Conductor 1.1.1 and upwards
 - Deltacloud 0.5.0 (backported) and Deltacloud 1.0.x 

How reproducible:


Steps to Reproduce:
1. Set up a RHEVM 3.1 provider without the floppyinject hook installed
2. Create an instance with user_data using the Deltacloud Ruby client
3. Start the instance
4. ssh to the instance
5. >> /sbin/modprobe floppy; lsmod | grep floppy
   >>  /bin/mount /dev/fd0 /media; cat /media/deltacloud-user-data.txt

  
Actual results:
Without the decode step in /drivers/rhevm/rhevm_client.rb, the user_data is encoded - ie; encode once more from the time that the data was passed to the create_instance command

Expected results:

Data should be available on the RHEVM vm in the same state of encoding as it was passed to client.


Additional info:

Comment 1 Michal Fojtik 2012-10-25 14:26:24 UTC
Created attachment 633351 [details]
A patch for deltacloud-core 0.5.0

This patch is extending the Deltacloud API 0.5.0 to support the new RHEV-M 3.1 VMPayload feature:

The logic behid this patch is:

1. If RHEV-M is version 3.x
  2a) If 'x' is >= 1 then force VMPayload injection using floppy
  2b) If 'x' is == 0 then use the floppyhook injection if it is available

Because floppyinject hook do a Base64 decode for the user injected data before writing those data
into file in floppy, the VMPayload need to decode encoded data in the driver. It means that client
should **always** send a Base64 encoded data when using the 'user_data' feature in DC

Comment 3 Ronelle Landy 2012-10-25 16:53:17 UTC
Tested the attached patch on:

-----------------------

Deltacloud -0.5.0
RHEVM 3.1
No floppyinject hook installed

 /sbin/modprobe floppy; lsmod | grep floppy
floppy                 61575  0 
[root@10-16-120-187 ~]# /bin/mount /dev/fd0 /media; cat /media/deltacloud-user-data.txt
mount: block device /dev/fd0 is write-protected, mounting read-only
<correct user_data returned>

-------------------------

Deltacloud -0.5.0
RHEVM 3.0
floppyinject hook installed

/sbin/modprobe floppy; lsmod | grep floppy
floppy                 61511  0 
[root@10-16-120-245 ~]# /bin/mount /dev/fd0 /media; cat /media/deltacloud-user-data.txt
<correct user_data returned>

----------------------------

The two instance above where created using the Deltacloud Ruby client /rhevm_client.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb


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