Project

General

Profile

HostUnification » History » Version 5

Justin Sherrill, 05/04/2015 11:23 AM

1 1 Justin Sherrill
h1. Host Unification
2 2 Justin Sherrill
3 2 Justin Sherrill
4 2 Justin Sherrill
h2. Main Goals
5 2 Justin Sherrill
6 2 Justin Sherrill
* Unify "Content Hosts" and Hosts so that they are one object based on a 'Host'.  The content and subscription portions simply become attributes/concerns/aspects of a Host object.
7 2 Justin Sherrill
* 
8 2 Justin Sherrill
9 2 Justin Sherrill
10 2 Justin Sherrill
11 3 Justin Sherrill
h2. Design
12 2 Justin Sherrill
13 2 Justin Sherrill
h4. Ideal Design
14 2 Justin Sherrill
We have presented two designs, one design based somewhat on this discussion:
15 2 Justin Sherrill
16 2 Justin Sherrill
https://groups.google.com/forum/#!searchin/foreman-dev/shim/foreman-dev/9ByQmAtKokQ/W2V924xqtYUJ
17 2 Justin Sherrill
18 4 Justin Sherrill
!http://projects.theforeman.org/attachments/download/1239/aspect.png!
19 2 Justin Sherrill
20 2 Justin Sherrill
The goal is to open a pull request with this design implemented for the Puppet related portion and if feedback is positive to proceed with the Content and Subscription portions.
21 2 Justin Sherrill
22 2 Justin Sherrill
h4. Fallback design:
23 2 Justin Sherrill
24 2 Justin Sherrill
If this does not go favourably, we present this alternative design which is very similar but simpler in nature:
25 2 Justin Sherrill
26 1 Justin Sherrill
!http://projects.theforeman.org/attachments/download/1229/simple.png!
27 3 Justin Sherrill
28 3 Justin Sherrill
29 3 Justin Sherrill
h2. Api/Cli changes
30 3 Justin Sherrill
31 3 Justin Sherrill
At a minimum, no api/cli changes would be needed and all functionality could remain with the proposed designs using existing controllers and cli commands.  However given that the current katello systems controller is 'deprecated', we greatly need to plan for a supported api.  Based on the discussions here: https://groups.google.com/forum/#!topic/foreman-dev/4Y4qxyknMwI
32 3 Justin Sherrill
33 5 Justin Sherrill
There are currently two designs:
34 5 Justin Sherrill
35 5 Justin Sherrill
h4. Unified Api Design
36 5 Justin Sherrill
37 5 Justin Sherrill
38 5 Justin Sherrill
39 5 Justin Sherrill
h3. Split Api
40 5 Justin Sherrill
41 3 Justin Sherrill
The apis for interacting with the different aspects:
42 3 Justin Sherrill
43 3 Justin Sherrill
<pre>
44 3 Justin Sherrill
   GET /api/v2/hosts?search="content_attr=foo"
45 3 Justin Sherrill
   GET /api/v2/hosts/:id/content/
46 3 Justin Sherrill
   GET /api/v2/hosts/:id/subscription/
47 3 Justin Sherrill
</pre>
48 3 Justin Sherrill
49 3 Justin Sherrill
  to update a host's content:
50 3 Justin Sherrill
51 3 Justin Sherrill
<pre>
52 3 Justin Sherrill
  PUT /api/v2/hosts/3/  {'content_view_id': 5}
53 3 Justin Sherrill
  OR
54 3 Justin Sherrill
  PUT /api/v2/hosts/3/content {'content_view_id': 5}
55 3 Justin Sherrill
</pre>
56 3 Justin Sherrill
57 3 Justin Sherrill
Sample hammer commands
58 3 Justin Sherrill
59 3 Justin Sherrill
<pre>
60 3 Justin Sherrill
  hammer host content details --id=3
61 3 Justin Sherrill
  hammer host content update --content-view=myView
62 3 Justin Sherrill
  hammer host content errata apply --host-id=3 --errata-ids=RHSA-2014:3
63 3 Justin Sherrill
</pre>
64 3 Justin Sherrill
65 3 Justin Sherrill
66 3 Justin Sherrill
h2. User Stories (P1): 
67 3 Justin Sherrill
68 1 Justin Sherrill
(1 man sprint = 20 points)
69 1 Justin Sherrill
70 5 Justin Sherrill
* As a user, I should be able to create a host without a puppet environment (2)
71 5 Justin Sherrill
* As a developer, I want to split out all puppet concerns to their own 'aspect' (10)
72 3 Justin Sherrill
* As a  user, i expect host create/update/delete to be dynflowed (wrapping the  AR action), via foreman_tasks or in core to allow plugins to hook into  CUD to interact with backend services (4)
73 3 Justin Sherrill
* As a developer, i want to migrate the existing content host model to the new unified models for content and subscriptions (10)
74 3 Justin Sherrill
* As a developer, I want to migrate all the existing content host dynflow  actions to use the new unified model (4)
75 3 Justin Sherrill
* As a user, i want an upgrade provided to move existing content-hosts to the new unified models (4)
76 3 Justin Sherrill
* As a developer, I want to pull system packages into the database (3)
77 3 Justin Sherrill
* As a user, I should be able to search hosts by content attributes (2)
78 3 Justin Sherrill
* As a user, I should be able to search hosts by subscription attributes (2)
79 3 Justin Sherrill
* As a user, I expect subscription facts to live alongside puppet facts.  (4)
80 3 Justin Sherrill
* As a user, I should be able to add & remove hosts to host collections instead of content-hosts (4)
81 3 Justin Sherrill
* As a user, bulk actions should be based off hosts instead of content hosts (2)
82 3 Justin Sherrill
* As a  user, I should be able to register a host with subscription-manager via username and password with the new data model, and a Host should be created (2)
83 3 Justin Sherrill
* As a user, I should be able to register a host with subscription-manager via activation key with the new data model, and a Host should be created (2)
84 1 Justin Sherrill
* As a user, I should be able to register with subscription-manager to an existing host that has never registered with sub-man before (2)
85 3 Justin Sherrill
* As a user, I should be able to register with subscription-manager to an existing host that has previously registered with subscription-manager, and have the old registration be removed, generating a new UUID (2)
86 3 Justin Sherrill
* As a user, virt-who should continue to work with the new unified model, including hypervisor registration.  An hypervisor registered through virt-who would have content capabilities. (5)
87 5 Justin Sherrill
* As a user, i expect package profile uploading to continue to work under the unified model (2)
88 3 Justin Sherrill
* As a user, i expect client actions (errata install, package install, etc..) to continue to work under the unified model (3)
89 3 Justin Sherrill
* As a user, i expect the subscription and content aspects of hosts to be identified by their host id, not a uuid (3)
90 3 Justin Sherrill
* As a user, i expect to be able to find the uuid of a host with subscriptions within the UI/hammer  (1)
91 3 Justin Sherrill
* As a user, i expect to be able to search hosts by applicable errata (.5)
92 3 Justin Sherrill
* As a user, i expect to be able to search hosts by installed package (.5)
93 1 Justin Sherrill
* As a user, i expect to be able to search hosts by subscription facts (.5)
94 3 Justin Sherrill
* As a user, i expect existing apis (and thus hammer commands and the UI) to continue to work under the new model, if new apis are not added (8)
95 3 Justin Sherrill
96 3 Justin Sherrill
H2. User Stories (P2)
97 3 Justin Sherrill
98 3 Justin Sherrill
* As a user, i expect an api for interacting with content and subscription aspects of hosts (6)
99 5 Justin Sherrill
* As  a developer, the content hosts UI needs to utilize new v2 apis for interacting with the subscription and content aspects of a host (8)
100 3 Justin Sherrill
* As a user, i expect the following hammer commands to be migrated:
101 3 Justin Sherrill
> * hammer content-host errata apply                    -> hammer host content errata apply  (.5)
102 3 Justin Sherrill
> * hammer content-host errata info                       -> hammer host content errata info (.5)
103 3 Justin Sherrill
> * hammer content-host errata list                        -> hammer host content errata list (.5)
104 3 Justin Sherrill
> * hammer content-host package install                -> hammer host content package install (.5)
105 3 Justin Sherrill
> * hammer content-host package remove              -> hammer host content package remove (.5)
106 3 Justin Sherrill
> * hammer content-host package upgrade             -> hammer host content package upgrade (.5)
107 3 Justin Sherrill
> * hammer content-host package upgrade-all         -> hammer host content package upgrade-all (.5)
108 1 Justin Sherrill
> * hammer content-host package-group install       -> hammer host content package-group install (.5)
109 1 Justin Sherrill
> * hammer content-host package-group remove     -> hammer host content package-group remove (.5)
110 1 Justin Sherrill
> * hammer content-host update                             -> hammer host content update  (for updating content view, lifecycle environment) (.5) 
111 1 Justin Sherrill
> * hammer content-host update                             -> hammer host subscription update (for updating service-level, release-version) (.5)
112 1 Justin Sherrill
> * hammer host puppet-classes (.5)
113 3 Justin Sherrill
> * hammer host puppetrun (.5)
114 5 Justin Sherrill
115 5 Justin Sherrill
116 5 Justin Sherrill
H2 User Stories (P3)
117 5 Justin Sherrill
* As a developer, I want to pull in subscriptions and related hosts into the database (7)
118 5 Justin Sherrill
* As a user, I expect to search for hosts by their subscriptions (.5)