Search code examples
amazon-web-servicesaws-cloudformationaws-cloudformation-custom-resourceontap

AWS Create ONTAP volume from existing Storage Virtual Machines(SVM)


I want to create an AWS ONTAP Volume only Based on the existing Storage Virtual Machines(SVM) .

I have SVM ID and Name are available with me in order to use then in the new stack which i am creating to spin the new Volume(s).

My SVM ID is : svm-04c2e2830ff42097e.

I tried Below: But did not worked.

---
Description: "Create FSx for ONTAP Filesystem"
Resources:
  AWSDemoVolume:
    Type: "AWS::FSx::Volume"
    Properties:
      Name: AWSBackupDemovol001
      OntapConfiguration:
        JunctionPath: /AWSBackupDemovol001
        SizeInMegabytes: 150
        StorageEfficiencyEnabled: true
        StorageVirtualMachineId: 
        - !ImportValue "svm-04c2e2830ff42097e"
        TieringPolicy:
          CoolingPeriod: 0
          Name: AUTO          
      VolumeType: "ONTAP"
      Tags:
        - Key: "Bacup_Tag"
          Value: "backup"
        - Key: "Created_By"
          Value: "Cloud Micron"
Outputs:
  FileSystemId:
    Value: !Ref "AWSdemocluster"
  SvmId:
    Value: !Ref "AWSDemosvm"
...

Solution

  • You can give a try which below ..

    I have encountered same issue before. There is catch in the template below where as per documentation it says clearly that it needs string thus you don't required !ImportValue here. just remove that, please look at the AWS DOC HERE

    Secondly, there is also another problem in the below code as you defined the CoolingPeriod: 0 which is not correct as value can not be zero either it should be minimum 2 or greater.

    ---
    Description: "Create FSx for ONTAP Filesystem"
    Resources:
      AWSDemoVolume:
        Type: "AWS::FSx::Volume"
        Properties:
          Name: AWSBackupDemovol001
          OntapConfiguration:
            JunctionPath: /AWSBackupDemovol001
            SizeInMegabytes: 150
            StorageEfficiencyEnabled: true
            StorageVirtualMachineId: "svm-04c2e2830ff42097e"
            TieringPolicy:
              CoolingPeriod: 2
              Name: AUTO          
          VolumeType: "ONTAP"
          Tags:
            - Key: "Bacup_Tag"
              Value: "backup"
            - Key: "Created_By"
              Value: "Cloud Micron"
    ...