Giter Site home page Giter Site logo

natilik / terraform-provider-scvmm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gslabdev/terraform-provider-scvmm

0.0 0.0 0.0 177 KB

Automates the Microsoft System Center Virtual Machine Manager (SCVMM) resources creation during Infrastructure build using Terraform Provider.

License: Mozilla Public License 2.0

Makefile 3.54% Go 91.98% Shell 2.88% HTML 1.60%

terraform-provider-scvmm's Introduction

Terraform Microsoft SCVMM Provider

This is the repository for the Terraform Microsoft SCVMM Provider, which one can use with Terraform to work with Microsoft SCVMM.

Coverage is currently only limited to Virtual Machine, Virtual Disk and Checkpoint but in the coming months we are planning release coverage for most essential Microsoft SCVMM workflows. Watch this space!

For general information about Terraform, visit the official website and the GitHub project page.

Using the Provider

The current version of this provider requires Terraform v0.10.2 or higher to run.

Note that you need to run terraform init to fetch the provider before deploying. Read about the provider split and other changes to TF v0.10.0 in the official release announcement found here.

Full Provider Documentation

The provider is usefull in adding Virtual Machine, Virtual Disk and Checkpoint using Microsoft SCVMM.

Example

# Configure the Microsoft SCVMM Provider
provider "scvmm" {
  server_ip = "${var.scvmm_server_ip}"
  port = ${var.scvmm_server_port}
  user_name = "${var.scvmm_server_user}"
  user_password = "${var.scvmm_server_password}"
}

# Add a Virtual Machine
resource "scvmm_virtual_machine" "CreateVM" {
  timeout = "10000"
  vmm_server = "WIN-2F929KU8HIU"
  vm_name = "Test_VM_demo01"
  template_name = "TestVMTemplate"
  cloud_name = "GSL Cloud"
}

#Add a Virtual Disk
resource "scvmm_virtual_disk" "demoDisk" {
  timeout = 10000
  vmm_server = "${scvmm_virtual_machine.CreateVM.vmm_server}"
  vm_name = "${scvmm_virtual_machine.CreateVM.vm_name}"
  virtual_disk_name = "demo_disk"
  virtual_disk_size = 10000
}

resource "scvmm_checkpoint" "demoCheck" {
  timeout=1000
  vmm_server="${scvmm_virtual_disk.demoDisk.vmm_server}"
  vm_name="${scvmm_virtual_machine.CreateVM.vm_name}"
  checkpoint_name="demo_checkpoint"
}

Building The Provider

NOTE: Unless you are developing or require a pre-release bugfix or feature, you will want to use the officially released version of the provider (see the section above).

Cloning the Project

First, you will want to clone the repository to $GOPATH/src/github.com/GSLabDev/terraform-provider-scvmm:

mkdir -p $GOPATH/src/github.com/GSLabDev/
cd $GOPATH/src/github.com/GSLabDev/
git clone [email protected]:terraform-providers/terraform-provider-scvmm

Running the Build

After the clone has been completed, you can enter the provider directory and build the provider.

cd $GOPATH/src/github.com/GSLabDev/terraform-provider-scvmm
make

Installing the Local Plugin

After the build is complete, copy the terraform-provider-scvmm binary into the same path as your terraform binary, and re-run terraform init.

After this, your project-local .terraform/plugins/ARCH/lock.json (where ARCH matches the architecture of your machine) file should contain a SHA256 sum that matches the local plugin. Run shasum -a 256 on the binary to verify the values match.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.9+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

See Building the Provider for details on building the provider.

Testing the Provider

NOTE: Testing the Microsoft SCVMM provider is currently a complex operation as it requires having a Microsoft SCVMM Server to test against.

Configuring Environment Variables

Most of the tests in this provider require a comprehensive list of environment variables to run. See the individual *_test.go files in the scvmm/ directory for more details. The next section also describes how you can manage a configuration file of the test environment variables.

Using the .tf-scvmm-devrc.mk file

The tf-scvmm-devrc.mk.example file contains an up-to-date list of environment variables required to run the acceptance tests. Copy this to $HOME/.tf-scvmm-devrc.mk and change the permissions to something more secure (ie: chmod 600 $HOME/.tf-scvmm-devrc.mk), and configure the variables accordingly.

Running the Acceptance Tests

After this is done, you can run the acceptance tests by running:

$ make testacc

If you want to run against a specific set of tests, run make testacc with the TESTARGS parameter containing the run mask as per below:

make testacc TESTARGS="-run=TestAccSCVMM"

This following example would run all of the acceptance tests matching TestAccSCVMM. Change this for the specific tests you want to run.

terraform-provider-scvmm's People

Contributors

bhushan-rane avatar sonawa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.