Vagrant for real
-
Upload
michele-orselli -
Category
Software
-
view
196 -
download
1
Transcript of Vagrant for real
Vagrant for Real
Michele OrselliCTOIdeato
_orso_
micheleorselli ideatosrl
moideatoit
Riccardo FranconiSW EngineerIdeato
ricfrank
ricfrank ideatosrl
rfideatoit
httpmitchellhcomthe-tao-of-vagrant
1) clone repo
2) vagrant up
3) therersquos no 3
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Michele OrselliCTOIdeato
_orso_
micheleorselli ideatosrl
moideatoit
Riccardo FranconiSW EngineerIdeato
ricfrank
ricfrank ideatosrl
rfideatoit
httpmitchellhcomthe-tao-of-vagrant
1) clone repo
2) vagrant up
3) therersquos no 3
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
httpmitchellhcomthe-tao-of-vagrant
1) clone repo
2) vagrant up
3) therersquos no 3
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
1) clone repo
2) vagrant up
3) therersquos no 3
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Projectrsquos folders organization
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
project_dir -- vagrant -- project -- Vagrantfile
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
project_dir -- vagrant -- Vagrantfile -- www -- project1 -- project2 -- project3
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
vagrant plugin install HostsUpdater
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Virtualbox 22 min
VmWare 15 min
tip usevmware
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Virtualbox 22 mi
VmWare 15 min
tip usevmware
+30
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
use VmWare if you can
tip usevmware
(it will cost you a few $)
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
use nfs if you can
tip usenfs
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
vagrant plugin install vbguest
tip vbguest
keeps guest addition updated
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
IO logs cache
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
tip moveiofromshared
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
class public function
public function
tip moveiofromshared
+13-16
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
IO increase realpath cache
tip realpathcache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
tip realpathcache
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
realpath_cache_size realpath_cache_ttl
phpini
tip realpathcache
+7
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
IO move DB on RAM
tip moveiofromshared
if you use sqlite move it on devshm
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
vagrant plugin install vagrantcachier
tip vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
tip moveiofromshared
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
if
configcachesynced_folder_opts type mount_options [ end
tip moveiofromshared
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
use cachefilesd for nfs
tip cachefilesd
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
tip cachefilesd
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
tip cachefilesd
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
tip cachefilesd
configvmsynced_folder mount_options [
Vagrantfile
-15+10
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
ForwardAgent yes
check ssh config file in your host machine
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Provisioning
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
to phansible or not to phansible
tip provisioningtpls
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
can you assume everyone in your team have the same version
tip provisioningtpls
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
tip provisioningtpls
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
the provisioning tool is a moving part wanna update be careful
tip provisioningtpls
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
create Vagrant indipendent provision
scripts
tip provisioningtpls
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
tip provisioningtpls
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
create your own template
tip provisioningtpls
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
yoursquore in control of provisioning command
you can perform additional checks on host machine
tip provisioningtpls
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
provisioning does not create immutable vm by default
eg package update on LTS
tip packaging
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
live on the edge and fix provision script
use stable package repositories
tip packaging
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
tip goldenimage
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548
vagrant package - -name myboxbox
publish it somewhere (http atlas)
tip packaging
cvmbox_url = ldquohttpmyboxboxrdquo
Questions
httpsjoindintalkview14548