Generate an EC2 AMI from the vSBC Image

You perform this procedure to convert the Oracle Communications Session Border Controller (SBC) image provided by Oracle into an AMI, from which you can create vSBC machines.

This procedure requires that you, from the EC2 system, create a Linux machine, attach a new disk to it, and put the SBC image on your machine. Next, use the Linux command line to convert the image from qemu to raw format, then perform a data definition (dd) procedure to write the disk image. Finally, you create a snapshot of the disk and convert the snapshot to an AMI image. You can create vSBCs from this AMI.
  1. Launch an instance of the Red Hat Enterprise Linux 7.3 (HVM) with a Public IP for ssh access. You must create this Linux instance in the same Availability Zone as your second disk volums.
  2. Attach a second disk volume of 20GB to the VM instance, as a known device (e.g. /dev/xvdb). Create this disk using volume type General Purpose SSD (gp2).
  3. Download your SBC image via Oracle support. The correct image name is appended with -img-vm_kvm.tgz.
  4. Copy the KVM release image to the target VM.
    scp -i "Oracle.pem" nnSCZ830-img-vm_kvm.tgz ec2-user@public_ip_addr:
  5. ssh into the target VM.
    ssh -i "Oracle.pem" ec2-user@public_ip_addr
  6. Extract the qcow2 disk imagie from the release package. The command line below uses version 8.3.0 as an example.
    tar xvfz nnSCZ830-img-vm_kvm.tgz
  7. Install the KVM image conversion utility.
    sudo yum install qemu-img
  8. Convert the image to raw format.
    qemu-img convert -p nnSCZ830-img-vm_kvm.qcow2 nnSCZ830-img-vm_kvm.raw
  9. When you attach the disk to the VM, choose the disk symbol, for example sdf. You can check this by navigating to Image/Volumes/Attachment information.
    Attachment information i-06715fac7647142fc (SQA-OL6-ANVIL-1):/dev/sdf (attached)
  10. Verify the attachment using the linux list block devices command, lsblk. Example output is shown below.
    host:/dev$ lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    xvda 202:0 0 200G 0 disk
    └─xvda1 202:1 0 15G 0 part /
    xvdf 202:80 0 20G 0 disk
  11. Write the raw image into the 20GB volume.
    sudo dd if=nnSCZ830-img-vm_kvm.raw of=/dev/xvdb

    You may or may not be able to use the status=progress flag within this command. This is dependent on the version of the dd command. In addition, note that using the status=progress flag causes the process to take longer.

  12. From the EC2/Elastic Block Store/Volumes tab, right-click the 20GB volume and click Detach Volume from the VM.
  13. From the same tab, right click the 20GB volume again, click Create Snapshot and wait for the snapshot to complete.
  14. From the EC2/Elastic Block Store/Snapshots tab, right-click the snapshot, and click Create Image to generate an AMI.

    The Create Image from EBS Snapshot dialog oprovides for multiple configurations, including:

    • Name your Image.
    • Select x86_64 from the Architecture drop-down.
    • Select Use default from the RAM disk ID drop-down.
    • Select Hardware-assisted virtualization from the Virtualization type drop-down.
    • Select Use default from the Kernel ID drop-down.
    • Select General Purpose SSD (gp2) from the Volume Type drop-down.
You can use this AMI to launch new VM instances. Follow the procedures to format the hard disk if you create instances with a disk volume greater than 20GB.