LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 05-30-2017, 12:16 PM   #1
bbraml
LQ Newbie
 
Registered: Sep 2011
Posts: 11

Rep: Reputation: Disabled
trying to get output of a vmware command passed to another vmware command


I kickstarted an esxi server, enabled ssh and connected to it. using the command, esxcfg-mpath -l to list all the drives, I need to capture the first drive listed. So I have this command:
Code:
esxcfg-mpath -l | grep 'Device:' | head -1 | awk '{print $2}'
This gives me the proper output, which is the name of the needed drive. I need to pass this to my next command:
Code:
vmfkstools -r /vmfs/devices/disks/that_output_from_awk /vmfs/volumes/datastore1/vm1/disk.vmdk
I am running into a roadblock on how to get that done.
 
Old 05-30-2017, 01:45 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19 MATE
Posts: 6,213
Blog Entries: 2

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
Quote:
Originally Posted by bbraml View Post
I kickstarted an esxi server, enabled ssh and connected to it. using the command, esxcfg-mpath -l to list all the drives, I need to capture the first drive listed. So I have this command:
Code:
esxcfg-mpath -l | grep 'Device:' | head -1 | awk '{print $2}'
This gives me the proper output, which is the name of the needed drive. I need to pass this to my next command:
Code:
vmfkstools -r /vmfs/devices/disks/that_output_from_awk /vmfs/volumes/datastore1/vm1/disk.vmdk
I am running into a roadblock on how to get that done.
Assign a bash variable to the output from the first command.

Insert that variable in the filepath in the second command.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why I did not run in the fedora 17 yum command of vmware 10 thanhtam1222 Linux - Newbie 1 08-28-2015 02:23 AM
Is the output of the tcpdump command checksum passed? omega341991 Linux - Networking 1 06-05-2012 06:44 PM
vmware-vdiskmanager command not found VMWare ESX linuxlover.chaitanya Linux - Virtualization and Cloud 4 05-18-2012 01:41 AM
[SOLVED] VMware Linux suse ping command ziadh Linux - Newbie 18 08-26-2010 03:18 AM
[SOLVED] command to get guest information in Vmware ESX? your_shadow03 Linux - Newbie 1 05-08-2010 04:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 01:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration