[cs615asa] HW#6 Question 1

Jan Schaumann jschauma at stevens.edu
Sun Apr 9 16:43:14 EDT 2017


Tianxiao Yang <tyang8 at stevens.edu> wrote:
 
> "$ afewmore i-0a1b2c3d4f" this command generated ten IDs, but one of
> them is the original ID itself, there are only 9 newly generated IDs.
> Do we need to count the source instance itself as newly generated
> instance?

No.  The example output was wrong, I have updated the manual page:

$ afewmore i-0a1b2c3d4f
i-1a1b2c3d4f
i-2a1b2c3d4f
i-3a1b2c3d4f
i-4a1b2c3d4f
i-5a1b2c3d4f
i-6a1b2c3d4f
i-7a1b2c3d4f
i-8a1b2c3d4f
i-9a1b2c3d4f
i-0b1b2c3d4f
$ 


> 2.
> 
>      -d dir   Copy the contents of this data directory from the orignal source
>               instance to all the new instances.  If not specified, defaults
>               to /data.
> 
> By default(-d not specified), source data directory should be /data, but in the example below:
> 
>      To create just one more instance and copy the contents of the directory
>      '/usr/local/share':
> 
>            $ afewmore -n 1 i-0a1b2c3d4f
>            i-1a1b2c3d4f

This example invocation was missing the '-d' flag.  I've updated the
manual page:

$ afewmore -d /usr/local/share -n 1 i-0a1b2c3d4f
i-1a1b2c3d4f

> User who uses afewmore cannot chose the directory to which the contents of source data should be copied.
> -- Can we just copy the source data to home directory of newly created instance?

No, the objective is to create a clone or copy of the original instance,
so the data from the source needs to be copied into the same location on
the destination instance(s).

> -- If we need to copy the /data directory from source instance A to
> the /data directory in newly created instance B(doesn't have a /data
> directory), we usually need to execute the operation as superuser for
> instance B. How could we know the what is the superuser command(sudo
> or yum etc.)?

You need to work as the super user on both instances.  Given how
different EC2 instances handle user logins and superuser access, you
probably need to have an internal mapping of OS to correct user / access
method.

> -- If /data directory in A is a mount point for a filesystem, do we need to create the same filesystem in B and mount it to the same directory?

I think that's not necessary.  While that would be useful, I suspect
it'd make the assignment overly complicted.  To simplify, you may ignore
differences in partitions.

-Jan


More information about the cs615asa mailing list