TingWei
    • 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
    # HW04-安裝 OpenStack 並建置虛擬機 ## 緣由 作業需要在電算中心的ubuntu server安裝openstack,因此將安裝步驟記錄下來,並建置虛擬機過程,在以後需要再次用到時能夠方便查看。 ## 系統簡介 * 設備:嘉義大學 電算中心 220教室的h04伺服器 * 伺服器:[Ubuntu 22.04 LTS (伺服器版)](https://www.ubuntu-tw.org/modules/tinyd0/) * 伺服器IP:10.2.200.186 ## 安裝過程 ### 以devstack安裝openstack步驟 1.在server新增使用者 -> stack ``` sudo useradd -s /bin/bash -d /opt/stack -m stack ``` ![](https://hackmd.io/_uploads/H1q2p_2Nn.png) 2.之後輸入以下指令 ``` sudo chmod +x /opt/stack echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack ``` ![](https://hackmd.io/_uploads/SyeWJK2E2.png) ![](https://hackmd.io/_uploads/SJwWkF3V2.png) 3.切換到stack ``` sudo -u stack -i ``` ![](https://hackmd.io/_uploads/r1TSyKnNn.png) 4.安裝devstack ``` git clone https://opendev.org/openstack/devstack cd devstack ``` 5.建立 local.conf 檔案以設定 openstack ``` vim local.conf ``` 按下鍵盤 i 鍵編輯檔案,輸入以下內容(範例密碼為secret,用於之後登入openstack使用) ``` [[local|localrc]] ADMIN_PASSWORD=secret DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD ``` 完成之後按下 esc 鍵,並輸入 :wq 保存退出 ![](https://hackmd.io/_uploads/H1qL4t2N2.png) 6.輸入以下內容開始安裝openstack,並等待完成 ``` ./stack.sh ``` 7.安裝完成之後,輸入 [http://10.2.200.186/dashboard](http://10.2.200.186/dashboard) ,即可進入openstack ![](https://hackmd.io/_uploads/r1ntEYn43.png) 預設登入帳號為 admin,而密碼為剛剛設定的 local.conf 設定的密碼。 ![](https://hackmd.io/_uploads/S15xNYnE3.png) ### 設置CirrOS虛擬機 1.設置外部網路 Admin -> Network -> Networks,選擇create network 選擇public,新增子網路 ![](https://hackmd.io/_uploads/BkjrHZqHn.png) ![](https://hackmd.io/_uploads/HkS8HWqrh.png) ![](https://hackmd.io/_uploads/B1R8Hb9Hh.png) 2.到server的/etc netplan輸入以下資訊 輸入下列指令 ``` sudo ovs-vsctl add-portbr-ex eno1 sudo ip addr flush dev eno1 ``` ![](https://hackmd.io/_uploads/HJ3ZI-qSh.png) 並輸入sudo vim 00-installer-config.yaml,修改檔案為下列 ```javascript= network: renderer: networkd ethernets: br-ex: dhcp4: no addresses: [ 10.2.200.186/25 ] gateway4: 10.2.200.239 nameservers: search: [ ] addresses: [8.8.8.8,8.8.4.4] eno1: dhcp4: no eno2: dhcp4: true version: 2 ``` 套用網路介面設定 ``` sudo netplan try ``` 跳出以下畫面之後按下enter ![](https://hackmd.io/_uploads/r1oGU-cSh.png) 輸入以下資訊 ``` sudo ip addr add 10.2.200.186/25 dev br-ex sudo ip link set br-ex up ``` ![](https://hackmd.io/_uploads/Sy0m8b5S2.png) 3.建立內部網路Project -> Network -> Networks,選擇create network ![](https://hackmd.io/_uploads/HyuBLW9Sn.png) 4.建立router,Project -> Network -> Routers ![](https://hackmd.io/_uploads/HyZ-vK3Vh.png) ![](https://hackmd.io/_uploads/B1mPUZ9S2.png) 5.修改router為下面圖片所示,對外接口為10.2.200.189 ![](https://hackmd.io/_uploads/BySuU-qr2.png) 6.調整Security Groups,Security Groups -> Manage Rules -> AddRules,並選擇default的Manage Rules,選擇Add Rules ![](https://hackmd.io/_uploads/r123FFhVh.png) 允許HTTP連線 ![](https://hackmd.io/_uploads/SyXe5Yn42.png) 新增SSH連線 ![](https://hackmd.io/_uploads/S14r5Yh43.png) 允許所有ICMP ![](https://hackmd.io/_uploads/HkII9tnNh.png) 7.建立虛擬機,Project -> Compute -> Instances,選擇Launch Instance ![](https://hackmd.io/_uploads/HkUqL-5rn.png) ![](https://hackmd.io/_uploads/HJEoLZqBn.png) ![](https://hackmd.io/_uploads/ByznUW9rh.png) ![](https://hackmd.io/_uploads/Skm68Zqr3.png) 8.產生浮動IP,Project -> Network -> Floating IPs ![](https://hackmd.io/_uploads/SkIYwWqH2.png) * 如果無法對到設定的範圍10.2.200.187~10.2.200.190,到網路的public把172.x.x.x的網路範圍設為下列。 ![](https://hackmd.io/_uploads/HkzcDb9H3.png) 9.選擇剛剛建立完成的instance,設定IP ![](https://hackmd.io/_uploads/Hkl9sK2Vh.png) ![](https://hackmd.io/_uploads/B1SivZqH2.png) 10.選擇虛擬機,選擇console,登入虛擬機 使用者: cirros 密碼: gocubsgo 並嘗試輸入ping 8.8.8.8 ![](https://hackmd.io/_uploads/rkQ2P-qB3.png) 嘗試輸入ping www.google.com.tw ![](https://hackmd.io/_uploads/SJR2wZcBn.png) * 如果無法ping www.google.com.tw ,在虛擬機輸入下面指令。 ``` sudo vi /etc/resolv.conf ``` * 將檔案改為下列圖片,即可成功ping www.google.com.tw 。 ![](https://hackmd.io/_uploads/r1tKM0FHh.png) 11.外部嘗試ping進虛擬機 ![](https://hackmd.io/_uploads/S1sTwZcSn.png) ## 結論 * 這次作業一開始嘗試安裝openstack就錯誤好幾次並重新安裝,原本安裝server的步驟因此從不熟悉過程到熟悉過程,好幾個下午就這樣沒了。 * 其中的devstack安裝openstack的過程幾乎都一個小時起跳的,過程需要特別有耐心。 * 之後成功建立openstaack,建立完虛擬機之後嘗試好幾個小時一樣無法從外部ping回虛擬機,之後重複嘗試好幾個小時,才終於能完成從學校網路直接ping 10.2.200.188到openstack建立的虛擬機。 * 安裝過程非常的複雜,需要多方嘗試,並查詢不同網站的方法才有機會成功,而最後一部份因為接下來需要處理他事情而沒有時間完成,因此止步於此。

    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