iDatamining.org

Saturday, November 1, 2014

prepare Azure management certification for Vagrant


On Linux


  • Creating certification
    1. openssl genrsa -out azureMgt.key 2048
    2. openssl req -new -key azureMgt.key -out azureMgt.csr
    3. openssl x509 -req -days 730 -in azureMgt.csr -signkey azureMgt.key -out tempAzureMgt.pem
    4. cat azureMgt.key tempAazureMgt.pem > azureMgt.pem
    5. openssl x509 -inform pem -in azureMgt.pem -outform der -out azureMgt.cer
    6. openssl pkcs12 -export -out azureMgt.pfx -in azureMgt.pem -inkey azureMgt.key -name "Azure Certification"
  • Uploading file azureMgt.cer to Azure management portal
  • Using file azureMgt.pem on your azure client side. for example, using this file in Vagrant (the pfx format has problem based on my testing).
  • Generating SSH key for vagarant to launch VM on azure.
    1. openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -keyout azuresshkey.key -out azuresshcert.pem
    2. Change the permissions on the private key and certificate for security. chmod 600 azuresshcert.pem ; chmod 600 azuresshkey.key
    3. azuresshcert.pem is vm's ssh certifiction. azuresshkey.key is the ssh key that we use to access VM

On Windows

work on this later. 

Monday, October 6, 2014

install vagrant on CentOS


[root@vmhost01 vagrant]# wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.rpm

[root@vmhost01 vagrant]# yum install vagrant_1.6.3_x86_64.rpm 

[root@vmhost01 vagrant]# vagrant plugin install vagrant-mutate

[root@vmhost01 vagrant]# mkdir /vm1/vm10

[root@vmhost01 vagrant]# cd /vm1/vm10

[root@vmhost01 vm10]# vagrant box add centos65 http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-puppet.box
==> box: Adding box 'centos65' (v0) for provider: 
    box: Downloading: http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-puppet.box
==> box: Successfully added box 'centos65' (v0) for 'virtualbox'!

[root@vmhost01 vm10]# vagrant mutate centos65 libvirt
You have qemu 0.12.1 installed. This version cannot read some virtualbox boxes. If conversion fails, see below for recommendations. https://github.com/sciurus/vagrant-mutate/wiki/QEMU-Version-Compatibility
Converting centos65 from virtualbox to libvirt.
    (98.57/100%)
The box centos65 (libvirt) is now ready to use.
[root@vmhost01 vm10]# pwd
/opt/vm1/vm10
[root@vmhost01 vm10]# vagrant init centos65
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

[root@vmhost01 vm10]# vagrant plugin install vagrant-libvirt  --plugin-version 0.0.19


[root@vmhost01 vm10]#  vagrant up --no-parallel

http://spin.atomicobject.com/2013/06/03/ovf-virtual-machine/ https://ttboj.wordpress.com/2014/05/13/vagrant-on-fedora-with-libvirt-reprise/ https://ttboj.wordpress.com/2013/12/09/vagrant-on-fedora-with-libvirt/