顯示具有 CitrixXenserver 標籤的文章。 顯示所有文章
顯示具有 CitrixXenserver 標籤的文章。 顯示所有文章

2013年7月1日 星期一

Install Quantum on XenServer

Install Quantum on XenServer

For using the quantum plugin see: http://openvswitch.org/openstack/documentation/
You can:
  • follow: [[[QuantumDevstack]]]
  • ensure your VM network is not on a VLAN
  • assuming you use Open vSwitch (default on XenServer 6.0.0 and later)
  • run the quantum agent on Dom0
  • add in nova.conf: xenapi_vif_driver=nova.virt.xenapi.vif.XenAPIOpenVswitchDriver

TODO - other steps not yet found.

2013年6月18日 星期二

Xenserver RRDs


Xenserver所使用的RRD Consolidation Function(CF)共有:
1. Average
2. Min
3. Max

There exist RRDs for individual VMs (including dom0) and the host. The VM RRDs are stored on the host on which they run, or the pool master when they are not running. This means that the location of VM must be known in order to retrieve the associated performance data.

DS Field Definitions:

DSDefines a Data Source Field.
DS-NameThe name of this Data Source.
DSTDefines the Data Source Type. Can be GAUGE, COUNTER, DERIVE or ABSOLUTE.
HeartBeatDefines the minimum heartbeat, the maximum number of seconds that can go by before a DS value is considered unknown.
MinThe minimum acceptable value. Values less than this number are considered unknown. This is optional.
MaxThe maximum acceptable value. Values exceeding this number are considered unknown. This is optional.

DS欄位格式為"三文字,三數字"

ex:
DS:telnet:COUNTER:600:0:100000000
      (DS-Name) (DST) (HeartBeat)  (Min) (Max)

RRA

RRA means round robin archive. Defining an RRA is the tricky part!

This parameter describes how long you want to hold your data, and in what resolution. There can be more than on archive. If the time span of an archive is full, the data will be consolidated and saved into the next archive.

The format is
RRA:CF:xff:steps:rows



http://community.citrix.com/display/xs/Graphing+RRD+with+GNUPlot
http://community.citrix.com/display/xs/Getting+the+Last+RRD+Datapoints
http://community.citrix.com/display/xs/Using+XenServer+RRDs

2013年6月1日 星期六

OpenStack Xenserver Host Aggregate 建置筆記


所謂的Xenserver Host-Aggregte目的是為了讓Compute Node能利用Xensever Resource Pool的概念集結起來,在掛載像是NFS Share的SR以便做Live-migration或是VM-RESIZE。

1. 在XenServer Host上先製作出PV的Nova Compute Node + quantum-plugin-openvswitch-agent
    (ubuntu 12.04 LTS )
2. 然後再將要建置成resource pool的所有compute node中的/etc/nova/nova.conf加入以下的設定:
    sr_matching_filter =  default-sr:true

3. 再來利用aggregate-create在availability zone中建置邏輯資源池(logical resource pool)
    nova aggregate-create <pool-name>  <availability-zone>

4.  再來設定host-aggregate的metadata,告訴nova controller我要建置的是xenserver resource pool:
   nova aggregate-set-metadata <pool-id>  hypervisor_pool=true
   nova aggregate-set-metadata <pool-id>  operational_state=create

5.  從所有的計算節點當中選出一個當作Master ComputeNode:
  nova  aggregate-add-host <pool-id> <master-compute-node>

6. 其他後續加入的compute node會成為slave compute node:
nova aggregate-add-host <pool-id>  <slave-compute-node>



Reference:
1. http://docs.openstack.org/trunk/openstack-compute/admin/content/configuring-migrations.html#true-live-migration-kvm-libvirt

2013年5月26日 星期日

Nova: Xenserver Block Migration support on OpenStack



 Block migration  --- Xenserver必須支援Storage XenMotion的feature才可以使用此功能

Prerequisites 
  • Compatible XenServer hypervisors. The hypervisors must support the Storage XenMotion feature. Please refer to the manual of your XenServer to make sure your edition has this feature.
[Note]Note
Please note, that you need to use an extra option --block-migrate for the live migration command, in order to use block migration.
[Note]Note
Please note, that block migration works only with EXT local storage SRs, and the server should not have any volumes attached.

2013年5月16日 星期四

Citrix Xenserver VDI type


Type:enum vdi_type
ValueDescription
systema disk that may be replaced on upgrade
usera disk that is always preserved on upgrade
ephemerala disk that may be reformatted on upgrade
suspenda disk that stores a suspend image
crashdumpa disk that stores VM crashdump information
Name:type
type of the VDI
Field is read-only



http://docs.vmd.citrix.com/XenServer/4.0.1/api/docs/html/browser.html

2013年5月10日 星期五

openvswitch boot sequence on Xenserver



Open vSwitch Boot Sequence on XenServer
---------------------------------------

When Open vSwitch is installed on XenServer, its startup script
/etc/init.d/openvswitch runs early in boot.  It does roughly the
following:

        * Loads the OVS kernel module, openvswitch.

        * Starts ovsdb-server, the OVS configuration database.

        * XenServer expects there to be no bridges configured at
          startup, but the OVS configuration database likely still has
          bridges configured from before reboot.  To match XenServer
          expectations, the startup script deletes all configured
          bridges from the database.

        * Starts ovs-vswitchd, the OVS switching daemon.

At this point in the boot process, then, there are no Open vSwitch
bridges, even though all of the Open vSwitch daemons are running.
Later on in boot, /etc/init.d/management-interface (part of XenServer,
not Open vSwitch) creates the bridge for the XAPI management interface
by invoking /opt/xensource/libexec/interface-reconfigure.  Normally
this program consults XAPI's database to obtain information about how
to configure the bridge, but XAPI is not running yet[*] so it instead
consults /var/xapi/network.dbcache, which is a cached copy of the most
recent network configuration.

[*] Even if XAPI were running, if this XenServer node is a pool slave
    then the query would have to consult the master, which requires
    network access, which begs the question of how to configure the
    management interface.

XAPI starts later on in the boot process.  XAPI can then create other
bridges on demand using /opt/xensource/libexec/interface-reconfigure.
Now that XAPI is running, that program consults XAPI directly instead
of reading the cache.

As part of its own startup, XAPI invokes the Open vSwitch XAPI plugin
script /etc/xapi.d/openvswitch-cfg-update passing the "update"
command.  The plugin script does roughly the following:

        * Calls /opt/xensource/libexec/interface-reconfigure with the
          "rewrite" command, to ensure that the network cache is
          up-to-date.

        * Queries the Open vSwitch manager setting (named
          "vswitch_controller") from the XAPI database for the
          XenServer pool.

        * If XAPI and OVS are configured for different managers, or if
          OVS is configured for a manager but XAPI is not, runs
          "ovs-vsctl emer-reset" to bring the Open vSwitch
          configuration to a known state.  One effect of emer-reset is
          to deconfigure any manager from the OVS database.

        * If XAPI is configured for a manager, configures the OVS
          manager to match with "ovs-vsctl set-manager".

Notes
-----

* The Open vSwitch boot sequence only configures an OVS configuration
database manager.  There is no way to directly configure an OpenFlow
controller on XenServer and, as a consequence of the step above that
deletes all of the bridges at boot time, controller configuration only
persists until XenServer reboot.  The configuration database manager
can, however, configure controllers for bridges.  See the BUGS section
of ovs-controller(8) for more information on this topic.

* The Open vSwitch startup script automatically adds a firewall rule
to allow GRE traffic. This rule is needed for the XenServer feature
called "Cross-Host Internal Networks" (CHIN) that uses GRE. If a user
configures tunnels other than GRE (ex: VXLAN, LISP), they will have
to either manually add a iptables firewall rule to allow the tunnel traffic
or add it through a startup script (Please refer to the "enable-protocol"
command in the ovs-ctl(8) manpage).


http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=INSTALL.XenServer;hb=HEAD

2013年5月8日 星期三

Xenserver交換Networking Backend




Switching between Linux Bridge and Open VSwitch

Note: Open vSwitch has been the default network backend since XenServer 6.0.0 and XCP 1.5. If you switched to using Linux Bridge and this proved beneficial to you, please let us know.
To see what network backend you are currently using, run in dom0:
cat /etc/xensource/network.conf
To switch to using the Linux Bridge network backend, run in dom0:
xe-switch-network-backend bridge
To switch to using Open vSwitch network backend, run in dom0:
xe-switch-network-backend openvswitch

2013年5月1日 星期三

在CentOS上面安裝epel

安装epel源的好处就是epel这个项目是由fedora维护的,在维护的这个源中包含许多软件,包括ntop,nagios之类的,也就是说,你安装了epel源就可以直接用yum install ntop来安装了

http://laibulai.iteye.com/blog/1416536

CentOS: /etc/sysconfig




Reference:
http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-sysconfig.html

Xenserver Plugins on OpenStack



https://github.com/openstack/nova/tree/master/plugins/xenserver/xenapi/etc/xapi.d/plugins

_bittorrent_seeder 

Seed a bittorent image. This file should not be executed directly, rather it should be kicked off by the `bittorent` dom0 plugin.


agent

XenAPI plugin for reading/writing information to xenstore

bandwidth

Fetch Bandwidth data from VIF network devices

bittorrent

Download images via BitTorrent.

glance

Handle the uploading and downloading of images via Glance.

kernel

Handle the manipulation of kernel images.

migration

XenAPI Plugin for transferring data between host nodes

pluginlib_nova.py

Helper functions for the Nova xapi plugins.  In time, this will merge
with the pluginlib.py shipped with xapi, but for now, that file is not
very stable, so it's easiest just to have a copy of all the functions
that we need.


utils.py

Various utilities used by XenServer plugins

workarounds

Handle the uploading and downloading of images via Glance.

xenhost

XenAPI plugin for host operations

xenstore.py

XenAPI plugin for reading/writing information to xenstore

2013年4月30日 星期二

Xen / XCP / Xenserver comparison





xapi a.k.a XenAPI

XAPI is at the heart of XenServer. It manages everything – all the resources in your XenServer environment, 

  1. reads in configs, 
  2. initializes networking paths, 
  3. checks licensing, 
  4. maintains a Database with all this info (the XAPI database), 
  5. manages Storage Repositories, 
  6. manages VMs, 
  7. tracks VM states, 
  8. manages networking, 
  9. High Availability 
  10. other XenServer hosts in the pool and more……
Each XenServer request or action is done via Xapi and only by asking the Master XenServer XAPI to do so. 

A copy of the XAPI database (or you could consider this to be the state of XAPI) is synchronized among all the hosts in the pool so they all have a copy of the current XAPI database – giving them the knowledge of what is going on – and in the case of the master going down – a new master can be appointed from the pool using the XAPI state information or shared database.
When you collect a status report from XenServer – the XAPI Database is stored in the status report. It is a relational database – and shows us the state of the environment at that point in time (when the status report was captured).

Reference

2013年4月28日 星期日

Xen / XCP / Xenserver in OpenStack Installation




Post install steps

You are now ready to install OpenStack onto your XenServer system. This process involves the following steps:
  • For resize and migrate functionality, please perform the changes described in the Configuring Resize section of the OpenStack Compute Administration Manual.
  • Install the VIF isolation rules to help prevent mac and ip address spoofing.
  • Install the XenAPI plugins - see the next section.
  • In order to support AMI type images, you need to set up /boot/guest symlink/directory in Dom0. For detailed instructions, see next section.
  • To support resize/migration, set up an ssh trust relation between your XenServer hosts, and ensure /images is properly set up. See next section for more details.
  • Create a Paravirtualised virtual machine that can run the OpenStack compute code.
  • Install and configure the nova-compute in the above virtual machine.


Ensure you are using the EXT type of storage repository (SR). Features that require access to VHD files (such as copy on write, snapshot and migration) do not work when using the LVM SR. Storage repository (SR) is a XenAPI specific term relating to the physical storage on which virtual disks are stored.
On the XenServer/XCP installation screen, this is selected by choosing "XenDesktop Optimized" option. In case you are using an answer file, make sure you use srtype="ext" within the installation tag of the answer file.


In order to support AMI type images, you need to set up /boot/guest symlink/directory in Dom0.



Prepare for AMI Type Images

    為了讓Xenserver的dom0能夠支援Amazon的VM Image type: AMI,所以必須在dom0建立/boot/guest的資料夾,讓OpenStack能夠從解壓縮開的AMI以及ARI Image中放kernel以及ramdisk到這個資料夾。正常來說這個資料夾是由OpenStack來進行維護的,不會因為power failures 或者意外事故造成一些垃圾檔案充斥在dom0中,所以推薦的作法是做symbolic link。


In order to support AMI type images within your OpenStack installation, a directory /boot/guest needs to be created inside Dom0. The OpenStack VM will put the kernel and ramdisk extracted from the AKI and ARI images to this location.

This directory's content will be maintained by OpenStack, and its size should not increase during normal operation, however in case of power failures or accidental shutdowns, some files might be left over. In order to prevent these files to fill up Dom0's disk, it is recommended to set up this directory as a symlink pointing to a subdirectory of the local SR.
Execute the following commands in Dom0 to achieve the above mentioned setup:
# LOCAL_SR=$(xe sr-list name-label="Local storage" --minimal)
# LOCALPATH="/var/run/sr-mount/$LOCAL_SR/os-guest-kernels"
# mkdir -p "$LOCALPATH"
# ln -s "$LOCALPATH" /boot/guest

2013年4月20日 星期六

XCP / Citrix Xenserver Volume Drivers on OpenStack

PS: Cinder是由Folsom版本開始從原本的nova-volume這部分去進行抽離的子專案



XenAPINFS

XenAPINFS is a Block Storage (Cinder) driver which is using an NFS share through XenAPI's Storage Manager to store virtual disk images and exposing those virtual disks as volumes.

XenAPINFS不能直接存取NFS,只能透過XenAPI Storage Manager來存取NFS。
( This driver is not accessing the NFS share directly, it is only accessing the share through XenAPI Storage Manager. )

This driver should be considered as a reference implementation for using XenAPI's storage manager in OpenStack ( present in XenServer and XCP).


配置方式

  1. Local:
    推薦的做法,這樣的話可以使用qemu-img,但必須在當作Storage Controller上的XCP/Xenserver host上開啟一台PV guest VM安裝 cinder + XenAPINFS driver
  2. Remote:
    不需要使用PV guest VM,直接拿XCP/Xenserver當作Storage Controller。但這樣的話只能用VDI格式的VHD。


Source Code:

1. Grizzly cinder, https://github.com/openstack/cinder/blob/stable/grizzly/cinder/volume/drivers/xenapi/sm.py



XenAPI Storage Manager Volume Driver ( only in Folsom version, 在grizzly版中似乎已經移除 )

The Xen Storage Manager Volume driver (xensm) is a XenAPI hypervisor specific volume driver

功用:

  1. provide basic storage functionality, including volume creation and destruction, on a number of different storage back-ends.
  2. It also enables the capability of using more sophisticated storage back-ends for operations like cloning/snapshots, etc.


The list below shows some of the storage plugins already supported in Citrix XenServer and Xen Cloud Platform (XCP):

  1. NFS VHD: 
    Storage repository (SR) plugin which stores disks as Virtual Hard Disk (VHD) files on a remote Network File System (NFS).

  2. Local VHD on LVM: 
    SR plugin which represents disks as VHD disks on Logical Volumes (LVM) within a locally-attached Volume Group.

  3. HBA LUN-per-VDI driver: 
    SR plugin which represents Logical Units (LUs) as Virtual Disk Images (VDIs) sourced by host bus adapters (HBAs). E.g. hardware-based iSCSI or FC support.

  4. NetApp: 
    SR driver for mapping of LUNs to VDIs on a NETAPP server, providing use of fast snapshot and clone features on the filer.

  5. LVHD over FC: 
    SR plugin which represents disks as VHDs on Logical Volumes within a Volume Group created on an HBA LUN. E.g. hardware-based iSCSI or FC support.

  6. iSCSI: 
    Base ISCSI SR driver, provides a LUN-per-VDI. Does not support creation of VDIs but accesses existing LUNs on a target.

  7. LVHD over iSCSI: 
    SR plugin which represents disks as Logical Volumes within a Volume Group created on an iSCSI LUN.

  8. EqualLogic: 
    SR driver for mapping of LUNs to VDIs on a EQUALLOGIC array group, providing use of fast snapshot and clone features on the array.

2013年4月11日 星期四

2013年4月9日 星期二

2013年3月31日 星期日

pif-plug vs pif-unplug


pif-plug
Attempt to bring up the specified physical interface

pif-unplug
Attempt to bring down the specified physical interface

2013年3月29日 星期五

2013年3月28日 星期四

Host Internal Management Network



Host Internal Management Network

此主機內部管理網路是用來銜接dom0與domU之間溝通用的網路。在主機加入Resource Pool時就會由Citrix Xenserver自行產生,此網路是只用來內部溝通用,不會連結到外部網路,所以不會連接到pif。




uuid ( RO)                : 85926476-fa05-2071-22e9-1900a21e6161
name-label ( RW): Host internal management network
name-description ( RW): Network on which guests will get assigned a private link-local IP address
VIF-uuids (SRO):
PIF-uuids (SRO):
MTU ( RW): 1500
bridge ( RO): xapi2
other-config (MRW): is_guest_installer_network: true; is_host_internal_management_network: true; ip_begin: 169.254.0.1; ip_end: 169.254.255.254; netmask: 255.255.0.0
blobs ( RO):
tags (SRW):