Subscribe

Removing a policy from a volume CLI ?

[ Edited ]

I recently assigned an export policy to a volume using the command:

 

volume modify -volume VOLUME_NAME -vserver VSERVER_NAME -policy EXPORT_POLICY_NAME

 

Does anyone know how to undo this action as the volume has been built on the wrong cluster.

 

I cannot find anything in the documentation on how to remove a policy from a volume or to remove a volume from a policy.

 

Is it a namespace command? Easy from the GUI but I dont want to use the GUI.

 

I've worked it out:

 

vol unmount -vserver VSERVER_NAME -volume VOLUME_NAME

Re: Removing a policy from a volume CLI ?

::> vol create -vserver nfs01 -volume rpetertest04 -aggregate aggr2_SATA -size 2g
[Job 15009] Job succeeded: Successful

::> vol show -vserver nfs01 -volume rpetertest04 -fields policy 
vserver volume       policy  
------- ------------ ------- 
nfs01   rpetertest04 default

::> vol show -vserver nfs01 -volume rpetertest04                               

                                   Vserver Name: nfs01
                                    Volume Name: rpetertest04
                                 Aggregate Name: aggr2_SATA
                                    Volume Size: 2GB
                             Volume Data Set ID: 1958
                      Volume Master Data Set ID: 2147485608
                                   Volume State: online
                                    Volume Type: RW
                                   Volume Style: flex
                         Is Cluster-Mode Volume: true
                          Is Constituent Volume: false
                                  Export Policy: default
                                        User ID: 0
                                       Group ID: 0
                                 Security Style: unix
                               UNIX Permissions: ---rwxr-xr-x
                                  Junction Path: -

Since every volume must have an export policy. As you can see, even if you haven't

specify the eport policy while you create a volume, ontap will select the default one for you. 

 

So if you like to revert what you did.. just modify and assign the "default" export policy 

the same way as you did.

 

robin.