Manual snapshot NOT FOUND during CreateInstancesFromSnapshot operation

0

skeleton:

{
    "instanceNames": [
        "$instance-v3"
    ],
    "availabilityZone": "us-east-1a",
    "instanceSnapshotName": "$snapshot-2",
    "bundleId": "large_3_0",
    "keyPairName": "$keypair",
    "tags": [
        {
            "key": "blueprint",
            "value": "centos7"
        },
        {
----- truncated ---
$ aws lightsail create-instances-from-snapshot --cli-input-json file://$skeleton.json

An error occurred (NotFoundException) when calling the CreateInstancesFromSnapshot operation: The InstanceSnapshot does not exist: $instance-snapshot-2

$ aws lightsail get-instance-snapshots --region us-east-1 --query ******** --output table

| GetInstanceSnapshots | +-----------------------------------+------------------------+------------------------------------+-------------------+-----------+------------+ | createdAt | fromInstanceName | name | resourceType | sizeInGb | state | +-----------------------------------+------------------------+------------------------------------+-------------------+-----------+------------+ | 2023-07-04T00:40:21.561000-04:00 | $instance | $instance-********* | InstanceSnapshot | 40 | available | | 2023-07-05T20:18:53.983000-04:00 | $instance | $instance-snapshot-1 | InstanceSnapshot | 80 | available | | 2023-07-11T01:10:31.702000-04:00 | $instance | $instance-snapshot-2 | InstanceSnapshot | 80 | available | +-----------------------------------+------------------------+------------------------------------+-------------------+-----------+------------+

While the manually generated snapshot ($instance-snapshot-2) is present when queried, the CreateInstancesFromSnapshot operation keeps failing.

Please, what could explain this and how can it be remedied?

Any help will be deeply appreciated.

profile picture
preguntada hace un año223 visualizaciones
3 Respuestas
0
Respuesta aceptada

I can see you are passing in the region via --region us-east-1 in the get-instance-snapshots request but not in the command for create-instances-from-snapshot ( though it could perhaps be in your cli-input-json file which being truncated in your original post, I cannot confirm ). Could you confirm if you are in fact making both requests in the same AWS Region ?

profile pictureAWS
EXPERTO
AWS-SUM
respondido hace un año
  • Thank you so much. Passing the "--region" parameter got the job done. Deeply appreciated.

0

The "instanceSnapshotName" in the json file parameter is "$snapshot-2", is this correct?

profile picture
EXPERTO
respondido hace un año
  • The "$snapshot-2" and "$instance-snapshot-2" are just placeholders for the actual snapshot name and are interchangeable in this case.

    That didn't impact the question or issue.

    Thanks

0

The issue is that since there is no way to build an image that one can use with TF or for repeated deployment and there is no way to upsize or scale a Lightsail instance without a snapshot makes it very difficult to use.

It means that for each iteration of the instance, we need to sometimes manually snapshot especially when there is a need for immediate upsizing, and use that to redeploy the software.

Without being to use a JSON file, it means running aws lightsail commands one per one which is slow and stretches the deployment time.

Had it being there is a way to create an image, this would have been just a "tf apply" with the configurations needed and done.

profile picture
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas