Samina Fu
    • 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
    • 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 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
    # 2018.02.09 CORD Training ## CORD XOS Service onboarding ## 目標: 1. 在原有的M-CORD環境中增加兩個service: viperfser (iperf server), viperfcli (iperf client) 2. 建立兩個service 各一個vm 3. 連上management network 並連進vm中 4. 將兩個service 利用 iperf_network 連接(service chain) 5. 測試兩台機器互ping能連通 6. 利用ansible playbook 讓 viperfser 能夠自動開啟 iperf server 7. viperfcli 利用synchronizer 取得 viperfser 的iperf_network ip並執行client ## stage0: 事前準備 1. M-CORD 4.1 2. check http://hostip:8080/xos 3. in host 清除M-CORD XOS ~~~shell= $ cd ~/cord/build/ $ make xos-teardown; make clean-openstack; make clean-profile ~~~ 4. 下載這次要用的service ~~~shell= $ cd ~/cord/orchestration/xos_services $ git clone https://github.com/jiahchen/viperfser.git $ git clone https://github.com/jiahchen/viperfcli.git ~~~ ## stage1: 建立 service **1. 假裝我們的service 為 opencord project** ~~~shell= cd ~/cord/orchestration/xos_services/viperfser; git remote add opencord https://github.com/jiahchen/viperfser.git; git checkout cord-4.1; git pull opencord cord-4.1; #viperfcli 同上自行演練 ~~~ **2. 修改 .repo manifest 註冊service** ~~~shell= vim ~/cord/.repo/manifests/default.xml ~~~ 增加以下描述 ~~~xml= <project path="orchestration/xos_services/viperfser" name="viperfser" groups="orchestration,services"/> viperfcli 同上自行演練 ~~~ **3. 在docker-image.yml中增加我們的service** ~~~shell= vim ~/cord/build/docker_images.yml ~~~ 增加以下描述 ~~~yaml= - name: xosproject/viperfser-synchronizer repo: viperfser path: "xos/synchronizer" dockerfile: "Dockerfile.synchronizer" #viperfcli 同上自行演練 (注意排版) ~~~ **4. 在mcord-ng40.yaml中增加service 及 image-iperf** ~~~shell= vim ~/cord/build/platform-install/profile_manifests/mcord-ng40.yml ~~~ 增加下列描述 ~~~yaml= - name: viperfser path: orchestration/xos_services/viperfser keypair: mcord_rsa #viperfcli 同上自行演練 #並在最下方增加: - name: "image-iperf" url: "https://aweimeow.tw/oai-latest-compress.qcow2" checksum: "sha256:ec51c2014418561db9143e84b03b9746840f867a2a2d2d3c8d806e566395239c" ~~~ **5. 在mcord-ng40-service.yaml.j2 中增加 service** ~~~shell= vim ~/cord/build/platform-install/roles/cord-profile/templates/mcord-ng40-services.yml.j2 ~~~ 增加下列描述 ~~~yaml= #import 區塊: # 要和 viperfser/xos/viperfser.xproto 的 - custom_types/vipsservice.yaml #image 區塊: image-iperf: type: tosca.nodes.Image properties: name: image-iperf #Service區塊: # Iperf Server service service#viperfser: type: tosca.nodes.VIPSService properties: name: VIPSService view_url: /admin/viperfser/viperfser/$id$/ kind: viperfser public_key: {{ lookup('file', config_cord_profile_dir + '/key_import/mcord_rsa.pub') }} private_key_fn: /opt/xos/services/viperfser/keys/mcord_rsa artifacts: pubkey: /opt/cord_profile/key_import/mcord_rsa.pub {{ site_name }}_viperfser: description: vIperfServer Service Slice type: tosca.nodes.Slice properties: name: {{ site_name }}_viperfser default_isolation: vm network: noauto requirements: - site: node: {{ site_name }} relationship: tosca.relationships.BelongsToOne - service: node: service#viperfser relationship: tosca.relationships.BelongsToOne - default_image: node: image-iperf relationship: tosca.relationships.BelongsToOne - default_flavor: node: m1.large relationship: tosca.relationships.BelongsToOne viperfcli 同上自行演練(注意排版及typo) ~~~ **6. 清除原先設定** ~~~shell= cd ~/cord/build/genconfig; rm -rf cord_* conf.* inventory.ini ~~~ **7. 重新build xos** ~~~shell= make config PODCONFIG=mcord-ng40-virtual.yml; make -j4 build; make compute-node-refresh ~~~ **8. 登入 xos gui** username: xosadmin@opencord.org ~~~shell= ssh head1; cat /opt/credentials/xosadmin@opencord.org #取得password ~~~ **9. 成果如下** ![](https://i.imgur.com/Mc79iX7.png) ## stage2: 創建 service instance **1. 建立 viperfser service instance** ~~~shell= 在網頁中 viperfser -> iperf server service instance -> add -> Owner id 選擇 VIPSService Tenant message 隨便打 按Save viperfcli 同上自行演練 ~~~ **2. 查看instance** ![](https://i.imgur.com/GVexCys.png) ## stage3: 連接 management network **1. 清除環境** ~~~shell= cd ~/cord/build; make xos-teardown; make clean-openstack; make clean-profile ~~~ **2. 建立management network with service** ~~~shell= vim ~/cord/build/platform-install/roles/cord-profile/templates/mcord-ng40-service.yml.j2 ~~~ 增加下列描述 ~~~yaml= viperfser_slice_management_network: type: tosca.nodes.NetworkSlice requirements: - network: node: management relationship: tosca.relationships.BelongsToOne - slice: node: {{ site_name }}_viperfser relationship: tosca.relationships.BelongsToOne #viperfcli 同上自行演練 ~~~ **3. 重build xos** ~~~shell= cd ~/cord/build; make -j4 build; make compute-node-refresh ~~~ ## stage4: 進入 vm **1. 依照stage2 啟動各一個service instance** **2. 取得compute node name** ~~~shell= ssh head1; cord prov list ~~~ **3. 查看instance 狀態及management ip** ~~~shell= ssh head1; source /opt/cord_profile/admin-openrc.sh; nova list --all-tenant ~~~ **4. 進入compute node** ~~~shell= ssh head1; ssh-agent bash; ssh-add; ssh -A ubuntu@<compute-node-name> ~~~ **5. 進入vm** ~~~shell= # in compute node ssh ubuntu@<management ip> ~~~ ## stage5: 創建iperf_network並做service chain **1. 清除環境** ~~~shell= make xos-teardown; make clean-openstack; make clean-profile ~~~ **2. 增加iperf-network template** ~~~shell= vim ~/cord/build/platform-install/roles/cord-profile/templates/iperf-net.yaml.j2 ~~~ 內容如下: ~~~yaml= tosca_definitions_version: tosca_simple_yaml_1_0 imports: - custom_types/xos.yaml - custom_types/site.yaml - custom_types/slice.yaml - custom_types/flavor.yaml - custom_types/network.yaml - custom_types/networktemplate.yaml description: network for iperf interface topology_template: node_templates: # site, fully created in deployment.yaml {{ site_name }}: type: tosca.nodes.Site properties: name: {{ site_name }} # iperf network iperf_template: type: tosca.nodes.NetworkTemplate properties: name: iperf_template visibility: private translation: none vtn_kind: PRIVATE iperf_network: type: tosca.nodes.Network properties: name: iperf_network subnet: 120.0.0.0/24 permit_all_slices: true requirements: - template: node: iperf_template relationship: tosca.relationships.BelongsToOne - owner: node: {{ site_name }}_iperf relationship: tosca.relationships.BelongsToOne {{ site_name }}_iperf: description: This slice exists solely to own the private network type: tosca.nodes.Slice properties: name: {{ site_name }}_iperf default_isolation: vm network: noauto requirements: - site: node: {{ site_name }} relationship: tosca.relationships.BelongsToOne ~~~ **3. 註冊iperf-net** ~~~shell= vim ~/cord/build/platform-install/profile_manifests/mcord-ng40.yml ~~~ 增加下列描述 ~~~yaml= xos_new_tosca_config_templates: - iperf-net.yaml ~~~ **4. binding iperf-net and viperfser, viperfcli** ~~~shell= vim ~/cord/build/platform-install/roles/cord-profile/templates/mcord-ng40-service.yml.j2 ~~~ 增加下列描述 ~~~yaml= #network 區塊: # iperf_network is for connectivity between VM inside cord and server outside, fully created in flat-net.yaml iperf_network: type: tosca.nodes.Network properties: must-exist: true name: iperf_network #service 區塊: viperfser_slice_iperf_network: type: tosca.nodes.NetworkSlice requirements: - network: node: iperf_network relationship: tosca.relationships.BelongsToOne - slice: node: {{ site_name }}_viperfser relationship: tosca.relationships.BelongsToOne #viperfcli 同上自行演練 ~~~ **5. 重build xos** ~~~shell= cd ~/cord/build; make -j4 build; make compute-node-refresh ~~~ ## stage6: 進入其中一台vm使用iperf_network ip 互 ping **1. 利用stage2 啟動vm** **2. 利用stage4 進入vm (並確認iperf_network ip)** **3. ping 120.0.0.x (另一個vm ip)** ## stage7: 撰寫 ansible playbook 使得 viperfser 啟動 iperf server 1. 修改viperfserserviceinstance_playbook.yaml ## stage8: 撰寫synchronizer 取得server ip 並啟動 client 1. 增加dependancy: viperfcli (subscriber) -> viperfser(provider) 2. 修改sync_viperfcliserviceinstance.py 3. 修改viperfcliserviceinstance_playbook.yaml ``` make xos-teardown; make clean-openstack ``` ## Q&A

    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