Skip to content

Include VCH IP and management IP in create and inspect output#7832

Merged
zjs merged 4 commits intovmware:masterfrom
zjs:issue/6517
Apr 25, 2018
Merged

Include VCH IP and management IP in create and inspect output#7832
zjs merged 4 commits intovmware:masterfrom
zjs:issue/6517

Conversation

@zjs
Copy link
Member

@zjs zjs commented Apr 24, 2018

Allow users to take note of the VCH endpoint VM's ID for debugging or use with subsequent vic-machine commands.

The public and client IPs are already included. Output the management IP as well.

Fixes: #6517


Example create output:

$ bin/vic-machine-linux create --target=$TARGET --thumbprint=$THUMBPRINT --user=$USER --password=$PASSWORD --image-store=sharedVmfs-0 --bridge-network=network --compute-resource=cluster1 --no-tls --name=output-test
...
INFO[0058] Initialization of appliance successful       
INFO[0058]                                              
INFO[0058] VCH ID: vm-808                               
INFO[0058]                                              
INFO[0058] VCH Admin Portal:                            
INFO[0058] https://10.162.14.102:2378                   
INFO[0058]                                              
INFO[0058] Published ports can be reached at:           
INFO[0058] 10.162.14.102                                
INFO[0058]                                              
INFO[0058] Management traffic will use:                 
INFO[0058] 10.162.14.102                                
INFO[0058]                                              
INFO[0058] Docker environment variables:                
INFO[0058] DOCKER_HOST=10.162.14.102:2375               
INFO[0058]                                              
INFO[0058] Connect to docker:                           
INFO[0058] docker -H 10.162.14.102:2375 info            
INFO[0058] Installer completed successfully             

Example inspect output:

$ bin/vic-machine-linux inspect --target=$TARGET --thumbprint=$THUMBPRINT --user=$USER --password=$PASSWORD --name=output-test
INFO[0000] ### Inspecting VCH ####                      
INFO[0000] Validating target                            
INFO[0001]                                              
INFO[0001] Installer version: v1.5.0-dev-0-a619161      
INFO[0001] VCH version: v1.5.0-dev-0-ed2e4c3            
INFO[0001]                                              
INFO[0001] VCH upgrade status:                          
INFO[0001] Installer has same version as VCH            
INFO[0001] No upgrade available with this installer version 
INFO[0001]                                              
INFO[0001] VCH ID: vm-805                               
INFO[0001]                                              
INFO[0001] VCH Admin Portal:                            
INFO[0001] https://10.162.19.192:2378                   
INFO[0001]                                              
INFO[0001] Published ports can be reached at:           
INFO[0001] 10.162.19.192                                
INFO[0001]                                              
INFO[0001] Management traffic will use:                 
INFO[0001] 10.162.19.192                                
INFO[0001]                                              
INFO[0001] Docker environment variables:                
INFO[0001] DOCKER_HOST=10.162.19.192:2375               
INFO[0001]                                              
INFO[0001] Connect to docker:                           
INFO[0001] docker -H 10.162.19.192:2375 info            
INFO[0001] Completed successfully                       

zjs added 2 commits April 24, 2018 16:36
Allow users to take note of the VCH endpoint VM's ID for debugging
or use with subsequent vic-machine commands.
The public and client IPs are already included. Output the management
IP as well.
@codecov-io
Copy link

codecov-io commented Apr 25, 2018

Codecov Report

Merging #7832 into master will increase coverage by 0.21%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7832      +/-   ##
==========================================
+ Coverage   25.85%   26.07%   +0.21%     
==========================================
  Files          35       35              
  Lines        5124     5124              
==========================================
+ Hits         1325     1336      +11     
+ Misses       3692     3683       -9     
+ Partials      107      105       -2
Impacted Files Coverage Δ
cmd/tether/attach.go 62.83% <0%> (+0.61%) ⬆️
cmd/vic-machine/common/images.go 67.47% <0%> (+6.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6355f0...a619161. Read the comment docs.


func (d *Dispatcher) ShowVCH(conf *config.VirtualContainerHostConfigSpec, key string, cert string, cacert string, envfile string, certpath string) {
moref := new(types.ManagedObjectReference)
if ok := moref.FromString(conf.ID); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

is !ok expected?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know of a case where we'd get !ok.

d.op.Infof("%s", publicIP.String())

d.op.Info("")
managementIP := conf.ExecutorConfig.Networks["management"].Assigned.IP
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure you never get nil somewhere in the middle?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, we should be okay, but perhaps it would be good to be defensive here in case something changes in the future.

@zjs zjs merged commit 696cb97 into vmware:master Apr 25, 2018
zjs added a commit to zjs/vic that referenced this pull request Jun 21, 2018
Allow users to take note of the VCH endpoint VM's ID for debugging or
use with subsequent vic-machine commands.

Additionally, output the management IP.

(cherry picked from commit 696cb97)
zjs added a commit to zjs/vic that referenced this pull request Jun 22, 2018
Allow users to take note of the VCH endpoint VM's ID for debugging or
use with subsequent vic-machine commands.

Additionally, output the management IP.

(cherry picked from commit 696cb97)
zjs added a commit to zjs/vic that referenced this pull request Jun 28, 2018
Allow users to take note of the VCH endpoint VM's ID for debugging or
use with subsequent vic-machine commands.

Additionally, output the management IP.

(cherry picked from commit 696cb97)
zjs added a commit to zjs/vic that referenced this pull request Jul 2, 2018
Allow users to take note of the VCH endpoint VM's ID for debugging or
use with subsequent vic-machine commands.

Additionally, output the management IP.

(cherry picked from commit 696cb97)
zjs added a commit to zjs/vic that referenced this pull request Jul 2, 2018
Allow users to take note of the VCH endpoint VM's ID for debugging or
use with subsequent vic-machine commands.

Additionally, output the management IP.

(cherry picked from commit 696cb97)
zjs added a commit to zjs/vic that referenced this pull request Jul 27, 2018
Allow users to take note of the VCH endpoint VM's ID for debugging or
use with subsequent vic-machine commands.

Additionally, output the management IP.

(cherry picked from commit 696cb97)
zjs added a commit that referenced this pull request Jul 27, 2018
Allow users to take note of the VCH endpoint VM's ID for debugging or
use with subsequent vic-machine commands.

Additionally, output the management IP.

(cherry picked from commit 696cb97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants