LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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


Closed Thread
  Search this Thread
Old 03-30-2013, 03:22 PM   #1
juniorb0y007
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Rep: Reputation: Disabled
Write a bash script to create a virtual


Hello,

I am taking a Linux class right now, and my teacher has requested me to write a bash script. I have been given IP address of the server to create virtual machine on the server. I need someone to help me with this project by getting me started on this project. I have no clue right now how to start this project. Any help will be appreciated. Here is the requirement:

Write a bash script to create a virtual machine running Scientific Linux 6.3, x86_64 architecture. The
image should include the
telnet client
package, the
ftp
package, and the
httpd
package. The virtual
image should use 1GB of RAM, one virtual CPU, use a 4GB qcow2 disk image, connect to the
“virtual_bridge” network bridge using a random MAC address and DHCP boot protocol. The image
name should be <user name>. The image should run on an IBM blade server with a Scientific
Linux host operating system and KVM hypervisor.
You instructor will provide connection credentials in class.
The script must contain:

a title block

conditional debugging output

variables

ample comments

use of positional parameters to enable debugging and the image

Last edited by juniorb0y007; 03-30-2013 at 03:26 PM.
 
Old 03-30-2013, 04:10 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
so what have you done already? Admitting it's homework doesn't somehow mean it's NOT homework... you need to ask us *SPECIFIC* questions and we can help you in those situations. We aren't here to do your work for you.
 
Old 03-30-2013, 05:16 PM   #3
juniorb0y007
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
bash script

Quote:
Originally Posted by acid_kewpie View Post
so what have you done already? Admitting it's homework doesn't somehow mean it's NOT homework... you need to ask us *SPECIFIC* questions and we can help you in those situations. We aren't here to do your work for you.
acid,

I agree with you. I am learning about bash script syntax right now. Also, I created my first simple bash script which executed correctly. I just started on this project today, and I will ask specific questions when needed. I was just asking for links and material from you guys that could help me complete this project. Thanks.
 
Old 03-31-2013, 11:21 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
The first thing you should do when writing a script is to break it down into all the simple commands that you have to run to accomplish what you want.

Test the commands separately on the command line until you're sure you have their syntax and order of execution correct.

Then you can start to generalize the procedure, replacing fixed strings with variables and embedding them in loops for multiple runs.

That's it really. All a script is in the end is an automated sequential command list, with the syntax of the shell being used to generate the arguments you need for them.


Feel free to ask if you have problems with any of the individual steps.


And if you haven't seen the Bash Guide yet, IMO it gives perhaps the best generalized rundown of all of bash's major features.

Last edited by David the H.; 03-31-2013 at 11:25 AM. Reason: fixed link
 
Old 04-02-2013, 02:17 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

http://www.linuxquestions.org/questi...pt-4175456183/

Closing the 1 minute older original in favour of the more sensibly placed dupe.
 
  


Closed Thread



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
[SOLVED] Is it possible to create a bash script to create multiple new bash scripts Batistuta_g_2000 Linux - Newbie 6 02-19-2013 11:42 AM
Can somebody write me a bash script trintukaz Programming 9 09-26-2011 03:02 PM
Bash Script Help - Trying to create a variable inside script when run. webaccounts Linux - Newbie 1 06-09-2008 02:40 PM
Need to write a bash script imagineers7 Linux - General 5 05-09-2006 11:17 PM
how to write a script to create a directory mgam Linux - Newbie 1 10-29-2003 12:08 PM

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

All times are GMT -5. The time now is 08:43 AM.

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
Open Source Consulting | Domain Registration