Skip to content

Commit

Permalink
adding logging line numbers and more debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislovecnm committed Jun 7, 2016
1 parent e301b25 commit 680128a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ func resourceVSphereVirtualMachineUpdate(d *schema.ResourceData, meta interface{
}

log.Printf("[INFO] Attaching disk: %v", diskPath)
log.Printf("[INFO] Attaching datastore: %v", datastore)
err = addHardDisk(vm, size, iops, "thin", datastore, diskPath, controller_type)
if err != nil {
log.Printf("[ERROR] Add Hard Disk Failed: %v", err)
Expand Down Expand Up @@ -716,6 +717,7 @@ func resourceVSphereVirtualMachineUpdate(d *schema.ResourceData, meta interface{
}

func resourceVSphereVirtualMachineCreate(d *schema.ResourceData, meta interface{}) error {
log.SetFlags(log.Lshortfile)
client := meta.(*govmomi.Client)

vm := virtualMachine{
Expand Down Expand Up @@ -1299,7 +1301,7 @@ func addHardDisk(vm *object.VirtualMachine, size, iops int64, diskType string, d
backing.ThinProvisioned = types.NewBool(true)
}

log.Printf("[DEBUG] addHardDisk: %#v\n", disk)
log.Printf("[DEBUG] addHardDisk: %s\n", disk)
log.Printf("[DEBUG] addHardDisk capacity: %#v\n", disk.CapacityInKB)

return vm.AddDevice(context.TODO(), disk)
Expand Down Expand Up @@ -1465,6 +1467,7 @@ func createCdroms(vm *object.VirtualMachine, cdroms []cdrom) error {
}

func (vm *virtualMachine) setupVirtualMachine(c *govmomi.Client) error {
log.SetFlags(log.Lshortfile)
dc, err := getDatacenter(c, vm.datacenter)

if err != nil {
Expand Down

0 comments on commit 680128a

Please sign in to comment.