Install LSI MegaRAID Storage Manger on Proxmox

1: Install MegaRaid CLI

Add repo

edit /etc/apt/sources.list add the entry

deb jessie main

here i am installing on debian (promox in debian based) and jessie version (proxmox 4.4.1)

Then save the file and run the below command to trust or sign the above site.

wget -O - | apt-key add -

run the command

#apt-get install megacli

2: Download the Megaraid Storage Manager

unzip it you will have file called MSM_linux_x64_installer-16.11.00-03.tar.gz  untar using tar command

# tar -xf /pathTo/MSM_linux_x64_installer-16.11.00-03.tar.gz
# cd disk

if alien is not installed run this command for installing alien, which convert the rpm to deb format

# apt-get install alien
# alien --scripts *.rpm

3: Install the below two deb’s by running these commands

#dpkg --install lib-utilsXXXXXX_all.deb

#dpkg -i megaraid-storage-manager_XXXXX_all.deb

if everything is fine you have to start the service by running the below command

/etc/init.d/vivaldiframeworkd start 

4: Now connect from your RAID Storage Manager which is installed on the Windows system

Source: Proxmox Forum Edd



Trying to run a Java application on your Mac and need to set your JAVA_HOME?  Follow the instructions below to quickly and easily do it:

  • Open Terminal
  • Confirm you have JDK by typing “which java”. It should show something like /usr/bin/java.
  • Check you have the needed version of Java, by typing “java -version”.
    • JAVA_HOME is essentially the full path of the directory that contains a sub-directory named bin which in turn contains the java.
    • For Mac OSX – it is /Library/Java/Home
  • Set JAVA_HOME using this command in Terminal: export JAVA_HOME=


  • echo $JAVA_HOME on Terminal to confirm the path
  • You should now be able to run your application

Note that this sets JAVA_HOME only for this session. If you want it to persist, you will have to add the command to your ~/.profile file.  Below are instructions on how to accomplish this instead:

  • Open up (Applications >> Utilities >> Terminal)
  • Type: emacs .profile
  • add this to the end of the .profile file:

export JAVA_HOME;

  • Save and exit emacs (ctrl-x, ctrl-s; ctrl-x, ctrl-c)
  • Open a new Terminal window (cmd-n) and type: $JAVA_HOME/bin/java -version

If you see something like:

java version “1.8.0_101”

Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Then you’ve successfully set your JAVA_HOME environment variable to the binary stored in /Library/Java/JavaVirtualMachines/jdk.jdk/Contents/Home


Remove old GRUB from Ubuntu

I have given 200MB of the space to /boot partition while creating the VM which is very less.

After some upgrades the /boot partition became out of space, because of this OS started crashing. One fine day i need to move this VM to another node i copied it using


command. Then the VM was not starting it gave the message as

kernel panic – kernel panic not syncing vfs unable to mount root fs on unknown-block 0 0 – error

started googleing the problem, what else i can do 😉 i came accross a blog where same issue is slove here.

he says the /boot partition is full, so need to remove old grub. because i dont want to increase hdd size.

1: Restart the vm or computer into the Grub2 menu then choose “Advanced options for ubuntu”

2: Once you go into the advanced boot menu you will likely see several kernels listed. Choose the next-oldest kernel from the top/highest version of kernels.

3: Open terminal and check your current kernel: from command

#uname -a

DO NOT REMOVE THIS KERNEL! Make a note of the version in notepad or something.

4: Next, type the command below to view/list all installed kernels on your system.

dpkg --list | grep linux-image

Find all the kernels that lower than your current kernel. When you know which kernel to remove, continue below to remove it. Run the commands below to remove the kernel you selected.

sudo apt-get purge linux-image-x.x.x.x-generic


sudo apt-get purge linux-image-extra-x.x.x-xx-generic

Finally, run the commands below to update grub2

sudo update-grub2

Reboot your system.

sudo reboot




Proxmox : Web GUI not updating the Datacenter status

Problem with proxmox GUI and cluster management.
From one node of the cluster I saw on /var/log/syslog file that

 Apr 12 16:34:37 t1 pveproxy[2502]: proxy detected vanished client connection  

and when we access to the Web GUI of that node, Show Node ‘t1’ is down.
The solution is to simulate a reboot of all the machines without rebooting the VM on them.
So this is the sequence to launch on every node of the cluster, without some particular order

 /etc/init.d/cman restart  
 /etc/init.d/pvedaemon restart  
 /etc/init.d/pvestatd restart  
 /etc/init.d/pve-manager restart  
 /etc/init.d/pve-cluster restart  

Now, it works great.


Deploy the Java web application to HANA Cloud

Here we deploy the war directly to the SAP HCP( HANA Could Platform) not from the Eclipse. Yes they do have written some tools for eclipse where we can connect to HANA Could and we can deploy from the eclipse.

In this we see the steps to deploy the Java Web application to SAP HCP. You need to follow some steps while developing the Dynamic web application in eclipse follow the below post for

  1. Creating the Dynamic web application
  2. Creating the HANA Database
  3. Creating the HANA Datasource binding
  4. Configure HANA database with Hibernate + JPA

Here we use the trail HANA Cloud account so we can deploy only one application.

1: Login to the SAP HCP Cockpit

2: Click on the “Java Applications” from the left side Navigation panel.

3: Click on “Deploy Application”. if you already have one you can delete the application but need to stop the application before deleting.(Note : if the binding is already created select the check box to say not to delete the binding).

4: Select the war file


5: The name of the application will be generated automatically based on war file name.

6: Runtime has to select very carefully, check this link to chose Runtime, in our example we will use “Java Web Tomcat 7”

7: Other Things dont change, these are related to process and CPU’s other stuff we will not worry now.( even i dont know much about these, i have trail version 😦 ). these can be configured when we have licence in trail version they have some limitations.

8: Click “Deploy”, it will upload the .war file the it ask to start.

9. if you already have the data binding created you can start. Other wise just close.

10. To create binding follow the post last section.

11. Then Start the Application from SAP HCP Cockpit.



Hibernate + JPA + Spring-data-jpa + HANA Database

In my previous post we have created a HANA Database(Row) and we have created a Web application to create and see the Users with MySQL

Now lets change the application to work with HANA DB and In SAP HANA Cloud Platform.

1: We need to Access the Database Using JNDI Data Source, Change the Data Source Name as below in the (see the post User App With MySQL)

 public DataSource getDataSource() {
 final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();
 DataSource dataSource = dsLookup.getDataSource("jdbc/DefaultDB");
 return dataSource;

If You are using the HANA Cloud Trail Version we can create only one DataSource that is so the datasource name should be “jdbc/DefaultDB”, other name will not be considered. (Creating the Datasource Name(binding) for the HANA Database we will see in the next step).

2: Change the Hibernate Dialect in the hibProperties() method in the (see the post User App With MySQL)

Properties properties = new Properties();

Dialect is “org.hibernate.dialect.HANARowStoreDialect” Because we have created Row Databse.

hibernate.default_schema should be Database user name which we have created for the Database(refer my previous post ), because the HANA will create the Schema in the USERNAME. I think its only for Trail version.

3: We need to Create the (Data Source Bindings) for the HANA Database.

To do this first we need to deploy the Java application first. follow the post to Deploy the Java web application.

After deploying the application login to the SAP HANA Cloud Platform Cockpit

  1. Click on the “Databases & Schemas”, select the Database which you need to bind for this application
  2. Now we can see the overview screen
  3. Select “Data Source Bindings” from the left navigation panel.
  4. click on “New binding”binding
  5. Data source name Should be , see the Step 1.
  6. select the Java Application
  7. Give the user name which is created in the previous post.
  8. password for the User.

Need to restart the Java Application to take new binding.

Source Code

MySQL + Hibernate + spring-data-jpa + Java Config

Lets Create a Web based User Application (very Simple which has id and name) With following

  • Maven
  • Spring -MVC
  • spring-data-jpa
  • Hibernate
  • MySQL
  • JNDI

I use eclipse IDE to create a “Dynamic Web Application”

i have selected the “Dynamic web module” as  3.0 because i need to use this application to deploy in the SAP HANA Cloud, which is explained in next post


And i have configures the Maven project for the same See pom.xml

 <!-- Logging -->



Now Lets create the entity call User

package com.chiru.test.user;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

public class User {
private int id;
private String name;
//Getter and setters

The DAO which is using spring-data-jpa as below

package com.chiru.test.user;

import org.springframework.stereotype.Repository;

public interface UserDAO extends CrudRepository<User, Integer> {


Yes, That’s it.  power of spring-data-jpa

Now the Spring MVC Controller

package com.chiru.test.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

public class UserController {

 private UserDAO userDao;

 public ModelAndView getAllusers(ModelAndView modelAndView) {
 modelAndView.addObject("users", userDao.findAll());
 return modelAndView;

 public ModelAndView save(ModelAndView modelAndView) {
 return modelAndView;

 @RequestMapping(value = "/user/save", method = RequestMethod.POST)
 public ModelAndView save(@RequestParam(value = "userName") String userName, ModelAndView modelAndView) {
 User user = new User();
 modelAndView.addObject("userName", userName);
 return modelAndView;

And i will not put the code for the view part, you can download it.

Lets configure the Web application with the Spring Java Config

1: Configure the Web Application:

package com.chiru.test.config;


public class UserApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

 protected Class<?>[] getRootConfigClasses() {
 return new Class[] { SpringAppConfig.class,HibernateConfig.class};

 protected Class<?>[] getServletConfigClasses() {
 return null;

 protected String[] getServletMappings() {
 return new String[] { "/" };

2: Spring MVC configuration

package com.chiru.test.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;

public class SpringAppConfig {
 public InternalResourceViewResolver setupViewResolver() { 
 InternalResourceViewResolver resolver = new InternalResourceViewResolver(); 
 return resolver; 

3: Hibernate and JPA with JNDI Configuration.

package com.chiru.test.config;

import java.util.Properties;

import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;

public class HibernateConfig {
 public DataSource getDataSource() {
 final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();
 DataSource dataSource = dsLookup.getDataSource("jdbc/DefaultDB");
 return dataSource;
 public JpaTransactionManager transactionManager(
 EntityManagerFactory entityManagerFactory) {
 JpaTransactionManager transactionManager = new JpaTransactionManager();
 return transactionManager;
 public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
 LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = 
 new LocalContainerEntityManagerFactoryBean();
 .setJpaVendorAdapter(new HibernateJpaVendorAdapter());


 return entityManagerFactoryBean;
 private Properties hibProperties() {
 Properties properties = new Properties();
 return properties;

1: We have to enable the JPA Repository by giving the base packages, so all the @Entity will be scanned by spring for Persistance

2: We need to enable the Transaction manager

3: We are creating the Datasource which is from JNDI, The JNDI name is “jdbc/DefaultDB”, this will be configured in the web.xml and Tomcat’s contex.xml as below


 <description>DB Connection</description>


<Context ...>

4: Transaction Manager is configured (Spring-ORM)

5:Entity Manager for JPA (Spring-JPA)

6: Hibernate properties like default schema name, and dialect

So we can run this from eclipse.