Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IAM and Windows instructions #14

Open
wants to merge 7 commits into
base: experimental
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 45 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,47 @@ Example scenarios we have tested are in [Scenarios](Scenarios.md)

IAM permissions required for reading and writing snapshots are documented [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebsapi-permissions.html).

Below is an example IAM template:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeSnapshots",
"ec2:DescribeRegions",
"ebs:StartSnapshot",
"ebs:PutSnapshotBlock",
"ebs:ListSnapshotBlocks",
"ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock",
"ebs:CompleteSnapshot"
],
"Resource": "*"
}
]
}
```

If you require integration with s3 following are the additional permissions necessary.
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketAcl",
"s3:ListBucket",
"s3:PutObject",
"s3:GetObject"
],
"Resource": "arn:aws:s3:::*"
}



The below one-liner will generate a list of all commands for which test cases exist, and show their syntax.

```python3
```bash
% cat test/test_functional.py|grep python3 | cut -d "/" -f 2-3 | awk -F"[{']" '{print $1 $3 " " $6 " " $9}'

src/main.py list ORG_SNAP
Expand Down Expand Up @@ -67,7 +105,7 @@ TODO: implement a `setup.py` script for CLI configuration/installation.
## Features

Flexible Snapshot Proxy supports the following commands:
```bash
```
list Returns accurate size of an EBS Snapshot by enumerating
actual consumed/allocated space.

Expand Down Expand Up @@ -97,9 +135,9 @@ sync Synchronizes the incremental difference between 2
changes.

movetos3 Transfers an EBS Snapshot or an arbitrary image file / block
(TODO: verify device to a customer-owned S3 Bucket (any S3 Storage Class, or
block->S3 path) Snow Family), with zstandard compression, tuneable object
size and an independent segment checksum.
(TODO: verify device to a customer-owned S3 Bucket (any S3 Storage Class, or
block->S3 path) Snow Family), with zstandard compression, tuneable object
size and an independent segment checksum.

getfroms3 Transfers a Snapshot stored in a customer-owned S3
Bucket to a new block volume or file.
Expand All @@ -109,8 +147,8 @@ multiclone Same functionality as `download`, but writing to
snapshot to multiple volumes.

fanout Upload from arbitrary file or block device to
multiple EBS Snapshot(s) in parallel, provided a list
of regions.
multiple EBS Snapshot(s) in parallel, provided a list
of regions.
```
## Design Overview

Expand Down
51 changes: 51 additions & 0 deletions WindowsReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Windows specifc instruction

## Installation

Currently, the utility will enumerate all Python package dependencies on runtime, and install necessary packages via `pip3` if they are not already installed on the system. It will show no indication of progress, and will not ask the user for permission to install additional packages.

Open CMD using 'Run as Administrator'.

Download and Install Chocolatey using the following command.
```
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
```
Download and install python using the following command.
```
choco install -y python3
```
You can check the version to verify if Python was successfully installed as follows.
```
python --version
```
configure AWS Account
```
AWS configure
```

update pip
```
python -m pip install --upgrade pip
```


Install dependencies by running src/main.py for the first time such as
```

src/main.py list ORG_SNAP
```

Automount is enabled by default in Windows. When enabled, Windows automatically mounts the file system for a new volume (disk or drive) when it is added (connected) to the system, and then assigns a drive letter to the volume. Disk corruption can occur if data is changed on the drive while sanpshots deltas are being downloaded. To prevent this disable automounting of drives.

1. Open CMD using 'Run as Administrator'.

2. Type diskpart into the elevated command prompt, and press Enter. (see screenshot below)

3. Type automount disable into the elevated command prompt, and press Enter.

After the snapshots have been downloaded assing drive letters to each of the volume.


## License

This project is licensed under the Apache-2.0 License.