Pages

Sunday, May 31, 2015

Jenkins Starting issue.


Issue with starting
===================
Note: if you get the following error message, ensure that Java has been installed:
Starting jenkins (via systemctl):  Job for jenkins.service failed. See 'systemctl status jenkins.service' and 'journalctl -xn' for details                                            [FAILED]


Check for the tmp directory and if the noexec is enabled on the /tmp, try disabling it.

mount -o remount,exec /tmp

Other way around is by selecting another tmp directory

Edit /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djava.io.tmpdir=$JENKINS_HOME/tmp"

We can get the Jenkins from URL
http://xxx.xxx.xxx.xxx:8080/jenkins/

Wednesday, May 27, 2015

Jenkins Integration/Automation Tools

Integration/Automation tool
==================
Jenkins is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute with Oracle. Jenkinsprovides continuous integration services for software development. It is a server-based system running in a servlet container such as Apache Tomcat

Installing Jenkins Latest Version
=================================
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

Installation of a stable version
===========================================================
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

Installation of Java
====================
yum install java-1.7.0-openjdk
yum install java-1.7.0*

Start/Stop The Jenkins Services
===============================
service jenkins start/stop/restart
chkconfig jenkins on
/etc/init.d/jenkins
Usage: /etc/init.d/jenkins {start|stop|status|try-restart|restart|force-reload|reload|probe}

Enable the firewall
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
firewall-cmd --list-all

Friday, May 8, 2015

Openstack KVM libvirtError: internal error: no supported architecture for os type 'hvm'

Nova Error Log
===========
2015-05-06 16:50:22.982 1187 ERROR nova.compute.manager [-] [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545] Instance failed to spawn
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545] Traceback (most recent call last):
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2246, in _build_resources
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     yield resources
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2116, in _build_and_run_instance
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     block_device_info=block_device_info)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 2622, in spawn
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     block_device_info, disk_info=disk_info)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4425, in _create_domain_and_network
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     power_on=power_on)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4349, in _create_domain
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     LOG.error(err)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     six.reraise(self.type_, self.value, self.tb)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4333, in _create_domain
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     domain = self._conn.defineXML(xml)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 183, in doit
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     result = proxy_call(self._autowrap, f, *args, **kwargs)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 141, in proxy_call
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     rv = execute(f, *args, **kwargs)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 122, in execute
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     six.reraise(c, e, tb)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 80, in tworker
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     rv = meth(*args, **kwargs)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3445, in defineXML
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]     if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545] libvirtError: internal error: no supported architecture for os type 'hvm'
2015-05-06 16:50:22.982 1187 TRACE nova.compute.manager [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545]
2015-05-06 16:50:22.987 1187 WARNING nova.virt.libvirt.driver [-] [instance: fdc97e3f-25f0-4d4d-b649-4a6d4aff8545] During wait destroy, instance disappeared


Fix
===#IF we need to enable qemu
openstack-config --set /etc/nova/nova.conf DEFAULT libvirt_type qemu
openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu

Tuesday, April 28, 2015

Libvirtd Error after Package Update

We were getting following error after package for libvirtd got updated to 1.2.8


Apr 28 12:18:04 compute1 libvirtd[12294]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
Apr 28 12:18:04 compute1 libvirtd[12294]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so: undefined symbol: virStorageFileCreate
Apr 28 12:18:04 compute1 libvirtd[12294]: Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
Apr 28 12:18:04 compute1 systemd[1]: Started Virtualization daemon.
Apr 28 12:19:01 compute1 libvirtd[12294]: no connection driver available for qemu:///system
Apr 28 12:19:01 compute1 libvirtd[12294]: End of file while reading data: Input/output error
Apr 28 12:23:42 compute1 libvirtd[12294]: no connection driver available for qemu:///system
Apr 28 12:23:42 compute1 libvirtd[12294]: End of file while reading data: Input/output error
Apr 28 12:23:42 compute1 libvirtd[12294]: no connection driver available for qemu:///system
Apr 28 12:23:42 compute1 libvirtd[12294]: End of file while reading data: Input/output error


Solution for this was to update the device-mapper diver and restart the services.

yum update device-mapper

Similar issue : https://bugzilla.redhat.com/show_bug.cgi?id=1164773

Friday, April 24, 2015

Updating CA certificates in Fedora/Centos/RHEL

On Fedora since 19, RHEL / CentOS 7, and RHEL / CentOS 6  the correct method is to place the certificate to be trusted (in PEM format) in /etc/pki/ca-trust/source/anchors/ and run sudo update-ca-trust.
 (If the certificate is in OpenSSL’s extended BEGIN TRUSTED CERTIFICATE format, place it in /etc/pki/ca-trust/source). On RHEL 6, you have to activate the system with update-ca-trust enable after installing the update.

Thursday, April 23, 2015

Mysql Engine Swap MyISam to InnoDB and InnoDB to MyISam



To convert all tables in a database from InnoDB to MyISAM, run the MySQL following command, replacing db_name with the database name in question:


mysql -e "SELECT concat('ALTER TABLE ', TABLE_NAME,' ENGINE=MYISAM;') FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'db_name' AND ENGINE = 'InnoDB' AND TABLE_TYPE = 'BASE TABLE'"

Then, after stopping MySQL, you want to get the ibdata* and ib_logfiles out of the way:

Code:
/etc/init.d/mysql stop
mkdir -p /root/innodb.bak
mv ib* /root/innodb.bak/
/etc/init.d/mysql start

Now you've got MySQL started up with the tables using MyISAM, and it's time to get them converted back to InnoDB, fingers crossed (again replace db_name with your database name):

mysql -e "SELECT concat('ALTER TABLE ', TABLE_NAME,' ENGINE=InnoDB;') FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'db_name' AND ENGINE = 'MyISAM'"

Tuesday, April 21, 2015

Enabling Instance resizing In Openstack Juno


Editing Configuration
#Run on ALL Compute Server and Contoller Server

sed -i "s/#allow_resize_to_same_host.*/allow_resize_to_same_host=true/g" /etc/nova/nova.conf
sed -i "s/#allow_migrate_to_same_host.*/allow_migrate_to_same_host=true/g" /etc/nova/nova.conf

Configure the nova user
usermod -s /bin/bash nova

And enable password less authentication between Nova user’s in all server’s.

To Create Public and Private key for the user
ssh-keygen

To Copy the Public key to other users
ssh-copy-id <To all Server’s>

Add the Following Configruation file under Nova User in Every Server which has a Nova User
su - nova
cat << EOF > ~/.ssh/config
Host *
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null
EOF