OpenStack Study notes one __openstack

Source: Internet
Author: User
Tags sqlite database
I. Summary of the OpenStack

OpenStack is both a community, a project and an Open-source software that provides an operational platform or toolset for deploying the cloud. Its purpose is to help the organization run a cloud of virtual computing or storage services, providing scalable, flexible cloud computing for public, private, and selector, small clouds.
1. The following are 5 important components

The nova--Computing Service swift--Storage Service glance--mirroring service keystone--Authentication Service Horizon--ui service OpenStack Compute (Nova) is a set of controllers that are used to start virtual machine instances for individual users or for use with groups. It can also be used to set up a network for a specific project that contains multiple instances
OpenStack Object Storage (Swift) is a set of systems for implementing object storage through built-in redundancy and fault-tolerant mechanisms in large-scale scalable systems. These objects can be recovered through a rest API or a client that can butt object storage APIs like Cyberduck OpenStack Mirroring Service (glance) is a set of virtual machine image lookup and retrieval system

Unlike Amazon's elastic block Storage (EBS), OpenStack Nova uses the Nova-volume service to manage storage, and Nova-volume provides an ISCSI solution based on Linux LVM Summary programme










two. Swift (virtual machine image store mail storage archive backup)http://www.programmer.com.cn/12403/
Swift has three main components: Proxy server, Storage server, and consistency server
Where storage and consistency services are allowed on storage node. The AUTH certification service has now been stripped out of swift, using OpenStack certification services Keystone to achieve a unified OpenStack certification management between the various projects.



Proxy Server
Servers are server processes that provide the Swift API and are responsible for the communication between the rest of the swift components. For each client request, it queries the location of account, container, or object in the ring and forwards the request accordingly. Proxy provides the Rest-full API and conforms to the standard HTTP protocol specification, which enables developers to quickly build custom client and Swift interactionsStorage Server

The Storage server provides storage services on a disk device. There are three types of storage servers in Swift: Account, container, and object. Where the container server handles the list of objects, the container server does not know where the object is stored, only what object is stored in the specified container. These object information is stored in the form of a SQLite database file. The container server also does some tracking statistics, such as the total number of object, the use of container
Consistency Servers

storing data on disk and providing an external rest-ful API is not a difficult problem, and the main problem is fault handling. The purpose of Swift's consistency servers is to find and resolve errors caused by data corruption and hardware failure. There are mainly three server:auditor, updater and replicator. Auditor runs a continuous scan of the disk in the background of each swift server to detect the integrity of objects, container, and accounts. If a data corruption is found, auditor moves the file to the quarantine area, where the replicator is responsible for replacing the data with a healthy copy. Figure 2 shows the process flow diagram for the quarantined object. In the event of high system load or failure, the data in the container or account will not be updated immediately. If the update fails, the update is queued on the local file system, and Updaters continues to handle these failed updates, where account updater and container Updater are responsible for the update of both the both the and object lists. The function of replicator is to handle the correct location of the data and maintain a reasonable copy of the data, designed to keep the system consistent while the SWIFT server is facing temporary failure situations such as network outages or drive failures.

1.swift Source Analysis-service startup
Swift-init main start performs swift initialization (BIN/SWIFT-INIT)
commands = Dict (Manager.list_commands ()). Keys () Get all publicly accessible commands
Manager = Manager (servers, Run_dir=options.run_dir) Manager manages the classes for each server to perform operations

commands = [' status ', ' Start ', ' force-reload ', ' Stop ', ' no-wait ', ' No-daemon ', ' reload ', ' shutdown ', ' restart ', ' once ']

Servers = [' Swift-init ', ' main ']
Server_names = [' Proxy-server ', ' account-server ', ' container-server ', ' object-server '], which is the name of Swift four services
For name in Server_names:
Self.servers.add (Server (name, Run_dir))

Command = Start

Options = {' Run_dir ': '/var/run/swift ', ' daemon ': True, ' verbose ': false, ' number ': 0, ' kill_wait ': ' Graceful ': false, ' Wait ': True, ' once ': False ' status = Manager.run_command (command, **options. __dict__)

In this method, the service specified by servers will be started, i.e. servers = [' Proxy-server ', ' account-server ', ' container-server ', ' object-server '];
def start (self, **kwargs)
For server in Self.servers:server.launch (**kwargs)


I. Nove Scheduler

1.request_spce

{u ' num_instances ': 1, U ' block_device_mapping ': [{u ' instance_uuid ': U ' c99560fa-6580-4b5f-a94e-28e81db75d Bayi ', U ' guest_format ': None, U ' boot_index ': 0, U ' delete_on_termination ': True, U ' no 
         _device ': None, U ' connection_info ': None, U ' snapshot_id ': None, U ' device_name ': none,  
         U ' disk_bus ': None, U ' image_id ': U ' a0247584-9a5e-4d43-861a-e4a78f708d3b ', U ' source_type ': U ' image ', U ' device_type ': U ' disk ', U ' volume_id ': None, U ' destination_type ': U ' local ', U ' vol. 
         Ume_size ': None}], u ' image ': {u ' status ': U ' active ', U ' name ': U ' f17-x86_64-cfntools ', 
         U ' deleted ': False, U ' container_format ': U ' bare ', U ' created_at ': U ' 2014-08-19t07:03:32.000000 ', U ' disk_format ': U ' qcow2 ', U ' updated_at ': U ' 2014-08-19t07:05:38.000000 ', U ' id ': U ' a0247584-9a5e- 4d43-861a-e4a78f708d3b ', 
         U ' owner ': U ' eca87d47c0fe4a05bc4d24802658fa10 ', U ' Min_ram ': 0, U ' checksum ': U ' afab0f79bac770 D61d24b4d0560b5f70 ', U ' min_disk ': 0, U ' is_public ': True, U ' deleted_at ': None, U ' pr Operties ': {}, U ' size ': 476704768}, U ' instance_type ': {u ' ROOT_GB ': 4, U ' name ': U ' M1.small ', U ' EPHEMERAL_GB ': 0, U ' memory_mb ': 2048, U ' Vcpus ': 1, U ' extra_specs ': 
         {}, U ' swap ': 0, U ' rxtx_factor ': 1.0, U ' flavorid ': U ' c75e2199-b09e-4e9e-9997-bd6d6676541d ', U ' vcpu_weight ': None, U ' ID ': ten}, U ' instance_properties ': {u ' vm_state ': U ' building ' , u ' availability_zone ': U ' Nova ', U ' terminated_at ': None, U ' EPHEMERAL_GB ': 0, U ' ins tance_type_id ': Ten, U ' user_data ': none, U ' cleaned ': False, U ' vm_mode ': None, U ' del 
       Eted_at ': None,  U ' reservation_id ': U ' r-a58urz33 ', U ' id ': 576, U ' security_groups ': [], U ' disable_terminate ' : False, U ' display_name ': U ' CCCC ', U ' uuid ': U ' c99560fa-6580-4b5f-a94e-28e81db75d81 ', U ' defau Lt_swap_device ': None, U ' info_cache ': {u ' instance_uuid ': U ' c99560fa-6580-4b5f-a94e-28e81db75 
                D81 ', U ' deleted ': False, U ' created_at ': U ' 2014-08-22t03:47:00.000000 ', U ' updated_at ': None, U ' network_info ': [], U ' deleted_at ': none}, U ' Hostname ': U ' cccc ', U ' launched_on ': None, U ' display_description ': U ' cccc ', U ' key_data ': none , u ' kernel_id ': U ', U ' power_state ': 0, U ' default_ephemeral_device ': None, U ' progr ESS ': 0, U ' project_id ': U ' eca87d47c0fe4a05bc4d24802658fa10 ', U ' launched_at ': None, U ' schedul 
         Ed_at ': None,U ' node ': none, U ' ramdisk_id ': U ', U ' access_ip_v6 ': None, U ' access_ip_v4 ': None, U ' Deleted ': False, U ' key_name ': None, U ' updated_at ': None, U ' host ': None, U ' Ephemer Al_key_uuid ': None, U ' architecture ': none, U ' user_id ': U ' 7ae57473c4de4bfa84015a2e73f7182b ', u 
               ' System_metadata ': {u ' image_min_disk ': U ' 4 ', U ' instance_type_memory_mb ': U ' 2048 ', U ' instance_type_swap ': U ' 0 ', U ' instance_type_vcpu_weight ': None, U ' Instance_type_roo                T_GB ': U ' 4 ', U ' instance_type_id ': U ' ten ', U ' instance_type_name ': U ' m1.small ', U ' instance_type_ephemeral_gb ': U ' 0 ', U ' instance_type_rxtx_factor ': U ' 1.0 ', U ' instance_ty 
               Pe_flavorid ': U ' c75e2199-b09e-4e9e-9997-bd6d6676541d ', U ' image_container_format ': U ' bare ', U ' Instance_type_vcpus ': U ' 1 ', U ' image_min_ram ': U ' 0 ', U ' image_disk_format ': U ' qcow2 ', U ' image_base _image_ref ': U ' a0247584-9a5e-4d43-861a-e4a78f708d3b '}, U ' task_state ': U ' scheduling ', U ' shutd Own_terminate ': false, U ' cell_name ': None, U ' ROOT_GB ': 4, U ' locked ': false, U ' name ': U ' instance-00000240 ', U ' created_at ': U ' 2014-08-22t03:47:00.000000 ', U ' locked_by ': None, U ' Launch_index ': 0, U ' metadata ': {}, U ' MEMORY_MB ': 2048, U ' Vcpus ': 1, U ' image_ref ': 
         U ' a0247584-9a5e-4d43-861a-e4a78f708d3b ', U ' root_device_name ': None, U ' auto_disk_config ': True, U ' os_type ': None, U ' config_drive ': U '}, u ' security_group ': [u ' default '], U ' instance_uuids ': [u ' C9 9560fa-6580-4b5f-a94e-28e81db75d81 ']}

2.filter_properties
{
   u ' instance_type ': {
       u ' memory_mb ': 2048, 
       u ' ROOT_GB ': 4, 
       u ' deleted_at ': None, 
       u ' name ': U ' M1. Small ', 
       u ' deleted ': 0, 
       u ' created_at ': U ' 2014-08-21t03:27:37.000000 ',        u ' EPHEMERAL_GB ': 0, 
       U ' updated_at ': None, 
       u ' disabled ': False, 
       u ' vcpus ': 1, 
       u ' extra_specs ': {}, 
       u ' swap ': 0, 
       U ' rxtx_factor ': 1.0, 
       u ' is_public ': True, 
       u ' flavorid ': U ' c75e2199-b09e-4e9e-9997-bd6d6676541d ', 
       U ' vcpu_weight ': None, 
       u ' ID ': Ten
   }, 
   u ' scheduler_hints ': {}
 }



2.get_all_host_states ()


3.filter_host ()
' Nova.scheduler.filters.isolated_hosts_filter. Isolatedhostsfilter '
nova.scheduler.filters.compute_filter. Computefilter '
nova.scheduler.filters.availability_zone_filter. Availabilityzonefilter '
nova.scheduler.filters.ram_filter. Ramfilter '
nova.scheduler.filters.json_filter. Jsonfilter '
nova.scheduler.filters.all_hosts_filter. Allhostsfilter '
nova.scheduler.filters.core_filter. Corefilter '
nova.scheduler.filters.affinity_filter. Affinityfilter '
nova.scheduler.filters.affinity_filter. Differenthostfilter '
nova.scheduler.filters.affinity_filter. Samehostfilter '
nova.scheduler.filters.affinity_filter. Simplecidraffinityfilter

4.filter_host ()





2.openstack Scheduler
 (1) schedulermanager.run_instance |
             |--> (one) driver.scheduler_run_instance |
                       |--> (_scheduler) (context, Request_spec, filter_properties)  | |--> (1111) _setup_instance_group (context, filter_properties) |--> (1112) _GET_CONFI Guration_options () |--> (1113) populate_filter_properties (Request_spec, Filter_propert           ies) |--> (1114) self.get_all_host_state (elevated) |
                                  |          |
                                  |--> (11141) hostmanager.get_all_host_states (self, Context) |
                                  |--> (1115) hostmanager.get_filtered_hosts (hosts, filter_properties, Index=num) |--> (1116) hostmanager.get_weighed_hosts (hosts, filter_proerties) 

(2) Hostmanager.get_all_host_states (self, context)
    |
    | --> (Db.compute_node_get_all) (context)
             |
             | --> (211) Compute_node_get_all  [db/sqlalchemy/api.py]
                       | 
                       | --> (2111) Select
                       |--> (2112) Conn.execute
                      




finally. OpenStack Related Network links

Http://docs.openstack.org/admin-guide-cloud/content/index.html

http://docs.openstack.org/api/openstack-network/2.0/content/

Https://wiki.openstack.org/wiki/NeutronDevelopment

Https://wiki.openstack.org/wiki/Neutron

http://docs.openstack.org/icehouse/install-guide/install/apt/content/

Swift Development Information

Http://docs.openstack.org/developer/swift/deployment_guide.html

Swift Client

Https://github.com/openstack/python-swiftclient

Neutron Blog article

http://blog.csdn.net/ustc_dylan/article/category/1659861

Http://blog.csdn.net/lynn_kong/article/category/1259739/2
Http://www.cnblogs.com/feisky/category/391781.html

IBM http://www.ibm.com/developerworks/cn/
Http://www.ibm.com/developerworks/cn/cloud/library/1311_zhanghua_openstacknetwork2/index.html


/////////////////////////////////////////////////////////////OpenStack NOVA Source structurehttp://wanglianghuaihua.blog.163.com/blog/static/54251531201311190653205/

Http://docs.openstack.org/grizzly/openstack-image/content/centos-image.html
summary of the overall structure and data flow of the Nova code
http://openstack.wiaapp.com/?p=177


Http://www.aboutyun.com/thread-6307-1-1.html
http://bbs.vmsky.com/forum.php


Class Diagram class Diagram class Diagram http://fossies.org/dox/nova-2013.2.3/classnova_1_1scheduler_1_1filters_1_1BaseHostFilter.html
Http://fossies.org/dox/nova-2014.1.1/

Compare full Connection http://blog.csdn.net/bingxx11/article/details/19110031

Http://blog.chinaunix.net/uid-20940095-id-4061153.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.