Wednesday, May 29, 2013

Centos in a proxy enviroment

I use centos in work, behind a proxy that uses NTLM auth.

some tips;


  1. install CNTLM, which access a proxy to NTLM proxies :-) configure it so it listens for localhost connections
    • /etc/cntlm.conf
      • Username        username
      • Domain          domain
      • Password        password
      • Proxy           upstream.proxy.addr:8080
      • NoProxy         localhost, 172.18.32.*, 127.0.0.*, 10.*, 192.168.*
      • Listen          3128
      • Gateway yes
      • Allow           127.0.0.1
      • Deny            0/0
  2. edit yum.conf
    • echo "proxy=http://127.0.0.1:3128" >> /etc/yum.conf
  3. edit maven settings.xml
    • /usr/local/apache-maven-3.0.5/conf/settings.xml
  <proxies>
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>127.0.0.1</host>
      <port>3128</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
  </proxies>
                    1. setup git
                      • git config --global http.proxy http://127.0.0.1:3128
                    2. setup your shell (wget etc)
                      • http_proxy="http://127.0.0.1:3128"
                      • export http_proxy


                    Tuesday, May 28, 2013

                    Cloudstack 4.0.2 with vsphere integration and netscaler integration



                    Based on a clean install of CentOS-6.4-x86_64-minimal.iso , this step builds the RPM's and shares them via apache as a repo to install.
                    ---
                    /etc/init.d/iptables stop
                    yum groupinstall "Development Tools"
                    yum install unzip createrepo ws-commons-util wget java-1.6.0-openjdk-devel.x86_64 ant ant-jdepend genisoimage mysql mysql-server ws-common-utils MySQL-python tomcat6 httpd.x86_64
                    wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
                    tar -zxvf apache-maven-3.0.5-bin.tar.gz
                    mv apache-maven-3.0.5 /usr/local/
                    export PATH=/usr/local/apache-maven-3.0.5/bin:$PATH
                    wget http://www.us.apache.org/dist/cloudstack/4.0.2/apache-cloudstack-4.0.2-src.tar.bz2
                    bunzip2 apache-cloudstack-4.0.2-src.tar.bz2
                    tar -xvf apache-cloudstack-4.0.2-src.tar
                    cd apache-cloudstack-4.0.2-src/deps
                    wget http://zooi.widodh.nl/cloudstack/build-dep/cloud-iControl.jar
                    wget http://zooi.widodh.nl/cloudstack/build-dep/cloud-manageontap.jar
                    wget http://zooi.widodh.nl/cloudstack/build-dep/vmware-vim.jar
                    wget http://zooi.widodh.nl/cloudstack/build-dep/vmware-vim25.jar
                    wget http://zooi.widodh.nl/cloudstack/build-dep/vmware-apputils.jar
                    wget http://community.citrix.com/download/attachments/37847122/cloud-netscaler-jars.zip
                    unzip cloud-netscaler-jars.zip
                    #now we are ready, lets build
                    ./install-non-oss.sh
                    cd ../vmware-base/
                    mvn install 
                    cd ..
                    mvn -D nonoss -P deps
                    wget http://people.apache.org/~jzb/cloudstack/dist/releases/4.0.2/nonoss.cloud.spec
                    cp nonoss.cloud.spec cloud.spec
                    #Build RPM's and share as repo
                    ./waf rpm
                    cd artifacts/rpmbuild/RPMS/x86_64
                    createrepo ./
                    mkdir /var/www/html/cloudstack
                    cp -R * /var/www/html/cloudstack/
                    apachectl start
                    ---

                    Now the RPM's are built and shared, time to setup the actual server

                    vi /etc/yum.repos.d/cloudstack.repo
                    # put in the repo info as http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/Installation_Guide/configure-package-repository.html#configure-package-repository-rpm
                    yum update
                    yum install cloud-server cloud-client mysql-server
                    #edit /etc/my.cnf as per docs
                    mysql_secure_installation
                    setenforce permissive
                    cloud-setup-databases cloud:secretpassword@localhost --deploy-as=root:password
                    cloud-setup-management


                    and open in your browser http://ip:8080/client

                    installing cloudstack with ubuntu server

                    after a fresh install of  ubuntu 12.04

                    using http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.0-incubating/html-single/Installation_Guide/#management-server-installation-overview

                    works out like this

                    1. echo "deb http://cloudstack.apt-get.eu/ubuntu precise 4.0" > /etc/apt/sources.list.d/cloudstack.list
                    2. wget -O - http://cloudstack.apt-get.eu/release.asc|apt-key add -
                    3. apt-get update
                    4. apt-get install cloud-client-ui
                    5. apt-get install mysql-server nfs-kernel-server
                    6. cloud-setup-databases cloud:secret --deploy-as=root:password
                    7. cloud-setup-management



                    now go to  http://server:8080/client/ and login as admin/password


                    you should read the manual and do nfs etc like this
                    1. mkdir -p /export/primary
                    2. mkdir -p /export/secondary
                    3. echo "/export *(rw,async,no_root_squash)" >> /etc/exports
                    4. exportfs -a
                    5. put this into /etc/default/nfs-kernel-server
                    LOCKD_TCPPORT=32803
                    LOCKD_UDPPORT=32769
                    MOUNTD_PORT=892
                    RQUOTAD_PORT=875
                    STATD_PORT=662
                    STATD_OUTGOING_PORT=2020
                    1.  /etc/init.d/nfs-kernel-server restart
                    2. mkdir -p /mnt/primary /mnt/secondary
                    3. mount -v -t nfs ubuntu:/export/secondary /mnt/secondary
                    4. mount -v -t nfs ubuntu:/export/primary /mnt/primary
                    5. /usr/lib/cloud/common/scripts/storage/secondary/cloud-install-sys-tmplt  -m /mnt/secondary -u http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2 -h kvm -F
                        you can run kvm on the box too if you want https://help.ubuntu.com/community/KVM/Installation

                        sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
                        optionally sudo modprobe kvm
                        optionally sudo adduser `id -un` libvirtd