title: Terraform with GCP: copy vm instance to different gcp project
body: <h2>Background</h2>
  
  <p>I have two Google cloud projects: [project1] and [project2]. [project1] has a virtual machine instance called <code>my-vm</code>. I want to duplicate <code>my-vm</code> into [project2].</p>
  
  <h2>Steps I done</h2>
  
  <p>So, I created this terraform file (<code>main.tf</code>): </p>
  
  <pre><code>provider "google" {
    credentials = "${file("service-account.json")}"
    project     = "[project2]"
    region      = "us-central1"
  }
  </code></pre>
  
  <p>saved it into new directory. Now, run this commands:</p>
  
  <pre><code>$ terraform init
  $ terraform import google_compute_instance.my-vm [project1]/us-central1-a/my-vm
  Error: resource address "google_compute_instance.my-vm" does not exist in the configuration.
  
  Before importing this resource, please create its configuration in the root module. For example:
  
  resource "google_compute_instance" "my-vm" {
    # (resource arguments)
  }
  </code></pre>
  
  <p>At this point I figured out that I missed the <code>resource "google_compute_instance" "my-vm"</code> statement. So, I added it to <code>main.tf</code>. Now it's looks like this:</p>
  
  <pre><code>provider "google" {
    credentials = "${file("service-account.json")}"
    project     = "[project2]"
    region      = "us-central1"
  }
  resource "google_compute_instance" "my-vm" {
  
  }
  </code></pre>
  
  <p>Now, I was running the same <code>terraform import</code> command agian and it's come with success. A <code>terraform.tfstate</code> file was created. BUT, <em>the <code>main.tf</code> file wasn't changed. I was expecting to see the vm imported data in it, but the <code>resource "google_compute_instance" "my-vm"</code> was empty</em>. Strange... </p>
  
  <p>Now, I was running the command <code>plan</code> and got this:</p>
  
  <pre><code>$terraform plan
  
  Error: Insufficient network_interface blocks
  
    on  line 0:
    (source code not available)
  
  At least 1 "network_interface" blocks are required.
  
  
  Error: Insufficient boot_disk blocks
  
    on  line 0:
    (source code not available)
  
  At least 1 "boot_disk" blocks are required.
  
  
  Error: Missing required argument
  
    on main.tf line 7, in resource "google_compute_instance" "my-vm":
     7: resource "google_compute_instance" "my-vm" {
  
  The argument "name" is required, but no definition was found.
  
  
  Error: Missing required argument
  
    on main.tf line 7, in resource "google_compute_instance" "my-vm":
     7: resource "google_compute_instance" "my-vm" {
  
  The argument "machine_type" is required, but no definition was found.
  </code></pre>
  
  <h2>Questions:</h2>
  
  <ol>
  <li>Why after importing the resource I can't call the plan method?</li>
  <li>I saw some example to copy &amp; deploy with terraform. All of those example was duplicating the machine, based on it's basic image. So, if the developer was added some changes to the virtual machine instance, it's won't appear in the duplicated resource ([project2]). Is this possible to duplicate the vm-disk, instead of vm-image?</li>
  </ol>