Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sample:base [2015/03/30 01:42]
admin [Configure the Bridged Network]
sample:base [2015/03/31 01:44] (current)
admin [Start the XOA VM]
Line 137: Line 137:
 ===== Configure the Bridged Network ===== ===== Configure the Bridged Network =====
 ---- ----
 +
 +We'll need the bridge-utils package, so make sure it's available or install it using:
 +<​code>​
 +> sudo apt-get install bridge-utils
 +</​code>​
 +
 Let's modify the dom0 network configuration to provide a bridged interface: Let's modify the dom0 network configuration to provide a bridged interface:
 <​code>​ <​code>​
Line 197: Line 203:
 > usermod -G sudo -a user_name (chosen during install process) ​ > usermod -G sudo -a user_name (chosen during install process) ​
 </​code>​ </​code>​
 +
 +**REBOOT**
  
 <color darkorange>​**You may now connect to your new system via ssh using the specified user_name, removing screen and keyboard from it if necessary**</​color>​ <color darkorange>​**You may now connect to your new system via ssh using the specified user_name, removing screen and keyboard from it if necessary**</​color>​
 +
 +----
 +===== Modify .bashrc =====
 +----
 +
 +Replace the content of ~/.bashrc to bring some color to the terminal:
 +
 +<​code>​
 +> cp ~/.bashrc ~/​.bashrc.bak
 +> nano ~/.bashrc
 +</​code>​
 +++++ REPLACE CONTENT WITH: (click to see) |
 +<​code>​
 +# ~/.bashrc: executed by bash(1) for non-login shells.
 +# see /​usr/​share/​doc/​bash/​examples/​startup-files (in the package bash-doc)
 +# for examples
 +
 +# If not running interactively,​ don't do anything
 +#[ -z "​$PS1"​ ] && return
 +
 +# don't put duplicate lines in the history. See bash(1) for more options
 +# ... or force ignoredups and ignorespace
 +HISTCONTROL=ignoredups:​ignorespace
 +
 +# append to the history file, don't overwrite it
 +shopt -s histappend
 +
 +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
 +HISTSIZE=1000
 +HISTFILESIZE=2000
 +
 +# check the window size after each command and, if necessary,
 +# update the values of LINES and COLUMNS.
 +shopt -s checkwinsize
 +
 +# make less more friendly for non-text input files, see lesspipe(1)
 +[ -x /​usr/​bin/​lesspipe ] && eval "​$(SHELL=/​bin/​sh lesspipe)"​
 +
 +# set variable identifying the chroot you work in (used in the prompt below)
 +if [ -z "​$debian_chroot"​ ] && [ -r /​etc/​debian_chroot ]; then
 +    debian_chroot=$(cat /​etc/​debian_chroot)
 +fi
 +
 +function realpath()
 +{
 +    f=$@
 +
 +    if [ -d "​$f"​ ]; then
 +        base=""​
 +        dir="​$f"​
 +    else
 +        base="/​$(basename "​$f"​)"​
 +        dir=$(dirname "​$f"​)
 +    fi
 +
 +    dir=$(cd "​$dir"​ && /bin/pwd)
 +
 +    echo "​$dir$base"​
 +}
 +
 +# Set prompt path to max 2 levels for best compromise of readability and usefulness
 +promptpath () {
 +    realpwd=$(realpath $PWD)
 +    realhome=$(realpath $HOME)
 +
 +    # if we are in the home directory
 +    if echo $realpwd | grep -q "​^$realhome";​ then
 +        path=$(echo $realpwd | sed "​s|^$realhome|\~|"​)
 +        if [ "​$path"​ = "​~"​ ] || [ "​$(dirname "​$path"​)"​ = "​~"​ ]; then
 +            echo $path
 +        else
 +            echo $(basename $(dirname "​$path"​))/​$(basename "​$path"​)
 +        fi
 +        return
 +    fi
 +
 +    path_dir=$(dirname "​$PWD"​)
 +    # if our parent dir is a top-level directory, don't mangle it
 +    if [ $(dirname "​$path_dir"​) = "/"​ ]; then
 +        echo $PWD
 +    else
 +        path_parent=$(basename "​$path_dir"​)
 +        path_base=$(basename "​$PWD"​)
 +
 +        echo $path_parent/​$path_base
 +    fi
 +}
 +
 +# If this is an xterm set the title to user@host:​dir
 +case "​$TERM"​ in
 +xterm*|rxvt*)
 +    PROMPT_COMMAND='​echo -ne "​\033]0;​${USER}@${HOSTNAME}:​ ${PWD/​$HOME/​~}\007"'​
 +    ;;
 +*)
 +    ;;
 +esac
 +
 +if [ "​$TERM"​ != "​dumb"​ ]; then
 +    eval "​`dircolors -b`"
 +    alias ls='ls --color=auto'​
 +    alias grep='​grep --color=auto'​
 +    alias fgrep='​fgrep --color=auto'​
 +    alias egrep='​egrep --color=auto'​
 +
 +    # Set a terminal prompt style (default is fancy color prompt)
 +    PS1='​${debian_chroot:​+($debian_chroot)}\[\033[38;​5;​27m\]\u@\h \[\033[01;​34m\]$(promptpath)\[\033[00m\]\$ '
 +else
 +    alias ls="ls -F"
 +    alias ll='ls -alF'
 +    alias la='ls -A'
 +    alias l='ls -CF'
 +    PS1='​${debian_chroot:​+($debian_chroot)}\u@\h $(promptpath)\$ '
 +fi
 +
 +# Custom aliases
 +alias ranger='​ranger --choosedir=.'​
 +
 +PATH=/​usr/​local/​sbin:/​usr/​local/​bin:/​usr/​sbin:/​usr/​bin:/​sbin:/​bin
 +
 +run_scripts()
 +{
 +    for script in $1/*; do
 +        [ -x "​$script"​ ] || continue
 +        . $script
 +    done
 +}
 +
 +run_scripts $HOME/​.bashrc.d
 +</​code>​
 +++++
 +
 +Activate changes:
 +<​code>​
 +> source ~/.bashrc
 +</​code>​
  
 ---- ----
Line 279: Line 422:
 ---- ----
  
-Now what's needed is some storage space that the Xen hypervisor will be allowed to use. We created a volume group (Xvg0), along with a logical volume (Xsr0) during Debian installation,​ we'll dedicate it for Xen SR usage as follow:+Now what's needed is some storage space that the Xen hypervisor will be allowed to use. We created a volume group (Xvg0), along with a logical volume (Xsr0) during Debian installation,​ we'll dedicate it for Xen SR usage. As LVHD seems to offer both advantages of EXT and LVM format, we'll use the lvhd type:
  
 <color darkorange>​**ATTENTION:​ THE TARGET VOLUME WILL BE ERASED AND ALL DATA ON IT WILL BE LOST!**</​color>​ <color darkorange>​**ATTENTION:​ THE TARGET VOLUME WILL BE ERASED AND ALL DATA ON IT WILL BE LOST!**</​color>​
 <​code>​ <​code>​
-> sudo xe sr-create type=ext name-label='​X-Local-SR'​ device-config:​device=/​dev/​mapper/​Xvg0-Xsr0+> sudo xe sr-create type=ext ​content-type=user ​name-label='​X-Local-SR'​ device-config:​device=/​dev/​mapper/​Xvg0-Xsr0 
 +2f93b6d9-9904-dbfc-afba-d4ba190fca3d
 </​code>​ </​code>​
  
Line 291: Line 435:
 <​code>​ <​code>​
 > sudo xe sr-list > sudo xe sr-list
- +uuid ( RO)                : ef162035-0edb-7cd9-6e1f-4a9a60e1dba8
-uuid ( RO)                : 26b9d87b-f344-1c8d-c5c5-a155d4e4e2e0 +
-          name-label ( RW): X-Local-SR +
-    name-description ( RW):  +
-                host ( RO): store +
-                type ( RO): ext +
-        content-type ( RO):  +
-         +
-uuid ( RO)                : 2c510782-2ad6-af40-8414-4ec89e9bc85c+
           name-label ( RW): XenServer Tools           name-label ( RW): XenServer Tools
     name-description ( RW): XenServer Tools ISOs     name-description ( RW): XenServer Tools ISOs
-                host ( RO): store+                host ( RO): provocator
                 type ( RO): iso                 type ( RO): iso
         content-type ( RO): iso         content-type ( RO): iso
 +
 +
 +uuid ( RO)                : 2f93b6d9-9904-dbfc-afba-d4ba190fca3d
 +          name-label ( RW): X-Local-SR
 +    name-description ( RW): 
 +                host ( RO): provocator
 +                type ( RO): ext
 +        content-type ( RO): user
 +
 </​code>​ </​code>​
  
Line 319: Line 464:
 ├─sda4 ​                                    ​8:​68 ​  ​1 ​    ​1K ​ 0 part  ├─sda4 ​                                    ​8:​68 ​  ​1 ​    ​1K ​ 0 part 
 └─sda5 ​                                    ​8:​69 ​  ​1 ​ 12.8G  0 part  └─sda5 ​                                    ​8:​69 ​  ​1 ​ 12.8G  0 part 
-  ├─Xvg0-Xsr0 (dm-0) ​                    ​254:​0 ​   0   7.8G  0 lvm   +  ├─Xvg0-Xsr0 (dm-0) ​                    ​254:​0 ​   0   9.3G  0 lvm   
-  │ └─XSLocalEXT--26b9d87b...e2e0 (dm-2) 254:2    0   7.8G  0 lvm  /​run/​sr-mount/​26b9d87b...e2e0 +  │ └─XSLocalEXT--2f93b6d9...ca3d (dm-2) 254:2    0   9.3G  0 lvm  /​run/​sr-mount/​2f93b6d9...ca3d 
-  └─Xvg0-Xsr1 (dm-1) ​                    ​254:​1 ​   0     ​5G  0 lvm+  └─Xvg0-Xsr1 (dm-1) ​                    ​254:​1 ​   0   3.5G  0 lvm 
 +</​code>​ 
 + 
 +A PBD was also created in the process: 
 +<​code>​ 
 +> sudo xe pbd-list  
 +uuid ( RO)                  : c55da5af-981f-5a68-d46b-4480b974e856 
 +             ​host-uuid ( RO): a006d803-4aa1-11e6-827c-7e5c7af9806e 
 +               ​sr-uuid ( RO): ef162035-0edb-7cd9-6e1f-4a9a60e1dba8 
 +         ​device-config (MRO): location: /​usr/​share/​xcp/​packages/​iso;​ legacy_mode:​ true 
 +    currently-attached ( RO): true 
 + 
 + 
 +uuid ( RO)                  : 84bf61e9-4976-6837-9664-4f837d4bf214 
 +             ​host-uuid ( RO): a006d803-4aa1-11e6-827c-7e5c7af9806e 
 +               ​sr-uuid ( RO): 2f93b6d9-9904-dbfc-afba-d4ba190fca3d 
 +         ​device-config (MRO): device: /​dev/​mapper/​Xvg0-Xsr0 
 +    currently-attached ( RO): true
 </​code>​ </​code>​
 ---- ----
Line 329: Line 491:
 We'll now register this newly created SR as the pool's default, i.e. new VMs VDIs willl be stored on this SR unless otherwise specified at creation time: We'll now register this newly created SR as the pool's default, i.e. new VMs VDIs willl be stored on this SR unless otherwise specified at creation time:
 <​code>​ <​code>​
-> sudo xe pool-list +> sudo pool-list  
-uuid ( RO)                : 4a187cc1-69ce-eaf3-2742-6aec0783159f+uuid ( RO)                : 352be6da-23d4-2815-494a-8c6d63957335
           name-label ( RW):            name-label ( RW): 
     name-description ( RW):      name-description ( RW): 
-              master ( RO): 288efd1c-7afe-21ca-e374-cace5e2d7e20+              master ( RO): a006d803-4aa1-11e6-827c-7e5c7af9806e
           default-SR ( RW): <not in database>​           default-SR ( RW): <not in database>​
  
-> sudo xe pool-param-set uuid=4a187cc1-69ce-eaf3-2742-6aec0783159f ​default-SR=26b9d87b-f344-1c8d-c5c5-a155d4e4e2e0+> sudo xe pool-param-set uuid=352be6da-23d4-2815-494a-8c6d63957335 ​default-SR=2f93b6d9-9904-dbfc-afba-d4ba190fca3d
 </​code>​ </​code>​
  
Line 442: Line 604:
 ==== Install the Appliance ==== ==== Install the Appliance ====
 ---- ----
-XenOrchestra (XO) is an open-source Web interface for XenServer (or XCP in this case) communicating through XAPI. It is made available as an "​appliance"​ for Xen, which means you can [[https://​xen-orchestra.com/​|download a fully configured VM from the XO website]]. You'll have to register first but there is a free version available for download (version is 3.as of this writing: 2015-03-05). Once downloaded, you'll have an .xva file that you need to transfer to your Xen Host. We'll use sftp to do this, creating a new directory on the host for .xva files in /​opt/​xen/​X-Local-XVA:​+XenOrchestra (XO) is an open-source Web interface for XenServer (or XCP in this case) communicating through XAPI. It is made available as an "​appliance"​ for Xen, which means you can [[https://​xen-orchestra.com/​|download a fully configured VM from the XO website]]. You'll have to register first but there is a free version available for download (version is 3.as of this writing: 2015-03-31). Once downloaded, you'll have an .xva file that you need to transfer to your Xen Host. We'll use sftp to do this, creating a new directory on the host for .xva files in /​opt/​xen/​X-Local-XVA:​
  
 <​code>​ <​code>​
--- From the workstation where you downloaded xoa_free_3.6.xva --+-- From the workstation where you downloaded xoa_free_3.8.xva -- 
 +> cd /​path/​to/​your/​download
 > sftp root@<​xen_host_ip>​ > sftp root@<​xen_host_ip>​
 sftp> cd /opt/xen sftp> cd /opt/xen
 sftp> mkdir X-Local-XVA sftp> mkdir X-Local-XVA
 sftp> cd X-Local-XVA sftp> cd X-Local-XVA
-sftp> lcd /​path/​to/​your/​download +sftp> put xoa_free_3.8.xva 
-sftp> put xoa_free_3.6.xva +xoa_free_3.8.xva                17%  116MB   ​4.0MB/​s ​  02:16 ETA
-xoa_free_3.6.xva                17%  116MB   ​4.0MB/​s ​  02:16 ETA+
 sftp> exit sftp> exit
 </​code>​ </​code>​
Line 459: Line 621:
 <​code>​ <​code>​
 > cd /​opt/​xen/​X-Local-XVA > cd /​opt/​xen/​X-Local-XVA
-> sudo xe vm-import filename=xoa_free_3.6.xva+> sudo xe vm-import filename=xoa_free_3.8.xva 
 +e803456a-1478-6047-8735-171f1ac0dcf2
 </​code>​ </​code>​
 It takes a little time (unzipping the image), to be honest it can take //quite some// time. It takes a little time (unzipping the image), to be honest it can take //quite some// time.
 +
 +----
 +==== Start the XOA VM ====
 +----
 +Although the VM has now been imported, its initial state is "​halted":​
 +<​code>​
 +> sudo xe vm-list
 +uuid ( RO)           : 185059ea-0cdc-01a6-490f-befa6d20052b
 +     ​name-label ( RW): Control domain on host: provocator
 +    power-state ( RO): running
 +
 +
 +uuid ( RO)           : e803456a-1478-6047-8735-171f1ac0dcf2
 +     ​name-label ( RW): XOA 3.8 Free Edition
 +    power-state ( RO): halted
 +</​code>​
 +
 +Note that you might want to run an IP scan before starting the VM (seen next point).
 +
 +<​code>​
 +> sudo xe vm-start name-label="​XOA 3.8 Free Edition"​
 +</​code>​
  
 ---- ----