Wednesday, June 24, 2015

Add new hard disk partition to ubuntu guest

install by force after dpkg dependency problem

You can fix this by installing missing dependencies.
Just run the following command
(after you have run sudo dpkg -i google-chrome-stable_current_i386.deb).
sudo apt-get install -f
This will install missing dependencies and configure Google Chrome for you.

MBR or GPT

MBR works with disks up to 2 TB in size, but it can’t handle disks with more than 2 TB of space. MBR also only supports up to four primary partitions — if you want more, you have to make one of your primary partitions an “extended partition” and create logical partitions inside it. This is a silly little hack and shouldn’t be necessary

GPT allows for a nearly unlimited amount of partitions, and the limit here will be your operating system — Windows allows up to 128 partitions on a GPT drive, and you don’t have to create an extended partition

Fdisk does not work for gpt, currently. But parted does. Or you can just easily install gdisk.

Over 1.5TB (if drive is unpartitioned) or is UEFI it defaults to gpt, otherwise it defaults to MBR

Prepare a MBR partition table
         #list new hard disk device for MBR
         fdisk -l
         #Partition type has to be primary
         fdisk /dev/sdb
       

Prepare a GPT partition table
$ sudo parted -l
sudo parted /dev/sda
#MBR DISK
(parted)mklabel msdos 
#GPT DISK
(parted)mklabel gpt  
 (parted)mkpart primary xfs 0 100%
 (parted) quit

mkfs -t xfs /dev/sdb1



#verify the file system mounted
cat /proc/mount

#find all block devices
ls /sys/block

#block device attribute
blkid


Mount swift disk automatically at system boot with Upstart script
$cat /opt/swift/bin/mount_devices

mount -t xfs -o noatime,nodiratime,logbufs=8 /dev/sdb1 /srv/node/d1

$chmod +x /opt/swift/bin/mount_devices

$mkdir -p /srv/node/b1

$chown -R swift:swift /srv/node

Next, create an Upstart script in the /etc/init directory called start_swift.conf with the following commands:

description "mount swift drives"
start on runlevel [234]
stop on runlevel [0156]
exec /opt/swift/bin/mount_devices



10 Ways to Generate a Random 32 byte strings from the Command Line

date +%s | sha256sum | base64 | head -c 32 ; echo
openssl rand -base64 32

[swift-hash]
swift_hash_path_suffix = head -c 64 /dev/random | base64
swift_hash_path_prefix = head -c 64 /dev/random | base64



Creating the Log Configuration File

Create a configuration file named 0-swift.conf in the /etc/rsyslog.d directory. It will contain
one line:
local0.* /var/log/swift/all.log
Since we just created a script that will tell the system to log the all.log file in the directory
/var/log/swift, we will need to create that directory and set the correct permissions
on it.
This command will create the directory the log files will be created in:

mkdir /var/log/swift
You also need to set permissions on the directory so the log process can write to it. For
instance, the following commands do this on Ubuntu:
chown -R syslog.adm /var/log/swift
chmod -R g+w /var/log/swift

Tuesday, June 23, 2015

openstack KILO Minimal deployment with neutron on VMs

Controller config:
https://drive.google.com/open?id=0BzMCYv5KIAi-Yko1NURtU0FVcFE&authuser=0

Network config(flat+GRE):
https://drive.google.com/open?id=0BzMCYv5KIAi-eTJqT01TeFkwX1k&authuser=0

Compute config:
https://drive.google.com/open?id=0BzMCYv5KIAi-N2tCb18tV1lQMTA&authuser=0





If you are building your OpenStack nodes as virtual machines, you must configure
the hypervisor to permit promiscuous mode on the external network
auto eth0
iface eth0 inet manual
up ip link set dev $IFACE up
up ip link set $IFACE promisc on
down ip link set $IFACE promisc off
down ip link set dev $IFACE down
allow-hotplug br-ex
iface br-ex inet static
        bridge_ports eth0
        address 16.157.134.232
        netmask 255.255.248.0
        gateway 16.157.128.1




soauser ALL=(ALL) NOPASSWD: ALL

By default, the SSH server denies password-based login for root. In /etc/ssh/sshd_config, change:


PermitRootLogin without-password
to
PermitRootLogin yes
And restart SSH:
sudo service ssh restart

rabbitmqctl change_password  openstack admin


apt-get install keystone python-openstackclient apache2 libapache2-mod-wsgi memcached python-memcache

Note: openstack client will not work in proxy envrionment

export no_proxy=localhost,127.0.0.1,controller,nova,neutron

$mysql -u root -p
SET PASSWORD FOR 'keystone'@'localhost' = PASSWORD('admin');
SET PASSWORD FOR 'keystone'@'%' = PASSWORD('admin');


For security reasons, disable the temporary authentication token mechanism:
Edit the /etc/keystone/keystone-paste.ini file and remove
admin_token_auth from the [pipeline:public_api],
[pipeline:admin_api], and [pipeline:api_v3] sections.


The Identity version 3 API adds support for domains that contain projects and users.
Projects and users can use the same names in different domains. Therefore, in order
to use the version 3 API, requests must also explicitly contain at least the default domain
or use IDs. For simplicity, this guide explicitly uses the default domain so examples
can use names instead of IDs.
$ openstack --os-auth-url http://controller:35357 \
--os-project-domain-id default --os-user-domain-id default \
--os-project-name admin --os-username admin --os-auth-type password \



You can store virtual machine images made
available through the Image service in a variety of locations, from simple file systems to object-
storage systems like OpenStack Object Storage.


https://bugs.launchpad.net/openstack-manuals/+bug/1453534(logdir -> log_dir)


Following the external network subnet, the tenant router gateway should occupy the lowest IP address in the floating IP address
range,




/etc/neutron/plugins/ml2/ml2_conf.ini(on every compute to config tunnel network)
In the [ovs] section, enable tunnels and configure the local tunnel endpoint:
[ovs]
...
local_ip = INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS
Replace INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS with the IP address of
the instance tunnels network interface on your compute node.
e. In the [agent] section, enable GRE tunnels:
[agent]
...
tunnel_types = gre



sed '/^$/d' neutron.conf >neutron-remove-empty-line.conf
sed '/^#/d' neutron.conf >neutron-remove-line-start-with#.conf

Edit the /etc/neutron/l3_agent.ini file and complete the following actions:

[DEFAULT]
...
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
external_network_bridge =
router_delete_namespaces = True
The external_network_bridge option intentionally lacks a value
to enable multiple external networks on a single agent.
b. (Optional) To assist with troubleshooting, enable verbose logging in the

http://bderzhavets.blogspot.com/2014/10/forwarding-packet-from-br-int-to-br-ex.html

Tuesday, March 17, 2015

Configure Wireless Networking in Ubuntu via the Command Line

First, you need to install the relevant software. You need to have a wired connection at this point, otherwise this wont work.
sudo apt-get install wireless-tools wpasupplicant
If you are connecting to an open network, you wont need wpasupplicant. Next, you need to “bring up” (essentially this means activate) your WiFi interface. So, issue:
sudo ifconfig wlan0 up
Next, to make sure your wireless device is working as it should issue:
iwconfig
and then
sudo iwlist scanwpa_passphrase YOURSSID YOURWIFIPASSWORD
This will result in something that looks like this:
network={
ssid="YOURSSID"
#psk="YOURWIFIPASSWORD"
psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1 5bbc6c52e7522f709a
}
sudo nano /etc/network/interfaces
sudo vi /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant                        ctrl_interface_group=0

eapol_version=2
ap_scan=1
fast_reauth=1
country=NL

### Associate with any open access point
###  Scans/ESSID changes can be done with wpa_cli
network={
  ssid=""
  key_mgmt=NONE
  priority=1
}

# WEP
network={
  ssid="ubuntuwifi"
  scan_ssid=1
  key_mgmt=NONE
  wep_key0="OpenSesame"
  wep_key1="OpenOtherSesame"
  # Use the correct key..
  wep_tx_keyidx=0
  priority=5
}

# WPA/WPA2
network={
  ssid="ubuntuwifi"
  scan_ssid=1
  psk=24f87a7583001eb7cea2394bbdb04eb2d3641f0b907dd31bd286be628c1841f8
  priority=5
  ## The configuration items listed below do not need to be set, the defaults are
  ## pretty 'let us do it for you'.
  ## See /usr/share/doc/wpasupplicant/wpa_supplicant.conf.gz for more information.
  # key_mgmt=WPA-PSK
  # proto=WPA RSN
  # pairwise=CCMP TKIP
  # group=CCMP TKIP
}
start    WPA/WPA2
/sbin/wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0 -D  -B -f /var/log/wpa_supplicant.log

Saturday, March 14, 2015

Deploying Cloud Foundry on Helion OS

  1. Install the BOSH Command Line Interface

Prerequisites on Ubuntu Trusty

sudo apt-get install build-essential ruby ruby-dev libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev


  • Install the BOSH

  1. Prerequisites on Ubuntu Trusty
$sudo apt-get install build-essential ruby ruby-dev libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev

   2.   gem install bosh_cli bosh_cli_plugin_micro --no-ri --no-rdoc




  • Validate your OpenStack Instance
Create a ~/.fog file and copy the below content:
:openstack:
  :openstack_auth_url:  http://HOST_IP:5000/v2.0/tokens
  :openstack_api_key:   PASSWORD
  :openstack_username:  USERNAME
  :openstack_tenant:    PROJECT_NAME
  :openstack_region:    RegionOne# Optional
Install the fog application in your terminal, then run it in interactive mode:
$ gem install fog
$ fog openstack
>> Compute[:openstack].servers
[]
  • Create Security Groups for Cloud Foundry
  • Deploying MicroBOSH on Helion
  • Deploying Cloud Foundry  using BOSH


Friday, March 13, 2015

Disabling NetworkManager

According to this bug here's how to disable Network Manager without uninstalling it:
Stop network manager
sudo stop network-manager
Create an override file for the upstart job:

echo "manual" | sudo tee /etc/init/network-manager.override

sudo vi /etc/resolvconf/resolv.conf.d/base
nameserver 16.110.135.51
nameserver 16.110.135.52

sudo resolvconf -u



sudo without passwd
soauser ALL=(ALL) NOPASSWD: ALL



vi /etc/hostname
sudo service hostname restart



By default, the SSH server denies password-based login for root. In /etc/ssh/sshd_config, change:


PermitRootLogin without-password
to
PermitRootLogin yes
And restart SSH:
sudo service ssh restart



route add   SIOCADDRT: Invalid argument





Using Virtual Ethernet Adapters in Promiscuous Mode

Guest vm can't ping through the host , but can't ping through gateway

go to network ->adapter setting -> Local connection ->Properties ->uncheck mcafee ndis intermediate filter miniport(or select it then uninstall it)


The vm net network internet is back again


Using Virtual Ethernet Adapters in Promiscuous Mode on a Linux Host





Thursday, March 12, 2015

NeutronApiService

During the building of the NeutronApiService, the _run_wsgi function creates a WSGI application using the load_paste_app function inside config.py - which parsesapi-paste.ini - in order to create a WSGI app using Paste‘s deploy.
The api-paste.ini file defines the WSGI applications and routes - using the Paste INI file format.
The INI file directs paste to instantiate the APIRouter class of Neutron, which contains several methods that map Neutron resources (such as Ports, Networks, Subnets) to URLs, and the controller for each resource.