Redfish provider is installed by default when seting up ManageIQ development
environment. To start using it, navigate to the Compute
->
Physical Infrastructure
-> Providers
and add new provider of type Redfish.
See the ManageIQ Developer Setup guide for help on installing
prerequistes for ManageIQ development. In this section, we will assume that
ManageIQ core repo resides in ~/miq/manageiq
, so adjust path accordingly.
Now, to start working on Redfish provider, we must first clone the repo:
$ cd ~/miq
$ git clone [email protected]:ManageIQ/manageiq-providers-redfish.git
$ cd manageiq-providers-redfish
After this is done, we must perform the initial setup by running
$ bin/setup
After the initial setup is done, we can test the environment by executing
$ bundle exec rake
This command should run test suite and return with no error. If this is not
the case, congratulations to us, since we can start debugging our setup;) If
everything is green, we are ready start adding bugs features to the
Redfish provider.
To be able to view and test the changes we are making to the provider, we must
override the gem sources in ~/miq/manageiq/bundler.d/overrides.rb
. In our
case, overrides.rb
should look something like this:
override_gem "manageiq-providers-redfish",
:path => File.expand_path("~/miq/manageiq-providers-redfish")
Do not use relative path in File.expand_path
call, since this is just
calling for troubles. To actually install the local gems, run
$ ( cd ../manageiq && bin/update )
Now ManageIQ will use the local manageiq-providers-redfish repository instead of fetching from GitHub. This will allow you to test changes and debug before your changes have been merged.
But it will not take long for us to get into situation where we will need to
modify some other parts of the ManageIQ in order to get new feature in. In
order to be able to run automated test suite in such situations, we need to
remove ~/miq/manageiq-providers-redfish/spec/manageiq
folder and replace it
with symbolic link to ~/miq/manageiq
. To get things updated, we need to run
$ bin/update
Last thing we need in order to be able to develop Redfish provider is mock Redfish server. And fortunately for us, it has been already installed as a part of an initial setup. We just need to get our hands on some recordings and we are good to go.
One recording is available in XLAB's repo. We can clone it and instruct mock server to serve it:
$ ( cd ~/miq && git clone https://github.com/xlab-si/redfish-recordings )
$ bundle exec redfish serve ../redfish-recordings/lenovo-sr650
- remove
spec/manageiq
and replace it with a symlink to ~/miq/manageiq - checkout proper branch in ~/miq/manageiq
- bin/update in ~/miq/manageiq
- bundle exec rake
- edit ~/miq/manageiq/bundler.d/overrides.rb
- bin/update
- MIQ_SPARTAN=minimal:ems_inventory bundle exec rake evm:start
- go to localhost:3000 (admin/smartvm)
The gem is available as open source under the terms of the Apache License 2.0.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git add ...
andgit commit
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request