Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • Matthieu Paturot 4:05 pm on January 17, 2020 Permalink | Reply  

    from Bitbucket to TFS #realquick #memo 

    I had to do a move from Bitbucket to TFS


    It was done without pain… There were few steps :

    git clone –bare
    git push –mirror
    git rm –cached


  • Matthieu Paturot 2:32 pm on January 16, 2020 Permalink | Reply  

    Clone VMs by snap fingers – Terraform and vSphere 

    In the past, I played with Terraform but it was not in a professional context 

    Now, I had to use it for my job with vSphere :)

    Not a big deal ! 

    I wanted to create a bunch of VMs from a template, the configuration is simple, you have to “declare” :

    • a datacenter
    • a resource pool
    • a host
    • a datastore
    • a network
    • a template
    • a FOLDER

    Before to continue, I want to talk about the FOLDER… I had to use this resource for creating my VMs, otherwise it was not possible :/

    resource “vsphere_folder” “folder” {
    path = “XX/XX/testing-infra”
    type = “vm”
    datacenter_id = “${}”

    In other terms, I don’t know how to add VMs to an existing folder, so each time I have new friend !

    For the rest of the configuration, you have to use “count” with the number of your choice :

    resource “vsphere_virtual_machine” “vm” {
    count  = 3
    name = “${var.servername}-${count.index + 1}
    num_cpus = 2
    memory = 2048
    datastore_id = “${}”
    host_system_id = “${}”
    resource_pool_id = “${}”
    guest_id = “${data.vsphere_virtual_machine.template.guest_id}”
    scsi_type = “${data.vsphere_virtual_machine.template.scsi_type}”
    folder = “${vsphere_folder.folder.path}

    Then you can add the variable ${count.index + 1}” to increment automatically the name of your VMs for example or the hostname, IP address and so on.

    You can have a look in my repo. There are two files :

    •, the playbook
    •, the variables defined in like this “${var.vsphere_user}” for the user by example.

    Fill Log me in

    Logs are important and you know it :

    export TF_LOG=”TRACE”
    export TF_LOG_PATH=”terraform.txt”

    Plug me in

    I almost forgot to talk about the plugin vSphere for Terraform :p

    You can take it here

    Then after the unzip, put it in this directory :


    The folder .terraform should be in a directory with and

    Happy Three Friends

    ./terraform init
    ./terraform plan
    ./terraform apply

    Commands to run the playbook :

    • init, to fetch the provider before deploying for example and in our case it’s about vSphere
    • plan, to validate the plan
    • apply, to apply the plan

    Mea Culpa

    As you can see, I’m not an expert and you can find easily more information about this topic but I hope I will help you to start your journey :) I am only a small INN where you can have a rest and good time !

    On board !

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc