Skip to content

MRPHS-3897: Rebasing/Upgrading libretto#61

Open
avnish30jn wants to merge 23 commits intoapporbit:masterfrom
avnish30jn:rebase_libretto
Open

MRPHS-3897: Rebasing/Upgrading libretto#61
avnish30jn wants to merge 23 commits intoapporbit:masterfrom
avnish30jn:rebase_libretto

Conversation

@avnish30jn
Copy link

@avnish30jn avnish30jn commented Nov 24, 2017

Problem

Some new fixes have been added to apcera libretto, which need to be merged with apporbit/libretto.

Solution

Rebased apcera/libretto with apporbit/libretto.

Unit-Testing

Aws Testing

[root@my_machine test]# ./awsclient
1. CreateVM
2. DeleteVM
3. ShutDownVM
4. StartVM
Select one or sequence of method(s) to test:
Ex. 1 <Enter> for CreateVM or 1 2 3 <Enter> for CreateVM followed by Delete and ShutDown VM

Your option: 1
Testing CreateVM...
VM created and is powered on
{"IPs":["13.250.13.138"],"Id":"i-0a953a91092706408"}
Sleeping for 10 seconds
[root@my_machine test]#

[root@my_machine test]# ./awsclient
1. CreateVM
2. DeleteVM
3. ShutDownVM
4. StartVM
Select one or sequence of method(s) to test:
Ex. 1 <Enter> for CreateVM or 1 2 3 <Enter> for CreateVM followed by Delete and ShutDown VM

Your option: 3
Testing ShutDownVM...
VM shutdown successful
Sleeping for 10 seconds


[root@my_machine test]# ./awsclient
1. CreateVM
2. DeleteVM
3. ShutDownVM
4. StartVM
Select one or sequence of method(s) to test:
Ex. 1 <Enter> for CreateVM or 1 2 3 <Enter> for CreateVM followed by Delete and ShutDown VM

Your option: 4
Testing StartVM...VM started successfully
Sleeping for 10 seconds
[root@my_machine test]#


[root@my_machine test]# ./awsclient
1. CreateVM
2. DeleteVM
3. ShutDownVM
4. StartVM
Select one or sequence of method(s) to test:
Ex. 1 <Enter> for CreateVM or 1 2 3 <Enter> for CreateVM followed by Delete and ShutDown VM

Your option: 2
Testing DeleteVM...
VM deleted successfully
Sleeping for 10 seconds
[root@my_machine test]#


Static ip assignment


[root@my_machine example]# go run c3ntry_client.go
Sending request:
action:"create_vms" args:"{\"Insecure\":true,\"cloud_type\":\"vsphere\",\"type\":\"PUBLIC\",\"Host\":\"vcenter.gsintlab.com\",\"Username\":\"admin@vsphere.local\",\"Password\":\"passwd\",\"Datacenter\":\"C3 DataCenter\",\"Destination\":{\"DestinationName\":\"C3 Cluster-1\",\"DestinationType\":\"cluster\",\"HostSystem\":\"\"},\"Datastores\":[],\"cluster_name\":\"Cluster1\",\"network\":{\"networks\":[{\"name\":\"VM Private\"}]},\"skip_ip_wait\":true,\"simple_name\":true,\"custom_suffix\":\"20171229054319\",\"cluster\":[{\"gid\":0,\"name\":\"tier1-vm1\",\"count\":1,\"flavor\":\"custom\",\"resources\":{\"cpu\":2,\"memory\":4096,\"fixed_disks\":[[{\"\":\"Hard disk 1\",\"Size\":100,\"DiskName\":\"[datastore2-ESXi13-2TB] visor_template_2.1/visor_template_2.1.vmdk\"}]]},\"image\":{\"Template\":\"visor_template_2.1\",\"SkipExisting\":2},\"volumes\":[[{\"size\":\"10\",\"Controller\":\"scsi\",\"provisioning\":\"thin\"}]],\"Networks\":[{\"ip_address\":\"10.10.24.231\",\"default_gateway\":\"10.10.24.100\",\"subnet_mask\":\"255.255.255.0\",\"dns_server\":\"10.10.24.50\"}]}]}" id:"cluster:1:vm:1:create"

2017/12/29 02:38:05 Received Response:
result:"{\"0\":{\"1\":{\"vm_name\":\"tier1-vm1-0-20171229054319\",\"instance_id\":\"tier1-vm1-0-20171229054319\",\"vm_id\":\"vm-7240\"},\"gid\":\"0\"}}" id:"cluster:1:vm:1:create" progress:100

2017/12/29 02:38:05 Response String:
{"result":"{\"0\":{\"1\":{\"vm_name\":\"tier1-vm1-0-20171229054319\",\"instance_id\":\"tier1-vm1-0-20171229054319\",\"vm_id\":\"vm-7240\"},\"gid\":\"0\"}}","id":"cluster:1:vm:1:create","progress":100}

2017/12/29 02:38:05 Breaking..
[root@my_machine example]#

Deployed vm apps on starling vcenter with various configurations. The app was deployed successfully. Tried various operations on the app. The operations were completed successfully. Logs are attached below:

c3ntry1.txt
visor.txt

Copy link

@pankajtandon12 pankajtandon12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the testing section of PR template.

Recommended Testing:

  • InfraVM and vsphere-c3-cluster creation for various config types
  • single/multi-vm
  • DRS enabled/disabled
  • DHCP/static-ip
  • VM template/visor workflows
  • AWS/GCP cloud-support basic testing

go:
- 1.6
- 1.7
- 1.9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is go1.9+ mandatory or recommended?
i.e. Ensure no build failure in go 1.7 enviornment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go1.9+ is recommended and build is not failing with go 1.7.

Ryan Boehning and others added 23 commits December 28, 2017 07:22
Delete unused code found by unused linter. Fix gofmt issue. Add gofmt
check to .travis.yml. Update URL for gosimple. Fix gosimple issue.
Replace use of deprecated oauth2.NoContext with context.Background().
Fix not closing fd and missing err check. Delete leaking ticker from
aws/vm.go. Add staticcheck to .travis.yml. Fix missing error check on runVMware.
This fixes a bug caught by staticcheck.
Update path from rackspace/gophercloud to gophercloud/gophercloud.
Update gophercloud/floatingip -> floatingips.
Update Associate/Dissociate to AssociateInstance and DissassociateInstance.
Update rackspace/gophercloud to gophercloud/gophercloud.
Update govmomi/object/VirtualDeviceList.CreateDiskMethod to add
datastore reference (API change).
Set InsecureIgnoreHostKey callback on SSH client.
Clean up logs by moving some work to the before_script section.
Test go tip, but allow it to fail.
Add/rewrite some comments for clarity.
This fixes a race condition reported by the Go race detector on the
close channel field. I think the original intention was to clean up
resources, but it's not necessary to nil out channels to clean them. The
garbage collector will take care of this for us.
Fix code samples not using gofmt.
Fix syntax error in Azure code sample.
Fix old reference to using govend --prune instead of dep prune.
Remove unnecessary constraints from Gopkg.toml (latest master commit
isn't a real constraint).
This commit ensures that we log out of the vCenter session we create for
each request. Previously, we were not logging out and potentially
leaving an unbounded number of active sessons hanging around.
Travis runs are really slow. We can speed them up by not testing on the
386 (32-bit) architecture. The world has moved on from 32-bit processors
and we shouldn't waste time testing on them.
This prevents us from having to drain the reader, loading it entirely
into memory, just to get the file size of the file to be uploaded. The
scp protocol requires that we know the file size ahead of time.
We use Azure resource group templates, which are analagous to CloudFormation
templates in AWS. The template has two values, "true", and "false" that are
strings instead of booleans. The Azure API ignores the invalid keys.
Previously errors returned by deploy() were ignored.
Update code for breaking changes to
  Azure/go-autorest,
  Azure/azure-sdk-for-go
  pyr/egoscale
  vmware/govmomi
@avnish30jn avnish30jn changed the title Rebase libretto MRPHS-3897: Rebasing/Upgrading libretto Dec 29, 2017
@avnish30jn
Copy link
Author

Testing done for the below:

InfraVM
single/multi-vm
DRS enabled/disabled
DHCP/static-ip
VM template/visor workflows
AWS cloud-support basic testing

Tried vsphere-c3-cluster creation for various with create_vms and cluster_configure manually as two separate steps as controller does not support c3-vmware cluster creation now(with the old ui as well).
Not done for Gcp as gcp credentials are not there. Also we are not using GCP anywhere as of now, this can be tested once the gcp changes are being used by c3ntry.

Copy link

@pankajtandon12 pankajtandon12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Assuming this is auto-rebase from apcera/libretto without any code-conflict.
Please open a jira ticket to do "session logout" before cancelling it for all newly added instances, as recommended by updated libretto.

@avnish30jn
Copy link
Author

Created jira ticket MRPHS-4436 to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants