syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

You are here: Linux101 > linux101_cclud_instance
Question:
In Linux101 how to CCLUD Linux Instance?

Q: What is a Linux Instance?
A: A Linux instance is a running copy of Linux.

Q: How to Create a Linux instance?
A1: Install or restore are the two general choices, I prefer restore.
A2: Install off a DVD or USB stick onto my laptop.
A3: Install off a DVD, ISO, or USB stick into a VirtualBox running on my laptop.
A4: Inside cloud provider, Install off CMI.
A5: Inside cloud provider, restore from Copy of other Linux instance.
A4: This is my favorite, inside VirtualBox, restore from Copy of other Linux instance.
I offer a screen dump of restoring (importing might be a better verb) a VirtualBox OVA file:
dan@tiny ~ $ 
dan@tiny ~ $ cd Documents/
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ ls -la
total 21092524
drwxr-xr-x  2 dan dan        4096 Feb  3 01:19 .
drwxr-xr-x 40 dan dan        4096 Feb  2 07:08 ..
-rw-------  1 dan dan  9985015808 Feb  1 01:18 cen114_2015_0131.ova
-rw-------  1 dan dan 10003684352 Feb  1 03:11 cen114_2015_0201.ova
-rwx------  1 dan dan  1610022400 Feb  3 02:22 ubu_temp.ova
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ /usr/bin/vboxmanage list vms
"cen115_2015_02" {3f36383a-0483-45d0-9ff8-67ebf5e4b17e}
"ub14dan117_0126" {3f9d613c-5775-4f6e-9d1f-51ba4e09ea73}
"cen114_2015_0201" {558f1a89-0f23-4858-ba07-9395bf54386b}
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ 



dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ /usr/bin/vboxmanage import ubu_temp.ova --dry-run
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/dan/Documents/ubu_temp.ova...
OK.
Disks:  vmdisk1	8589934592	-1	
http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized	
ubu_temp-disk1.vmdk	-1	-1	
Virtual system 0:
 0: Suggested OS type: "Ubuntu_64"
    
(change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all possible values)
 1: Suggested VM name "ubu_temp"
    (change with "--vsys 0 --vmname <name>")
 2: Number of CPUs: 1
    (change with "--vsys 0 --cpus <n>")
 3: Guest memory: 1024 MB
    (change with "--vsys 0 --memory <MB>")
 4: Sound card (appliance expects "", can change on import)
    (disable with "--vsys 0 --unit 4 --ignore")
 5: USB controller
    (disable with "--vsys 0 --unit 5 --ignore")
 6: Network adapter: orig NAT, config 3, extra slot=0;type=NAT
 7: CD-ROM
    (disable with "--vsys 0 --unit 7 --ignore")
 8: IDE controller, type PIIX4
    (disable with "--vsys 0 --unit 8 --ignore")
 9: IDE controller, type PIIX4
    (disable with "--vsys 0 --unit 9 --ignore")
10: SATA controller, type AHCI
    (disable with "--vsys 0 --unit 10 --ignore")
11: Hard disk image: source image=ubu_temp-disk1.vmdk, 
target path=/home/dan/VirtualBox VMs/ubu_temp/ubu_temp-disk1.vmdk, 
controller=10;channel=0
    (change target path with "--vsys 0 --unit 11 --disk path";
    disable with "--vsys 0 --unit 11 --ignore")
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ 


That dry-run looked good.


Now I do it for real:

dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ /usr/bin/vboxmanage import ubu_temp.ova
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/dan/Documents/ubu_temp.ova...
OK.
Disks:  vmdisk1	8589934592	-1	
http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized	
ubu_temp-disk1.vmdk	-1	-1	
Virtual system 0:
 0: Suggested OS type: "Ubuntu_64"
    
(change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all possible values)
 1: Suggested VM name "ubu_temp"
    (change with "--vsys 0 --vmname <name>")
 2: Number of CPUs: 1
    (change with "--vsys 0 --cpus <n>")
 3: Guest memory: 1024 MB
    (change with "--vsys 0 --memory <MB>")
 4: Sound card (appliance expects "", can change on import)
    (disable with "--vsys 0 --unit 4 --ignore")
 5: USB controller
    (disable with "--vsys 0 --unit 5 --ignore")
 6: Network adapter: orig NAT, config 3, extra slot=0;type=NAT
 7: CD-ROM
    (disable with "--vsys 0 --unit 7 --ignore")
 8: IDE controller, type PIIX4
    (disable with "--vsys 0 --unit 8 --ignore")
 9: IDE controller, type PIIX4
    (disable with "--vsys 0 --unit 9 --ignore")
10: SATA controller, type AHCI
    (disable with "--vsys 0 --unit 10 --ignore")
11: Hard disk image: source image=ubu_temp-disk1.vmdk, 
target path=/home/dan/VirtualBox VMs/ubu_temp/ubu_temp-disk1.vmdk, controller=10;channel=0
    (change target path with "--vsys 0 --unit 11 --disk path";
    disable with "--vsys 0 --unit 11 --ignore")
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully imported the appliance.
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ 


I should see the new instance now:

dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ /usr/bin/vboxmanage list vms
"cen115_2015_02" {3f36383a-0483-45d0-9ff8-67ebf5e4b17e}
"ub14dan117_0126" {3f9d613c-5775-4f6e-9d1f-51ba4e09ea73}
"cen114_2015_0201" {558f1a89-0f23-4858-ba07-9395bf54386b}
"ubu_temp" {6006d6ba-f6c3-46a5-8534-cea79e11c6bb}
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ 
dan@tiny ~/Documents $ 
So that is an example of using the VirtualBox command line. Usually I use the VirtualBox GUI and click the file link and then the import link.

Q: How to Copy a Linux instance?
Usually the answer to this question is, 'That depends', but one certainty is that I need to shut it down before I copy it (login as root and type: shutdown -h now).
A1: If the instance is the host-OS on my laptop, I don't know how to copy it. Obviously I know how to copy files in it to something like a USB-stick or blank DVD.

This means that I keep my laptop-Linux as simple as possible.

A2: If the instance is inside VirtualBox, I can easily copy it to a large file. Then I can copy that large file to DVD(s), USB-stick, or other laptop.

The copy-feature is available from both the GUI or I can issue a command like this on the host-os:
/usr/bin/vboxmanage export my_ubuntu_virtualbox -o ~/Documents/my_ubuntu_virtualbox.ova
A3: If the instance is inside a cloud provider they always offer a way to copy your Linux-instances.

Q: How to List a Linux instance?
A1: If the instance is in VirtualBox, I just look at the GUI.
A2: If the VirtualBox GUI is unavailable, I can issue a shell command:
dan@tiny ~ $
dan@tiny ~ $ /usr/bin/vboxmanage list vms
"cen115_2015_02" {3f36383a-0483-45d0-9ff8-67ebf5e4b17e}
"ub14dan117_0126" {3f9d613c-5775-4f6e-9d1f-51ba4e09ea73}
"cen114_2015_0201" {558f1a89-0f23-4858-ba07-9395bf54386b}
dan@tiny ~ $
dan@tiny ~ $

A1: If the instance is in the cloud, the provider will have a list of instances in the web-UI somewhere. Also, I will see instances listed in my bill. Note that Amazon has different geographic regions. I need to check each region to see all instances.

Q: How to update a Linux instance?
This is actually a vague question because a Linux instance is a system of many objects.
Here is a better question:
Q: How to update objects which are loosely coupled with the Linux instance?
Here is a short list of loosely coupled objects:
  • hostname
  • Available CPU, RAM
Other objects like IP-address, diskspace, and software packages are important enough in their own right to deserve separate CCLUD discussion. I discuss them later.

Q: How to CCLUD hostname?
A: On Linux it only makes sense to either list or update hostname.
On Centos I either inspect or edit this file to list or update hostname:
/etc/sysconfig/network
On Ubuntu I either inspect or edit this file to list or update hostname:
/etc/hostname
If I update the hostname, I should reboot the Linux instance:
shutdown -r now

Q: How to CCLUD available CPU, RAM?
A1: If I talk about the host-Linux running on my laptop, the only CCLUD verb available is List. A nice GUI tool to List CPU and RAM is 'System Monitor':

A2: If I talk about a Linux-instance inside VirtualBox on my laptop, I can use all CCLUD verbs on CPU and RAM.
If I have access to the GUI I just pick an instance which has CPU and/or RAM I want to CCLUD.
Then I click the yellow gear in upper left:

A3: If I talk about a Linux-instance inside a cloud provider, I can use all CCLUD verbs on CPU and RAM.
Although it is vendor specific it is usually easily done via their web-UI.

CCLUD of Linux IP address is the next topic of Linux101:
linux101_cclud_ip


You are here: Linux101 > linux101_cclud_instance
syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me