Skip to content

Commit

Permalink
Merge pull request ManageIQ#46 from Ladas/providers_database_architec…
Browse files Browse the repository at this point in the history
…ture

Add doc of the providers database architecture
  • Loading branch information
jrafanie committed Dec 16, 2014
2 parents 3ed2d57 + 2cf8995 commit 20bba0e
Show file tree
Hide file tree
Showing 20 changed files with 506 additions and 0 deletions.
2 changes: 2 additions & 0 deletions architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@

## Database Architecture

[Detailed Providers database architecturee](architecture/providers_database_architecture.md)

* Schema Layout
* 64-bit ids
* MiqQueue
Expand Down
74 changes: 74 additions & 0 deletions architecture/providers_database_architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Providers database architecture

All the providers are using the same model of the database on the
background. This documentation describes each model, database
structure with description of each field and ER-Diagram of each
group, to show the relations of the models.

## Inventory Models

When creating new provider, these will be the models that should
be filled with EMS_Refresh.

* Cloud
* [CloudNetwork](providers_database_architecture/cloud_network.md)
* [CloudSubnet](providers_database_architecture/cloud_subnet.md)
* [CloudObjectStoreContainer](providers_database_architecture/cloud_object_store_container.md)
* [CloudObjectStoreObject](providers_database_architecture/cloud_object_store_object.md)
* [CloudResourceQuota](providers_database_architecture/cloud_resource_quota.md) (STI)
* CloudResourceQuotaOpenstack
* [CloudTenant](providers_database_architecture/cloud_tenant.md) (STI)
* CloudTenantOpenstack
* [CloudVolume](providers_database_architecture/cloud_volume.md) (STI)
* CloudVolumeAmazon
* CloudVolumeOpenstack
* [CloudVolumeSnapshot](providers_database_architecture/cloud_volume_snapshot.md) (STI)
* CloudVolumeSnapshotAmazon
* CloudVolumeSnapshotOpenstack
* [VmOrTemplate](providers_database_architecture/vm_or_template.md) (STI)
* Vm
* VmInfra
* VmKvm
* VmMicrosoft
* VmRedhat
* VmVmware
* VmXen
* VmCloud
* VmAmazon
* VmOpenstack
* MiqTemplate
* TemplateInfra
* TemplateKvm
* TemplateMicrosoft
* TemplateRedhat
* TemplateVmware
* TemplateXen
* TemplateCloud
* TemplateAmazon
* TemplateOpenstack
* Orchestration
* [OrchestrationStack](providers_database_architecture/orchestration_stack.md)
* [OrchestrationStackOutput](providers_database_architecture/orchestration_stack_output.md)
* [OrchestrationStackParameter](providers_database_architecture/orchestration_stack_parameter.md)
* [OrchestrationStackResource](providers_database_architecture/orchestration_stack_resource.md)
* [OrchestrationTemplate](providers_database_architecture/orchestration_template.md)
* [Host](providers_database_architecture/host.md) (STI)
* HostKvm
* HostMicrosoft
* HostRedhat
* HostVmware
* HostVmwareEsx
* [AvailabilityZone](providers_database_architecture/availability_zone.md) (STI)
* AvailabilityZoneAmazon
* AvailabilityZoneOpenstack
* AvailabilityZoneOpenstackNull
* [Flavor](providers_database_architecture/flavor.md) (STI)
* FlavorAmazon
* FlavorOpenstack
* [SecurityGroup](providers_database_architecture/security_group.md) (STI)
* SecurityGroupAmazon
* SecurityGroupOpenstack

## Metric Models

## Event Models
15 changes: 15 additions & 0 deletions architecture/providers_database_architecture/availability_zone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# AvailabilityZone model documentation

* Table: availability_zones
* Used in: OpenStack, Amazon
* STI models:
* AvailabilityZoneAmazon
* AvailabilityZoneOpenstack
* AvailabilityZoneOpenstackNull

| Column | Type | Used in | Comment |
| ------- | --------- | ----------------- | ------- |
| ems_id | integer | OpenStack, Amazon | |
| name | string | OpenStack, Amazon | |
| ems_ref | string | OpenStack, Amazon | |
| type | string | OpenStack, Amazon | STI class |
18 changes: 18 additions & 0 deletions architecture/providers_database_architecture/cloud_network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# CloudNetwork model documentation

A network is a virtual isolated layer-2 broadcast domain which is typically reserved to the tenant who created it, unless the network has been explicitly configured to be shared. Tenants can create multiple networks, until they reach the thresholds specified by per-tenant Quotas (see next chapter for more details). The network is the principal entity for the Neutron API. Ports and subnets must always be associated with a network. The following table describes the attributes of network objects. For each attribute, the CRUD column should be read as follows:

* Table: cloud_networks
* Used in: OpenStack

| Column | Type | Used in | Comment |
| ---------------------- | --------- | --------- | ------- |
| name | string | OpenStack | Name of the network |
| ems_ref | string | OpenStack | |
| ems_id | integer | OpenStack | |
| cidr | string | OpenStack | Valid CIDR in the form <network_address>/<prefix> |
| status | string | OpenStack | |
| enabled | boolean | OpenStack | |
| external_facing | boolean | OpenStack | |
| cloud_tenant_id | integer | OpenStack | ForeignKey |
| orchestration_stack_id | integer | OpenStack | ForeignKey |
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# CloudObjectStoreContainer model documentation

Defines a namespace for objects. An object with the same name in two different containers represents two different objects. You can create any number of containers within an account.

In addition to containing objects, you can also use the container to control access to objects by using an access control list (ACL). You cannot store an ACL with individual objects.

In addition, you configure and control many other features, such as object versioning, at the container level

You can bulk-delete up to 10,000 containers in a single request

* Table: cloud_object_store_containers
* Used in: OpenStack

| Column | Type | Used in | Comment |
| --------------- | --------- | --------- | ------- |
| ems_ref | string | OpenStack | |
| key | string | OpenStack | |
| object_count | integer | OpenStack | Number of the all objects inside of the container |
| bytes | integer | OpenStack | Size of the whole container in bytes |
| ems_id | integer | OpenStack | |
| cloud_tenant_id | integer | OpenStack | ForeignKey |
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# CloudObjectStoreObject model documentation

Stores data content, such as documents, images, and so on. You can also store custom metadata with an object.

Store an unlimited number of objects. Each object can be as large as 5 GB, which is the default. You can configure the maximum object size.


* Table: cloud_object_store_objects
* Used in: OpenStack

| Column | Type | Used in | Comment |
| ------------------------------- | --------- | --------- | ------- |
| ems_ref | string | OpenStack | |
| etag | string | OpenStack | For objects smaller than 5 GB, this value is the MD5 checksum of the object content. The value is not quoted. <br> For manifest objects, this value is the MD5 checksum of the concatenated string of MD5 checksums and ETags for each of the segments in the manifest, and not the MD5 checksum of the content that was downloaded. Also the value is enclosed in double-quote characters. <br> You are strongly recommended to compute the MD5 checksum of the response body as it is received and compare this value with the one in the ETag header. If they differ, the content was corrupted, so retry the operation. |
| key | string | OpenStack | |
| content_type | string | OpenStack | The MIME type of the object. |
| content_length | integer | OpenStack | The length of the object content in the response body, in bytes. |
| last_modified | datetime | OpenStack | The date and time that the object was created or the last time that the metadata was changed. |
| ems_id | integer | OpenStack | |
| cloud_tenant_id | integer | OpenStack | ForeignKey |
| cloud_object_store_container_id | integer | OpenStack | ForeignKey |
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# CloudResourceQuota model documentation

To prevent system capacities from being exhausted without notification, you can set up quotas. Quotas are operational limits. For example, the number of gigabytes allowed for each tenant can be controlled so that cloud resources are optimized. Quotas can be enforced at both the tenant (or project) and the tenant-user level.

For OpenStack, list of available quotas can be found here http://docs.openstack.org/user-guide-admin/content/cli_set_quotas.html
Using the command-line interface, you can manage quotas for the OpenStack Compute service, the OpenStack Block Storage service, and the OpenStack Networking service.

* Table: cloud_resource_quotas
* Used in: OpenStack
* STI models: CloudResourceQuotaOpenstack

| Column | Type | Used in | Comment |
| ----------------| --------- | --------- | ------- |
| ems_ref | string | OpenStack | |
| service_name | string | OpenStack | Name of the service (e.g. Compute) |
| name | string | OpenStack | Name of the quota |
| value | integer | OpenStack | Value of the quota |
| type | string | OpenStack | STI class |
| ems_id | integer | OpenStack | |
| cloud_tenant_id | integer | OpenStack | ForeignKey |
| created_at | datetime | OpenStack | |
| updated_at | datetime | OpenStack | |
21 changes: 21 additions & 0 deletions architecture/providers_database_architecture/cloud_subnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# CloudSubnet model documentation

A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances. Each subnet must have a CIDR and must be associated with a network. IPs can be either selected from the whole subnet CIDR, or from "allocation pools" that can be specified by the user.

A subnet can also optionally have a gateway, a list of DNS name servers, and host routes. All this information will then be pushed to instances whose interfaces are associated with the subnet.

* Table: cloud_subnets
* Used in: OpenStack

| Column | Type | Used in | Comment |
| -------------------- | --------- | --------- | ------- |
| name | string | OpenStack | |
| ems_ref | string | OpenStack | |
| ems_id | integer | OpenStack | |
| availability_zone_id | integer | OpenStack | ForeignKey |
| cloud_network_id | integer | OpenStack | ForeignKey |
| cidr | string | OpenStack | Valid CIDR in the form <network_address>/<prefix> |
| status | string | OpenStack | |
| dhcp_enabled | boolean | OpenStack | { true or false } |
| gateway | string | OpenStack | Valid IP address or null |
| network_protocol | string | OpenStack | IP version { ipv4 or ipv6 } |
18 changes: 18 additions & 0 deletions architecture/providers_database_architecture/cloud_tenant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# CloudTenant model documentation

A container used to group or isolate resources and/or identity objects. Depending on the service operator, a tenant can map to a customer, account, organization, or project.

* Table: cloud_tenants
* Used in: OpenStack
* STI models: CloudTenantOpenstack

| Column | Type | Used in | Comment |
| ------------| --------- | --------- | ------- |
| name | string | OpenStack | |
| description | string | OpenStack | |
| enabled | boolean | OpenStack | |
| ems_ref | string | OpenStack | |
| ems_id | integer | OpenStack | |
| created_at | datetime | OpenStack | |
| updated_at | datetime | OpenStack | |
| type | string | OpenStack | STI class |
23 changes: 23 additions & 0 deletions architecture/providers_database_architecture/cloud_volume.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# CloudVolume model documentation

A volume is a detachable block storage device. You can think of it as a USB hard drive. You can attach a volume to one instance at a time.

* Table: cloud_volumes
* Used in: OpenStack, Amazon
* STI models: CloudVolumeAmazon, CloudVolumeOpenstack

| Column | Type | Used in | Comment |
| ------------------------ | --------- | ----------------- | ------- |
| type | string | OpenStack, Amazon | STI class |
| ems_ref | string | OpenStack, Amazon | |
| size | integer | OpenStack, Amazon | The size of the volume, in GBs |
| ems_id | integer | OpenStack, Amazon | |
| availability_zone_id | integer | OpenStack, Amazon | ForeignKey |
| cloud_volume_snapshot_id | integer | OpenStack, Amazon | ForeignKey |
| name | string | OpenStack, Amazon | The volume name |
| status | string | OpenStack, Amazon | Status of the volume |
| description | string | OpenStack, Amazon | The volume description |
| volume_type | string | OpenStack, Amazon | The associated volume type |
| bootable | boolean | OpenStack, Amazon | Enables or disables the bootable attribute. You can boot an instance from a bootable volume. |
| creation_time | datetime | OpenStack, Amazon | Date and time when the volume was created |
| cloud_tenant_id | integer | OpenStack, Amazon | ForeignKey |
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# CloudVolumeSnapshot model documentation

A snapshot is a point in time copy of the data that a volume contains.

* Table: cloud_volume_snapshots
* Used in: OpenStack, Amazon
* STI models: CloudVolumeSnapshotAmazon, CloudVolumeSnapshotOpenstack

| Column | Type | Used in | Comment |
| --------------- | --------- | ----------------- | ------- |
| type | string | OpenStack, Amazon | STI class |
| ems_ref | string | OpenStack, Amazon | |
| ems_id | integer | OpenStack, Amazon | |
| cloud_volume_id | integer | OpenStack, Amazon | ForeignKey |
| name | string | OpenStack, Amazon | Name of the snapshot. Default==None. |
| description | string | OpenStack, Amazon | Description of snapshot. Default==None. |
| status | string | OpenStack, Amazon | Snapshot status |
| creation_time | datetime | OpenStack, Amazon | Date and time when the snapshot was created |
| size | integer | OpenStack, Amazon | The size of the volume, in GBs. |
| cloud_tenant_id | integer | OpenStack, Amazon | ForeignKey |
24 changes: 24 additions & 0 deletions architecture/providers_database_architecture/flavor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Flavor model documentation

List available flavors and get details for a specified flavor. A flavor is a hardware configuration for a server. Each flavor is a unique combination of disk space and memory capacity.

* Table: flavors
* Used in: OpenStack, Amazon
* STI models: FlavorAmazon FlavorOpenstack

| Column | Type | Used in | Comment |
| ------------------------ | --------- | ----------------- | ------- |
| ems_id | integer | OpenStack, Amazon | |
| name | string | OpenStack, Amazon | Name of the new flavor |
| description | string | OpenStack, Amazon | Description of the flavor |
| cpus | integer | OpenStack, Amazon | Number of vcpus |
| cpu_cores | integer | Amazon | |
| memory | integer | OpenStack, Amazon | Memory size in MB |
| ems_ref | string | OpenStack, Amazon | |
| type | string | OpenStack, Amazon | STI class |
| supports_32_bit | boolean | Amazon | |
| supports_64_bit | boolean | Amazon | |
| enabled | boolean | OpenStack, Amazon | |
| supports_hvm | boolean | Amazon | |
| supports_paravirtual | boolean | Amazon | |
| block_storage_based_only | boolean | Amazon | |
44 changes: 44 additions & 0 deletions architecture/providers_database_architecture/host.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Host model documentation

* Table: hosts
* Used in: Kvm, Microsoft, Redhat, Vmware
* STI models:
* HostKvm
* HostMicrosoft
* HostRedhat
* HostVmware
* HostVmwareEsx

| Column | Type | Used in | Comment |
| ----------------------- | --------- | ----------------- | ------- |
| name | string | | |
| hostname | string | | |
| ipaddress | string | | |
| vmm_vendor | string | | |
| vmm_version | string | | |
| vmm_product | string | | |
| vmm_buildnumber | string | | |
| created_on | datetime | | |
| updated_on | datetime | | |
| guid | string | | |
| ems_id | integer | | |
| user_assigned_os | string | | |
| power_state | string | | |
| smart | integer | | |
| settings | string | | |
| last_perf_capture_on | datetime | | |
| uid_ems | string | | |
| connection_state | string | | |
| ssh_permit_root_login | string | | |
| ems_ref_obj | string | | |
| admin_disabled | boolean | | |
| service_tag | string | | |
| asset_tag | string | | |
| ipmi_address | string | | |
| mac_address | string | | |
| type | string | | STI class |
| failover | boolean | | |
| ems_ref | string | | |
| hyperthreading | boolean | | |
| ems_cluster_id | integer | | ForeignKey |
| next_available_vnc_port | integer | | |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# OrchestrationStack model documentation

* Table: orchestration_stacks
* Used in: OpenStack

| Column | Type | Used in | Comment |
| ------------------------- | --------- | ----------------- | ------- |
| name | string | OpenStack | The name of the stack |
| type | string | OpenStack | STI class |
| description | text | OpenStack | The description of the stack |
| status | string | OpenStack | Status of the stack |
| ems_ref | string | OpenStack | |
| ancestry | string | OpenStack | |
| ems_id | integer | OpenStack | |
| orchestration_template_id | integer | OpenStack | ForeignKey |
| created_at | datetime | OpenStack | |
| updated_at | datetime | OpenStack | |
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# OrchestrationStackOutput model documentation

* Table: orchestration_stack_outputs
* Used in: OpenStack

| Column | Type | Used in | Comment |
| ------------ | --------- | ----------------- | ------- |
| key | string | OpenStack | The key of the output |
| value | text | OpenStack | The value of the output |
| description | text | OpenStack | The description of the output |
| stack_id | integer | OpenStack | ForeignKey |
Loading

0 comments on commit 20bba0e

Please sign in to comment.