-
Notifications
You must be signed in to change notification settings - Fork 27
Conductor and new Imagefactory setup
- Upgrade to Imagefactory v2: https://github.com/aeolus-incubator/tim/wiki/setup_factory
(The
imagefactory-secondary
package is not needed; you can skip it.) - Run newly added db migrations with
rake db:migrate
- To build a real image, you have to run imagefactory on bare metal (unless your VM supports nested virtualization).
- Update the
:imagefactory
section inconfig/settings.yml
to including the callbacks, like so:
:imagefactory:
:url: http://localhost:8075/imagefactory
:callback_urls:
:target_image: http://admin:password@localhost:3000/tim/target_images/
:provider_image: http://admin:password@localhost:3000/tim/provider_images/
# uncomment provider types for which you want to use snapshot build mode,
:snapshot_provider_types:
- ec2
# - mock
# - openstack
Note that you can embed credentials in the :target_image
and :provider_image
attributes, which Factory will use to authenticate when making callbacks to Conductor. (As you may imagine, this is not an ideal situation, and these credentials should be moved over to use OAuth in the future.)
- Now you can try to build and upload an image. Some example templates are here: https://github.com/aeolus-incubator/templates
For building only mock images it's sufficient to run imagefactory inside VM. Example of mock template (important is having RHELMock or FedoraMock in os/name):
<template>
<name>mock</name>
<os>
<name>RHELMock</name>
<version>1</version>
<arch>x86_64</arch>
<install type="iso">
<iso>http://mockhost/RHELMock1-x86_64-DVD.iso</iso>
</install>
<rootpw>password</rootpw>
</os>
<description>Mock Template</description>
</template>
For building rhevm images some additional params are required to be set (as we did before) in /etc/imagefactory/rhevm.json, e.g.:
{
"rhevm":
{
"nfs-dir": "/mnt/rhevm-nfs",
"nfs-path": "/home/exports",
"nfs-host": "10.0.0.1",
"api-url": "https://10.0.0.1/api",
"cluster": "_any_"
}
}
For building rhevm images some additional params are required to be set (as we did before) in /etc/imagefactory/vsphere.json, example:
{
"vsphere":
{
"api-url": "10.0.0.1",
"network_name": "VM Network",
"datastore": "datastore1",
"username": "Administrator",
"password": "password",
"compute_resource": "compute_resource"
}
}
It's sometimes tricky to find out proper compute resource name, you can use Ian's script which is located here and run it with ip, username and password params:
$ python walk_vsphere_objects.py 10.0.0.1 Administrator password
Imagefactory uses interanlly psphere lib for talking to vsphere provider, this library requires existence of ~/.psphere/config.yaml file with content like this:
general:
template_dir: ~/.psphere/templates/
New imagefactory doesn't read files /etc/imagefactory(rhevm|vsphere).json itself as before but requires these parameters in build/push requests. More suitable location for these files would be nice: https://github.com/aeolusproject/conductor/issues/328