Larry Kuo
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # AOS Final Project ## 概念 ### Optimal Dynamic-priority Real-Time Scheduling Algorithms for Uniform Multiprocessors **套用論文概念到 Openstack 的Scheduler(https://ieeexplore.ieee.org/document/8227945)** 必須要是可預估的process(maybe可以用可預測的task)(歷史記錄去計算) (period, deadline ) > **goal** => 不能使用在整個openstack 的resource下,但可以使用在某個user之下的多個resource去做scheduler 1. 如何驗證? tools 2. 程式碼 (scheduler) 3. 要怎麼去測量 是要用current utilization or average utilization or else? [ppt](https://docs.google.com/presentation/d/15JcTR9ftgxkvRfp6U9Nq5YQytYEAKggRkp0_atuPf60/edit?usp=sharing) 錄音:4/19-2 32:00 > User 在 ### Related Work 1. [Improved filter-weight algorithm for utilization-aware resource scheduling in OpenStack](https://ieeexplore.ieee.org/document/7489348) 2. [Resource usage aware scheduling in OpenStack](https://ieeexplore.ieee.org/document/8227945) 3. ### Openstack 1. virtualization 2. [scheduler](https://docs.openstack.org/nova/rocky/admin/configuration/schedulers.html) ### CPU sharing policy ![](https://hackmd.io/_uploads/HJjSxRuSh.png) ![](https://hackmd.io/_uploads/SJ-AtM-In.png) ### 一些chatgpt 問答 [OpenStack工程師問答](/LtkWPqDYTPS9-CIVIBtYSw) ### openstack's scheduler 1. filter 2. weighted scheduler/utils.py 640 (keyword:hints) scheduler 觸發 -> manager.py(246) -> scheduler/client.py/query.py (SchedulerQueryClient) --- ### 相關關鍵字 檔案 Python 使用libvirt去做虛擬化 hypervisor nova/api/openstack/compute/servers.py nova/api/openstack/compute/services.py nova/api/openstack/compute/routes.py nova/compute/api.py nova/nova/scheduler [nova/conductor/manage.py 936](https://igene.tw/how-openstack-nova-scheduler-works) #### 可參考documents **API doc** doc/source/contributor/api.rst [doc](https://docs.openstack.org/api-ref/compute/#compute-api) ```python def create_route # nova/nova/api/openstack/__init__.py ``` ### wsgi service ==mod_wsgi== nova/service.py nova/api/wsgi.py ::192 Router() -> mapper.connect() APIMapper ProjectMapper ### hypervisior 1. libvirt_driver 2. HypervisorsController 3. nova/api/openstack/compute/hypervisors.py ### scheduler 在 OpenStack Nova 中,決定要使用哪個篩選器是根據配置文件中的調度器配置來完成的。在 Nova 的 nova-scheduler.conf 配置文件中,有一個名為 scheduler_default_filters 的選項,該選項指定了預設的篩選器列表。 當 Nova 接收到一個新的虛擬機實例要進行排班時,它會根據配置文件中指定的預設篩選器列表來決定要應用哪些篩選器。這些篩選器按照在配置文件中指定的順序進行應用,直到找到符合篩選條件的適當主機。 通常,預設篩選器列表中包含一些基本的篩選器,如 AvailabilityZoneFilter(可用區域篩選器)和 RamFilter(記憶體篩選器)。這些預設篩選器用於根據虛擬機實例的需求和主機的資源狀態進行基本的篩選。 如果需要更進階的篩選功能,可以通過修改配置文件中的 scheduler_default_filters 選項,添加或修改篩選器的順序,或者創建自定義的篩選器。自定義篩選器可以根據特定需求和條件進行定制,例如根據 CPU 使用率、網絡帶寬、親和性要求等進行排班決策。 因此,根據配置文件中指定的預設篩選器列表,Nova 根據篩選器的順序來決定應用哪些篩選器,以選擇合適的主機來進行虛擬機實例的排班。 scheduler.py line 355 ```python= cfg.ListOpt("enabled_filters", # NOTE(artom) If we change the defaults here, we should also update # Tempest's scheduler_enabled_filters to keep the default values in # sync. default=[ "ComputeFilter", "ComputeCapabilitiesFilter", "ImagePropertiesFilter", "ServerGroupAntiAffinityFilter", "ServerGroupAffinityFilter", ], help=""" Filters that the scheduler will use. An ordered list of filter class names that will be used for filtering hosts. These filters will be applied in the order they are listed so place your most restrictive filters first to make the filtering process more efficient. All of the filters in this option *must* be present in the ``[scheduler_filter] available_filter`` option, or a ``SchedulerHostFilterNotFound`` exception will be raised. Possible values: * A list of zero or more strings, where each string corresponds to the name of a filter to be used for selecting a host Related options: - ``[filter_scheduler] available_filters`` """), ``` ### Instance的CPU利用率 1. 基於歷史資料的估計:通過監測和記錄實際運行的虛擬機實例的 CPU 利用率數據,可以建立一個歷史資料庫。使用這些歷史資料,可以分析和預測類似工作負載的虛擬機實例的預期 CPU 利用率。**(監測工具:Zabbix)** 2. 當談到動態分配 CPU 資源的作業系統時,一個常見的例子是Linux作業系統。Linux使用CFS(Completely Fair Scheduler)作為其預設的調度器,它是一個基於時間片(timeslice)的動態分配調度器。 CFS以虛擬時間(virtual time)的概念來估計進程的CPU利用率。每個進程都有一個虛擬運行時間,表示該進程在CPU上花費的時間量。 CFS追蹤每個進程的虛擬時間,並根據虛擬時間來進行調度。CFS的目標是保持公平性,即每個進程在長期運行中都能獲得公平的CPU時間。它通過動態調整每個進程的時間片大小來實現這一點。當一個進程的虛擬時間超過其分配的時間片時,CFS會將時間片增加,以便讓其他等待執行的進程有更多的機會。 因此,在Linux的CFS中,進程的CPU利用率是基於其虛擬運行時間和時間片的動態調整。藉由根據進程的執行情況和需求,動態調整時間片大小,CFS可以適應不同的工作負載並提供公平的調度。值得注意的是,Linux作業系統中也有其他的調度器,例如實時調度器(Real-time Scheduler)和Deadline調度器(Deadline Scheduler),它們使用不同的策略來預估和分配CPU資源。每個調度器都有不同的優先順序和特性,適用於不同的應用場景和需求。請注意,此處提到的例子僅為示範,真實的作業系統和調度器可能有更複雜的內部機制和算法,以確保更好的效能和公平性。 A 快 B慢 | 時間段 | 0 | 1 | 2. | 3 | 4 | | ------ | ---- | ---- | ---- | --- | --- | | 實際 | 4 | 6 | 2. | | | | 預估 | | 4 | 6 | 2 | | | 實際 | 2 | 4 | 6 | | | | 預估 | | 2 | 4 | 6 | | ![](https://hackmd.io/_uploads/SJNOPa2I3.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully