-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #25584 - Improve help for compute resources #427
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ofedoren !
It looks like there's two commits here, one of them is "Host creation with multi SCSI controllers" that was already merged, could you remove it and rebase?
feedd19
to
a2f1665
Compare
@shiramax, rebased. |
thanks @ofedoren |
@@ -6,7 +6,7 @@ def name | |||
end | |||
|
|||
def compute_attributes | |||
%w[flavor_ref image_ref tenant_id security_groups network] | |||
%w[availability_zone boot_from_volume flavor_ref image_ref tenant_id scheduler_hint_filter security_groups network] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -6,7 +6,7 @@ def name | |||
end | |||
|
|||
def compute_attributes | |||
%w[machine_type image_id network external_ip] | |||
%w[associate_external_ip image_id machine_type network user_data] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -6,7 +6,7 @@ def name | |||
end | |||
|
|||
def compute_attributes | |||
%w[flavor_id image_id availability_zone security_group_ids managed_ip] | |||
%w[availability_zone flavor_id groups image_id security_group_ids managed_ip] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we find the description for each attribute?
['memory', _('Amount of memory, integer value in bytes')] | ||
['sockets', _('Integer value, number of sockets')], | ||
['memory', _('Amount of memory, integer value in bytes')], | ||
['image_id'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_id is a general attribute, shouldn't be here.
['sockets', _('Integer value, number of sockets')], | ||
['memory', _('Amount of memory, integer value in bytes')], | ||
['image_id'], | ||
['user_data', _('Comment')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that's spouse to be here... how did you find it?
redirecting to @lzap - can you please confirm that for OpenStack? I guess it would need to be at https://github.com/fog/fog-openstack/blob/master/lib/fog/openstack/compute/models/server.rb but I don't see boot_from_volume and scheduler_hint_filter but if @lzap has some openstack instnace, it's easier to test on existing vm |
@@ -6,7 +6,7 @@ def name | |||
end | |||
|
|||
def compute_attributes | |||
%w[machine_type image_id network external_ip] | |||
%w[associate_external_ip image_id machine_type network user_data] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ofedoren for updating attributes here.
Here, user_data
attribute is not required as while creating an image, user can have this attribute.
['memory_mb', _('Integer number, amount of memory in MB')], | ||
['cpus', _('CPU count'), { bold: true }], | ||
['corespersocket', _('Number of cores per socket (applicable to hardware versions < 10 only)'), { bold: true }], | ||
['memory_mb', _('Integer number, amount of memory in MB'), { bold: true }], | ||
['firmware', 'automatic/bios/efi'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we put the firmware
after the required attributes? Now it feels bit weird to be here.
Or sort it alphabeticaly, but now it feels bit messy ordered :)
Could we somehow add a default values for the not required attributes, which have defaults? I do not insist doing it in this PR, though. |
@shiramax, @kgaikwad, @ezr-ondrej, thanks! The required attributes are highlighted in bold in the help (the note at the beggining of the But I agree that putting the required attributes at the top of the list is a good idea. :) @ezr-ondrej, yes, I guess we can add a default values for the not required attributes, but I assume it is done on the server side by |
Yeah it is, but there is no way for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am giving the credentials to the RHOS I test with, all employees can use it. |
a2f1665
to
7c0e153
Compare
@shiramax, updated. |
] | ||
end | ||
|
||
def interface_attributes | ||
[ | ||
['type', _('Possible values: %s') % 'bridge, network'], | ||
['bridge', _('Name of interface according to type')], | ||
['model', _('Possible values: %s') % 'virtio, rtl8139, ne2k_pci, pcnet, e1000'] | ||
['model', _('Possible values: %s') % 'virtio, rtl8139, ne2k_pci, pcnet, e1000'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shiramax, it is, when you're creating a host via libvirt and go Interfaces -> New/Edit -> Select Type
.
Also, see https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/libvirt.rb#L224-L228. I guess the API does support it.
On August 14, 2019 16:26:58 Shira Maximov ***@***.***> wrote:
shiramax requested changes on this pull request.
> ]
end
def interface_attributes
[
['type', _('Possible values: %s') % 'bridge, network'],
['bridge', _('Name of interface according to type')],
- ['model', _('Possible values: %s') % 'virtio, rtl8139,
ne2k_pci, pcnet, e1000']
+ ['model', _('Possible values: %s') % 'virtio, rtl8139,
ne2k_pci, pcnet, e1000'],
In libevirt we have these three options:
![image](https://user-images.githubusercontent.com/5609929/63028921-5290ec00-beb8-11e9-84ef-dea25cba35ae.png)
i'm not sure about the bridge, do you know why it's not in the UI is well?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#427 (review)
I suppose the bridge in UI only shows if you change network type. In
API/hammer we can't hide fields that depends on other fields values.
…--
Marek
|
hardware_version Hardware version ID from VMware | ||
add_cdrom Must be a 1 or 0, Add a CD-ROM drive to the virtual machine | ||
cpuHotAddEnabled Must be a 1 or 0, lets you add memory resources while the machine is on | ||
memoryHotAddEnabled Must be a 1 or 0, lets you add CPU resources while the machine is on | ||
start Must be a 1 or 0, whether to start the machine or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove start from here? it should still be here in when creating a host.
@@ -195,26 +194,29 @@ Available keys for `--compute-attributes`: | |||
``` | |||
cpus # number of CPUs | |||
memory # string, amount of memory, value in bytes | |||
start # Must be a 1 or 0, whether to start the machine or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove start from here? it should still be here in when creating a host.
7c0e153
to
ccd5eea
Compare
@shiramax, thanks! Updated. Also, just reminding that theforeman/hammer-cli#309 is required to be merged first. Althought tests are passing, there can be a runtime error. |
ccd5eea
to
aff7531
Compare
@ofedoren can you please rebase? |
aff7531
to
6426eeb
Compare
@shiramax, rebased. |
doc/host_create.md
Outdated
compute_model # one of [virtio, rtl8139, ne2k_pci, pcnet, e1000] | ||
type # one of [bridge, network] | ||
network / bridge # name of interface according to type | ||
model # one of [virtio, rtl8139, ne2k_pci, pcnet, e1000] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after the rebase, all the --interface attributes, it should stay with "compute_" prefix.
doc/host_create.md
Outdated
compute_network # select one of available networks for a cluster | ||
name # eg. eth0 | ||
network # select one of available networks for a cluster | ||
interface # interface type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after the rebase, all the --interface attributes, it should stay with "compute_" prefix.
6426eeb
to
0ad0bd1
Compare
@shiramax, updated. Thanks, I forgot to change those as well :( |
Apologize for late post. Am I missing anything here? Is there any foreman PR which handles this? |
@kgaikwad, apologize for late reply.. Thanks for tracking that though :) In
But in @shiramax, @kgaikwad what do you think will be better resolution
|
There was no separate option in the compute profile to set an image. And with removal of As @shiramax, what do you think? |
@kgaikwad image should not be inside compute profile at all. |
@shiramax, Could you please confirm if there is any recent change into compute profile form? Edit - User sets OS & architecture at image creation level and compute profile form has only image field on UI. |
@shiramax, |
@kgaikwad exactly, |
As mentioned web UI is inconsistent with what we are saying. My concerns are as follows:
We will need to either consider redesigning those web UI pages or provide an option which will allow user to configure an image. |
@kgaikwad |
The issue actually is about showing unclear errors, but since the error (e.g. mentioned in the issue) comes from the server, I'd say it is a server side issue.
What I'm proposing is to improve help section for CR in host creation help. Particularly to emphasize which attributes are required (e.g.
path
mentioned in the issue). Unfortunatelly I've got no environment (except libvirt and a dummy created from VMware) to test which attributes are really required. The chages are based on UI and CR models (basically ondefault_vm_attributes
/new_vm
/create_vm
, etc)Requires theforeman/hammer-cli#309 to be merged first. Also this PR is built above #424, since there are chages which will lead to merge conflicts.