This package contains the Fabrics app and provides Django-style models, views and tasks for launching and configuring Computes complete with networks and block storage.
This package contains Django-style models that allows to set up the fabric of your Kamaji environment.
fabric.models.models_credentials.
Credential
(*args, **kwargs)¶Bases: django.db.models.base.Model
Stores a username and password or token tied to a service. The items in the SERVICES tuple must match the services added in the install process.
Parameters: |
|
---|
fabric.models.models_credentials.
SSHKey
(*args, **kwargs)¶Bases: django.db.models.base.Model
Stores an SSH key tied to a service.
Parameters: |
|
---|
fabric.models.models_hosts.
Host
(*args, **kwargs)¶Bases: shared.models.KamajiModel
Stores a Controller host indexed by type and optionally an index. Hosts are tied to the controller specified by the index field if it is specified and it exists. Some hosts such as the loadbalancer stored with type:’vip’ has only one possible value and so needs no index.
Example:
vip_host = Host.objects.get(type='vip')
secondary_controller_nameserver_host = Host.objects.get(type='ns', index=1)
Parameters: |
|
---|
fabric.models.models_nodes.
Compute
(*args, **kwargs)¶Bases: shared.openstack2.models.OSModel
Stores information about a hypervisor in OpenStack.
Parameters: |
|
---|
fabric.models.models_nodes.
Controller
(*args, **kwargs)¶Bases: shared.models.KamajiModel
Stores information about controller nodes. The brain of your openstack cluster. it contains all central OpenStack components such as databases, openstack controller software (keystone, nova etc).
Parameters: |
|
---|
fabric.models.models_nodes.
ControllerHostMapping
(*args, **kwargs)¶Bases: django.db.models.base.Model
This model maps a number of fabric.models.models_hosts.Host
to a Controller
.
Parameters: |
|
---|
fabric.models.models_nodes.
HardwareInventory
(*args, **kwargs)¶Bases: django.db.models.base.Model
Stores the hardware inventory of a node in JSON format.
Parameters: |
|
---|
fabric.models.models_nodes.
Node
(*args, **kwargs)¶Bases: django.db.models.base.Model
Stores a node that can be configured as a compute.
Parameters: |
|
---|
hostname
¶Returns: | The hostname by combining “node” and this nodes index padded to two digits. |
---|
fabric.models.models_nodes.
Zone
(*args, **kwargs)¶Bases: shared.openstack2.models.OSModel
Represents a Kamaji Zone (i.e. failure domain) mapped to an os-aggregate in OpenStack.
Parameters: |
|
---|
fabric.models.models_nodes.
ZoneComputesMapping
(*args, **kwargs)¶Bases: shared.models.KamajiModel
A mapping of a Zone
to a Compute
.
Parameters: |
|
---|
fabric.models.models_physicalnetworks.
PhysicalNetwork
(*args, **kwargs)¶Bases: shared.models.KamajiModel
There are two different types of physical networks in Kamaji, one for
Compute
and one for Controller
.
Starting a Node
on a compute network will allow it to be configured
as a Compute
.
Parameters: |
|
---|
get_range
(subnet, prefix, gateway)¶Get the first and last valid address in the IP range that does not conflict with the gateway.
netmask
¶The netmask of the network, represented as a string.
validate
()¶Validates that the values for the ip range and gateway are sane. If no range is specified we define our own.
fabric.models.models_settings.
NTPSetting
(*args, **kwargs)¶Bases: django.db.models.base.Model
Configures NTP servers in Kamaji.
Parameters: |
|
---|
fabric.models.models_settings.
Setting
(*args, **kwargs)¶Bases: django.db.models.base.Model
A global setting i Kamaji.
Parameters: |
|
---|
fabric.models.models_storage.
CEPHCluster
(*args, **kwargs)¶Bases: fabric.models.models_storage.StorageTarget
Represents a connection to a CEPH cluster that are used for image storage.
Parameters: |
|
---|
connect
()¶Create a connection to the storage backend using the data in the instance.
test_connection
()¶Tests the connection to the ceph cluster.
fabric.models.models_storage.
CEPHClusterPool
(*args, **kwargs)¶Bases: django.db.models.base.Model
Represents a CEPH cluster pool.
Parameters: |
|
---|
fabric.models.models_storage.
StorageTarget
(*args, **kwargs)¶Bases: django.db.models.base.Model
Base class for any Storage class.
fabric.models.models_storage.
generate_uuid
()¶Generate a random UUID. :return: Randomly generated UUID :rtype: string
fabric.views.
CEPHClusterAction
(**kwargs)¶Bases: shared.views.ActionView
, shared.views.LookupMixin
Provides the possibility to connect and test configured CEPH cluster. Connecting a cluster is performed by posting an JSON object on the form {‘action’: ‘connect’}. Testing a cluster is performed by posting an JSON object on the form {‘action’: ‘test’}.
connect
(request, *args, **kwargs)¶Setup the connection to the cluster.
test
(request, *args, **kwargs)¶Test the connection to the cluster.
fabric.views.
CEPHClusterList
(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List existing or create a new connection to a CEPH storage cluster.
serializer_class
¶alias of CEPHClusterSerializer
fabric.views.
CEPHClusterSingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Delete, update or show info about the CEPH cluster connection.
serializer_class
¶alias of CEPHClusterSerializer
fabric.views.
ComputeList
(**kwargs)¶Bases: rest_framework.generics.ListAPIView
List all existing compute nodes.
fabric.views.
ComputeSingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateAPIView
Retrieve or update a specific compute node.
fabric.views.
ControllerList
(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List or create controllers.
fabric.views.
ControllerSingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Retrieve or delete a specific controller.
fabric.views.
ExternalStorageMenu
(**kwargs)¶Bases: rest_framework.views.APIView
List available endpoints under external_storage
fabric.views.
FabricLinksList
(**kwargs)¶Bases: rest_framework.views.APIView
Available endpoints under Fabric
fabric.views.
NTPAction
(**kwargs)¶Bases: shared.views.ActionView
Allows testing the configured NTP servers. The test is performed by posting an JSON object on the form {‘action’: ‘test’}
test
(request, *args, **kwargs)¶Execute a connection test to the listed NTP servers in Kamaji settings and update their status.
fabric.views.
NodeList
(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List and create Nodes.
Called when a compute nodes has booted up.
Note
Changes in unregistered node IP’s are handled.
fabric.views.
NodeSingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateAPIView
Lookup or update a specific Node.
fabric.views.
PhysicalNetworkList
(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
Create or list compute networks.
serializer_class
¶alias of PhysicalNetworkSerializer
fabric.views.
PhysicalNetworkSingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Retrieve, update or remove a compute network.
serializer_class
¶alias of PhysicalNetworkSerializer
fabric.views.
PublicKeySingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveAPIView
Retrieve public key used in Kamaji.
fabric.views.
SMTPRelayAction
(**kwargs)¶Bases: shared.views.ActionView
Allows testing the configured SMTP settings. The test is performed by posting an JSON object on the form {‘action’: ‘test’, ‘recipient’: ‘your@mail.com’}
test
(request, *args, **kwargs)¶Test sending an email to verify that SMTP settings are correctly configured
fabric.views.
SettingSingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateAPIView
Retrieve or update a specific setting in Kamaji.
fabric.views.
SettingsList
(**kwargs)¶Bases: rest_framework.views.APIView
List links to all available settings in Kamaji.
Bases: rest_framework.generics.ListCreateAPIView
List the existing pools or create a new pool for the configured CEPH cluster.
alias of CEPHClusterPoolSerializer
Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Allow retrieval, updates and removal of shares
Bases: rest_framework.generics.ListCreateAPIView
List and create storage shares
fabric.views.
StorageTargetList
(**kwargs)¶Bases: rest_framework.views.APIView
Fetch all storage targets, serialize them and present them in the same endpoint.
fabric.views.
StorageTargetRedirect
(**kwargs)¶Bases: rest_framework.generics.RetrieveAPIView
Perform a redirect from the targets endpoint to the appropriate storage backend endpoint: /target/<name> -> /<backend>/<name>/
fabric.views.
ZoneList
(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List or create new zones in the Kamaji cloud.
fabric.views.
ZoneSingle
(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Retrieve, update or remove an existing zone in the Kamaji cloud.
fabric.tasks.
ConfigureCephTask
¶Bases: shared.ansible_tasks.AnsiblePlaybookTask
Celery task to configure OpenStack to use CEPH as storage backend
on_failure
(exc, task_id, args, kwargs, einfo)¶Update the CEPHCluster object if the Celery task fails.
Parameters: | args – The CEPHCluster object that is being manipulated on |
---|---|
Returns: | None |
on_success
(retval, task_id, args, kwargs)¶Update the CEPHCluster object if the Celery task succeed.
Parameters: | args – The CEPHCluster object that is being manipulated on |
---|---|
Returns: | None |
run
(ceph_cluster)¶Parameters: | ceph_cluster (fabric.models.CEPHCluster) – The CEPHCluster object to configure. |
---|
fabric.tasks.
ConfigureComputeTask
¶Bases: shared.ansible_tasks.AnsiblePlaybookTask
Celery task to configure OpenStack on computes with Ansible.
on_failure
(exc, task_id, args, kwargs, einfo)¶In case the Compute configuration fails, set the node status to failed.
on_success
(retval, task_id, args, kwargs)¶In case the Compute configuration is successful, set the node status to created.
fabric.tasks.
ConfigureDHCPTask
¶Bases: shared.ansible_tasks.AnsiblePlaybookTask
Celery task to configure dhcp servers with Ansible.
run
(compute_network)¶Parameters: | compute_network (fabric.models.ComputeNetwork) – The compute network to configure the dhcp with. |
---|
fabric.tasks.
ConfigureNTPServersTask
¶Bases: shared.ansible_tasks.AnsiblePlaybookTask
Task to configure NTP on computes, service nodes and instances.
run
(ntp_instance)¶Configure all Computes, ServiceNodes and Instances with the specified NTP servers. :param ntp: NTP setting object containing info about ntp. :type ntp: NTPSetting :param ntp_servers: The ntp servers to apply described as a list of strings. :type ntp_servers: list :param args: :param kwargs: :return:
fabric.tasks.
DeployInstanceTask
¶Bases: shared.ansible_tasks.AnsiblePlaybookTask
Task to create instance(s) in OpenStack with help of Kamaji API.
run
(group_id=None, instance=None, instance_data=None, instances_to_create=None)¶Parameters: | |
---|---|
Returns: | The public ip address of the instance and a service object |
Return type: | Tuple |
fabric.tasks.
UpdateHardwareInventoryTask
¶Bases: shared.ansible_tasks.AnsibleRunnerTask
Celery task to gather hardware inventory data from servers and update add it to a separate table in the database and updates the calling models one-to-one relation.
on_success
(retval, task_id, (server), kwargs)¶Create a new HardwareInventory record and update the calling object with the relation to the record
fabric.tasks.
UploadImageDataFromUrlTask
¶Bases: celery.app.task.Task
Task to download an image file and PUT it to the OpenStack image service.
run
(image_id, image_class, *args, **kwargs)¶Prepare the image file data.
Should be called like: delay(image.id, Image)
Parameters: |
|
---|