vagrant on softlayer

Download Vagrant on SoftLayer

Post on 10-Jan-2017

1.241 views

Category:

Technology

8 download

Embed Size (px)

TRANSCRIPT

  • Japan SoftLayer User Group

    VagrantSoftLayer

    2016.3.4

  • IT

    SoftLayer

    SoftLayer

    @y_tama

    2016/2/26

  • vagrant up() / destroy() / halt() / rebuild() etc

    RubyOSS

    Virtualbox

    SoftLayer, AWS, VMware

    vagrant up

    Mitchell Hashimoto2010Vagrant ver0.1

    2012Hashicorp (Vagrant, Packer, Consul, Serf etc)

    Vagrant

  • SoftLayer

    CentOS

    SSH

    API

    SoftLayer APIOS Image Image Template

    SoftLayer

    vagrant up

    vagrant ssh

    SSH

    IDAPI

  • SoftLayerIDAPI

    ID

    API

  • SSH

    SSH(Linuxssh-keygen

    )

  • ()

    Vagrant

    # rpm -ivh https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.rpm

    SoftLayer

    # vagrant plugin install vagrant-softlayer

    [root@vagrant01 ~]# vagrant plugin install vagrant-softlayer

    Installing the 'vagrant-softlayer' plugin. This can take a few minutes...

    Installed the plugin 'vagrant-softlayer (0.4.0)'!

    [root@vagrant01 ~]# vagrant list

    vagrant-share (1.1.5, system)

    vagrant-softlayer (0.4.0)

    [root@vagrant01 ~]#

  • (Vagrantfile)SoftLayer

    README: https://github.com/audiolize/vagrant-softlayer/blob/master/README.md

    config.vm.provider :softlayer do | sl, override |sl.api_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"sl.username = xxxxxxxx"sl.datacenter = che01sl.dedicated = falsesl.domain = "softlayer.comsl.disk_capacity = { 0 => 25 }

    # sl.private_only = truesl.force_private_ip = truesl.hostname = "vagrant03"sl.hourly_billing = truesl.image_guid = nilsl.local_disk = falsesl.max_memory = 1024sl.network_speed = 100sl.operating_system = "CENTOS_LATEST"sl.ssh_key = [ "tamatest_key" ]sl.start_cpus = 1

    override.ssh.username = "root"end

    DC1/1GB/25GB/100Mbps NIC/

    CentOS

    vagrant03.softlayer.com

    SoftLayerIDAPI

    Private IP

    Private IP

    https://github.com/audiolize/vagrant-softlayer/blob/master/README.md

  • vagrant up

    [root@vagrant01 vagrant]# vagrant up

    Bringing machine 'default' up with 'softlayer' provider...

    ==> default: Creating a new SoftLayer instance...

    ==> default: Waiting for instance provisioning. This may take a few minutes...

    ==> default: SoftLayer instance successfully provisioned!

    ==> default: Waiting for machine to boot. This may take a few minutes...

    ()

    ==> default: Machine booted and ready!

    [root@vagrant01 vagrant]# vagrant ssh

    [root@vagrant03 ~]#

  • ID(guid)

    # slcli image list

    :......................................:....................................................:....................:............:.........:

    : guid : name : type : visibility : account :

    :......................................:....................................................:....................:............:.........:

    : 719113ed-c060-43f3-8c5c-8889f8b4df01 : 25GB - Ubuntu / Ubuntu / 14.04-64 Minimal for VSI : System : Public : 208938 :

    : b14a49a2-648b-4cea-9194-17120e98138f : 25GB - Ubuntu / Ubuntu / 12.04-64 Minimal for VSI : System : Public : 208938 :

    : 2402ec54-6dd8-4391-846a-772406fa76cd : 25GB - Redhat / EL / 5.5-64 Minimal for VSI : System : Public : 208938 :

    : 56c35934-1caa-408f-9e38-b36e4368e3b7 : 100GB - Ubuntu / Ubuntu / 14.04-32 Minimal for VSI : System : Public : 208938 :

    : 0e4b036f-8287-4ff9-ac9b-77883c245e49 : 100GB - Redhat / EL / 5.5-32 Minimal for VSI : System : Public : 208938 :

    : f5d6c60f-d6cf-4d0b-a424-5e661e2dea47 : 100GB - Debian / Debian / 8.0.0-64 Minimal for VSI : System : Public : 208938 :

    Public=Private=

    slcli

  • config.vm.provider :softlayer do | sl, override |sl.api_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"sl.username = xxxxxxxx"sl.datacenter = sea01"sl.dedicated = falsesl.domain = "softlayer.com"sl.disk_capacity = { 0 => 25 }sl.force_private_ip = truesl.hostname = "vagrant03"sl.hourly_billing = truesl.image_guid = 719113ed-c060-43f3-8c5c-8889f8b4df01sl.local_disk = falsesl.max_memory = 1024sl.network_speed = 100sl.operating_system = nilsl.ssh_key = [ "tamatest_key" ]sl.start_cpus = 1

    override.ssh.username = "root"end

    OSNIL(guid)

    ID(guid)

  • [root@vagrant01 vagrant]# vagrant upBringing machine 'default' up with 'softlayer' provider...==> default: Creating a new SoftLayer instance...==> default: Waiting for instance provisioning. This may take a few minutes...==> default: SoftLayer instance successfully provisioned!==> default: Waiting for machine to boot. This may take a few minutes...==> default: Machine booted and ready![root@vagrant01 vagrant]# vagrant sshWelcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-65-generic x86_64)

    * Documentation: https://help.ubuntu.com/root@vagrant03:~#

    ID(guid)

  • Vagrantshell provision

    vagrant up

    iptablesOS etc

    SoftLayerProvisioning scriptHTTPS

    Vagrant

    Vagrantfile

    config.vm.provision :shell, :path => "./provisioning.sh",:privileged => true

    #!/bin/sh

    # yum update all

    yum -y update

    # install apach webserver

    yum install -y httpd

    service httpd start

    chkconfig httpd on

    OS

  • Vagrantchef()

    OS Development Tools

    Chef Development Kit chef, ruby, gem

    Vagrantvagrant-omnibusvagrant-chef-zero

    Berksfile

    Cookbook(berks vendor cookbooks)

    Vagrantfilechef

    config.vm.provision "chef_zero" do |chef|

    # Specify the local paths where Chef data is stored

    chef.cookbooks_path = "./chef-repo/cookbooks"

    chef.roles_path = "./chef-repo/roles"

    chef.nodes_path = "./chef-repo/cookbooks"

    # Add a recipe

    chef.add_recipe "apache2"

    end

    [root@vagrant01 chef-repo]# cat Berksfile

    source "https://supermarket.chef.io"

    cookbook 'apache2'

    [root@vagrant01 chef-repo]#

  • Vagrantchef()

    vagrant upchef

    VagrantChef

    OSchef

    recipe

  • VagrantSoftLayer

    http://niccloud.niandc.ne.jp/?p=749

    SoftLayer Tips SSH

    https://ibm.biz/BdH4Yu

    Vagrant Chef VirtualBox

    https://www.ogis-ri.co.jp/otc/hiroba/technical/vagrant-chef/chap1.html

    Vagrant + Chef zero + Berkshelf

    http://qiita.com/tsuyopooon/items/d90679d9f8b5ccfcfde5

    Chef Zero Provisioner

    https://www.vagrantup.com/docs/provisioning/chef_zero.html

    Error: Missing required value for `chef.nodes_path'.

    https://github.com/r8/vagrant-lamp/issues/134

    https://www.change-makers.jp/post/10352

    http://niccloud.niandc.ne.jp/?p=749https://ibm.biz/BdH4Yuhttps://www.ogis-ri.co.jp/otc/hiroba/technical/vagrant-chef/chap1.htmlhttp://qiita.com/tsuyopooon/items/d90679d9f8b5ccfcfde5https://www.vagrantup.com/docs/provisioning/chef_zero.htmlhttps://github.com/r8/vagrant-lamp/issues/134https://www.change-makers.jp/post/10352

  • IBMIBM IBMIBM

    IBMIBMIBM IBM

    IBM

    IBM, IBM ibm.com, SoftLayerInternational Business Machines Corporation

    IBM

    IBM www.ibm.com/legal/copytrade.shtml